Jump to content


Photo

DDS and Alpha Channel.


4 replies to this topic

#1 Hatonastick

Hatonastick
  • Newbies
  • 3 posts
  • Reputation:0

Posted 19 February 2011 - 01:01 PM

Hi, firstly I have checked via Google, plus poked about on the forum without much luck in finding an answer to this one. So hopefully I don't upset anyone by asking here. Anyway, here goes...
Is there anyway at this point in time to load a DDS file with alpha set to something other than 100%, alter the alpha channel, and save it back out again?

My situation is this. I'm currently working on a module for a game called Mount and Blade Warband and have created quite a few textures using Paint.net and never had any issues previously with any textures I've created and saved as DDS. However recently I found a texture file that I need to replace with my own version which has it's alpha channel set to something other than 100%. It's used to blend with another texture to give an aged appearance to hair.

Now this texture when loaded into Paint.net appears as a mostly transparent texture, which I cannot make any darker using the layer transparency slider which is set to maximum. ie. The texture is loaded and displayed with transparency on, but the layer transparency slider in Paint.net is set at maximum opacity as if there is no transparency -- so the only thing I can do is make it even more transparent rather than make it darker. So when I tried to make my replacement for this particular file I created my texture, set transparency for the layer to about 20%, then saved as a DDS file -- however when I load it into the BRF game editor it displays as a completely black texture, while the original file displays fine.

Hopefully I'm making sense. If not I'll attempt to clarify.

EDIT: Also does it actually create mipmaps when you ask it to when saving? I just noticed that my textures don't seem to have them.

I should point out that while I'm very experienced with programming, 2D etc. I'm pretty new to 3D programming (not that I'm doing so on this project of course -- thought it might be easier working out how to create 3D objects while using someone elses engine to start with) and 3D object creation -- so things like DDS texture formats still create a lot of head scratching. Posted Image

Edited by Hatonastick, 19 February 2011 - 01:18 PM.

  • 0

#2 Sarkut

Sarkut
  • Competition Hosts
  • 3,206 posts
  • Reputation:4

Posted 19 February 2011 - 04:44 PM

Is it possible for you to upload the original file (the one that has partial alpha, and works), and post a link?
  • 0

Posted Image


#3 Hatonastick

Hatonastick
  • Newbies
  • 3 posts
  • Reputation:0

Posted 19 February 2011 - 05:10 PM

Sure. This isn't my file of course, but the one the game uses and the one I want to replicate and replace. I think that's the one you are asking me for. In any case, this is it (can't add as attachment as even zipped it's a little too big):

DDS file with Alpha.

Edited by Hatonastick, 19 February 2011 - 05:10 PM.

  • 0

#4 Sarkut

Sarkut
  • Competition Hosts
  • 3,206 posts
  • Reputation:4

Posted 19 February 2011 - 06:00 PM

Here's a variant of the file with altered opacity, no mip maps.

See if it looks OK in the game.

Don't open and save it in Paint.NET before looking at it in the game environment.

http://s000.tinyuplo...318944109653368
  • 0

Posted Image


#5 Hatonastick

Hatonastick
  • Newbies
  • 3 posts
  • Reputation:0

Posted 19 February 2011 - 06:39 PM

Here's a variant of the file with altered opacity, no mip maps.

See if it looks OK in the game.

Don't open and save it in Paint.NET before looking at it in the game environment.

http://s000.tinyuplo...318944109653368

Yup, that looks fine in game. Does exactly what it's meant to.

Edit: I did finally work out how to save my file with the required level of alpha and with mipmaps. Basically I just changed the alpha using the layer properties, saved as DDS DXT5 with "weight by alpha" and "generate mip maps" ticked.

However I still need a way to edit DDS files that have alpha set when loaded into Paint.net. ie. being able to do something other than just increase their level of transparency would be nice. Posted Image If this is due to a limitation of Paint.net and that the author would have to add the feature, don't worry about it. I'm sure he has enough on his plate already. I'm only asking in case there is something already in Paint.net that I've missed, or a plugin in that would do the job.

Thanks.

Edited by Hatonastick, 20 February 2011 - 04:16 AM.

  • 0