Several DDS questions

Post » Wed Jan 20, 2010 12:31 pm

Hey!

I tried making a transparent texture and applying it to a chair, but it shows up as black in game. I tried saving the dds as DXT5, DXT3 and RGBA8, but all formats behave the same way. I created a normal map for it, but it's transparent as well (is that normal btw?). Can an invisible object be made in this way?

Secondly, I was wondering what's the favourite tool these days for saving dds files. I know a while back people used to prefer DDS converter, but that one hasn't been updated in ages. Is the Gimp plugin better today?

And, finally, do you know of any collection of images for all the textures available in vanilla Oblivion? Kind of like http://www.tesnexus.com/downloads/file.php?id=17570...

Thanks!

cc
User avatar
Cassie Boyle
 
Posts: 3468
Joined: Sun Nov 05, 2006 9:33 am

Post » Wed Jan 20, 2010 3:53 pm

transparancy normally is handled by the regular (colour map) dds of oblivion. The alpha channel to be more specific. The normal map has nothing to do with this. The alpha channel in the normal map only handles the nuclear dawn effects :foodndrink:

okay so the alpha channel needed ; where white is solid and towards black is more transparent where completely black is fully transparant.

so if i understood correctly you want a transparant chair.. make the alpha channel in the colour map completely black.

i think this should work.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Wed Jan 20, 2010 6:11 am

GIMP is a bit funky with fully transparent textures as it wants to treat them as having no RGB data. That would give you a black texture if the alpha channel is not being used, which is likely to be a NifSkope setting issue. I.e GIMP full transparency + Nif flagged as not using transparency = flat black.

A chair would not need any transparency in its texture so check in NifSkope to see if you can fix it there. It shouldn't matter what color isn't showing so don't bother messing with anything in GIMP.
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Wed Jan 20, 2010 4:15 pm

crimson', there are a couple of possibilities. First, is the alpha channel of your diffuse (color) map really a low value (nearly transparent)? I don't use GIMP, so can't help you there. There is another option if transparency is an issue with your 2D paint program: the free program dxtBMP. You can find it on the web and it will let you add a user defined alpha channel to an existing image. You create a grey scale image of the alpha channel you want and save it as an 8-bit .BMP. You then load your regular image into dxtBMP which will then let you replace its alpha channel with the previously saved 8-bit .BMP image.

There is a second possibility, you didn't mention an AlphaProperty block. You must add an AlphaProperty block in NifScope and adjust the Properties in the Block Details of the NiTriStrips block to include it. If you don't know how to do this, find a mod that includes transparent objects and examine the .nif file for one of the transparent objects. You can examine the windows in my http://www.tesnexus.com/downloads/file.php?id=22846 if you don't already have a mod with transparent objects.
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Wed Jan 20, 2010 8:34 pm

Hey!

Thanks for the replies guys!

@firespark - the alpha channel is completely black on the transparent texture.

@ghastley - I think you're right about that. If I load the texture in Gimp and look at the channels, the alpha one is entirely black, the other colour channels are black as well.

@Vince - I guess the alpha channel is fully transparent. I made a new file, and set the background to transparency. Btw - when you say "diffuse (colour)" map, you mean the normal dds, and when you say normal you mean the _n.dds, right?

I tried playing with the Nifskope Alpha property. When I added it to the chair with the transparent texture on, it turned from black to invisible right away (in Nifskope). In-game it's still black. I then tried adding the property, and changing the Material Property - Alpha to "0" for other parts of the chair that were previously visible (I used the transparent texture for only one texture on the chair, out of three). However, in-game that part remained visible (not black, just as it was before).

I ought to mention that I made a inventory icon with transparent background in Gimp the other day and that works as intended. Could this be a normal map issue? Should the normal map be transparent?

Thanks!

cc
User avatar
Life long Observer
 
Posts: 3476
Joined: Fri Sep 08, 2006 7:07 pm

Post » Wed Jan 20, 2010 6:35 pm

Most likely cause inside the NIf check under the NiTriStripsData in the block details and make sure that "Has Vertex colors" is marked No (if it is yes it might have a black color set to several of the vertices that is set to black !!) make a backup of the Nif and then change that setting to no by double clicking on where it says yes under the has vertex colors line in the block details window. ( many of the models have vertex colors added to help with shading and when trying to make them transparent this will still make them emit a black color) NOTE : once you change it to NO it can not easily be turned back to yes since each vertex can have a different color and the values are erased when changed to No - Hence the need to make a backup Nif before testing this !!
User avatar
danni Marchant
 
Posts: 3420
Joined: Sat Oct 07, 2006 2:32 am

Post » Wed Jan 20, 2010 6:08 pm

Hey!

Thank you for the reply!

HasVertexColours was "yes" - I changed it to "no" but in-game the chair was still black. However, I noticed that "Anywhere sittable" has an invisible chair thing, but the author's mesh has the AlphaProperty under each NiTriStrips branch, not above them as I did. So I added the property to the parts of the mesh I was testing invisibility on.

Now, with all these changes, the part of the mesh that had the transparent dds I had made is invisible in-game (yay!), but the part with the normal texture and all the bells and whistles I've set to far is still visible. If you have any idea how to make that one invisible as well, I'd be curious for curiosity's sake.

So, to recap - to get an invisible thing in game you need:
1. a transparent dds file, saved with dxt5 or dxt3, as small as possible (10x10 for example).
2. add the alphaProperty to the NiTriStrips branch you want invisible.
3. set the "alpha" value under "block details" for that branch to "0"
4. check unde NiTriStripsData, in the "block details" if hasVertexColours is set to "no".

On a side note, can anyone reply to questions 2 and 3 in the OP? :)

Cheers!

cc
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Wed Jan 20, 2010 6:42 pm

Just one minor point - I believe a texture dimension must be a power of two - so 16 x 16 is allowed, but 10 x 10 would not be. And I think 16 is the minimum, but it could be higher.
User avatar
Pete Schmitzer
 
Posts: 3387
Joined: Fri Sep 14, 2007 8:20 am

Post » Wed Jan 20, 2010 11:25 am

You can have a 1x1 texture (that's the smallest mipmap level) but the DXT compression used in DDS has a minimum block size that it must use regardless (DXT1 stores 16-pixel blocks in 8 bytes, DXT5 stores 16? bytes to a block).
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Wed Jan 20, 2010 12:27 pm

Hey!

I got a new question for you.

The Gimp DDS plugin can save in several formats, and I'm not sure for which one to go.

For compression methods there is
bc1/dxt1bc2/dxt3bc3/dxt5bc3n/dxt5nbc4/ati1bc5/ati2alpha exponent(dxt5)ycocg(dxt5)ycocg scaled(dxt5)


Now, I read on the wiki about the dds formats and the compression algorithms so I know what dxt1,3 and 5 is. I assume ati1 and 2 are similar to what the ati plugin would output. I'm not sure what the alpha exponent is. ycocg, on the other hand, seems to come from the nvidia plugin, but I'm not sure which one is better. On the plugin homepage I found this:

Added two new compressed format options using DXT5 compression. One stores the image in YCoCg colorspace as described in http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html paper. The other stores a shared exponent in the alpha channel for added color precision. The benefit of the shared exponent version over the YCoCg version is that only one instruction is required in a fragment shader to decode (color.rgb *= color.a), great for when your instruction budget is low. Otherwise, the YCoCg format is superiour in quality, but more expensive to decode in a shader


and this

Added YCoCg scaled compressed format. This format adds the extensions described in the http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html for greater color precision. Use the normal YCoCg format for images that need high quality compression, at the loss of some color precision, but with the alpha channel stored in the blue component. Otherwise, use the YCoCg scaled format for the highest quality.


I don't quite follow what he means by " The other stores a shared exponent in the alpha channel for added color precision." i.e. is that the ycocg scaled format or the alpha exponent? If it's the ycocg scaled one, then from that quote this one is less resource intensive, but worse in quality than simply ycocg.

On the other hand, from the second quote, I understand that ycocg is not as good, quality wise, as ycocg scaled. So... which one is it?

To close this off, what compression format would you suggest for each of the big categories - inventory icons, weapons/armour, furniture and any others I might have missed. I read that saving in RGB8, without any compression but half image size works sometimes. Tried it on a crate and it wasn't very nice though.

Thank you!

cc
User avatar
StunnaLiike FiiFii
 
Posts: 3373
Joined: Tue Oct 31, 2006 2:30 am

Post » Wed Jan 20, 2010 12:54 pm

Special instructions and/or shaders would need to be present in Oblivion to decode the YCoCg DXT5s, so I wouldn't worry about it. (since it doesn't, i'm 80% sure) Either way, it wouldn't be a suitable format for images needing transparency, since the alpha channel would be now used to extend the color precision of the CoCg channels (which would normally be the red and green channels of a 'normal' DXT5 RGB image, but we're converting color methods and swizzling here.)

To answer your question about scaled vs. normal; in all DXT5 routines, the alpha channel is compressed separately from the RGB channels, which is why swizzling is preferable. (much less artifacts) It looks like the normal YCoCg version for the most part ignores the blue channel, probably storing a copy of the green channel, and the exponent in alpha channel. The Scaled YCoCg eliminates the alpha channel, and stores that in the blue channel; bringing back some of the compression artifacts for doing so.

So, the normal version looks better at the cost of performance, scaled has better performance at the cost of appearance.

For nearly everything, go with DXT1, unless you need any soft fades in the transparency, then go DXT5. Most normal maps are done in DXT5, unless you don't need a fancy specular map, then DXT3 is a better option. Some of us go 8:8:8:8 for the normal maps, and halving the image size as you mention, but it's kind of a case-by-case sort of thing, since you're losing on finer details afforded by the higher resolution (which can in turn, be smeared by DXT compression.)
User avatar
A Boy called Marilyn
 
Posts: 3391
Joined: Sat May 26, 2007 7:17 am

Post » Wed Jan 20, 2010 12:18 pm

Special instructions and/or shaders would need to be present in Oblivion to decode the YCoCg DXT5s, so I wouldn't worry about it. (since it doesn't, i'm 80% sure) Either way, it wouldn't be a suitable format for images needing transparency, since the alpha channel would be now used to extend the color precision of the CoCg channels (which would normally be the red and green channels of a 'normal' DXT5 RGB image, but we're converting color methods and swizzling here.)

To answer your question about scaled vs. normal; in all DXT5 routines, the alpha channel is compressed separately from the RGB channels, which is why swizzling is preferable. (much less artifacts) It looks like the normal YCoCg version for the most part ignores the blue channel, probably storing a copy of the green channel, and the exponent in alpha channel. The Scaled YCoCg eliminates the alpha channel, and stores that in the blue channel; bringing back some of the compression artifacts for doing so.

So, the normal version looks better at the cost of performance, scaled has better performance at the cost of appearance.

For nearly everything, go with DXT1, unless you need any soft fades in the transparency, then go DXT5. Most normal maps are done in DXT5, unless you don't need a fancy specular map, then DXT3 is a better option. Some of us go 8:8:8:8 for the normal maps, and halving the image size as you mention, but it's kind of a case-by-case sort of thing, since you're losing on finer details afforded by the higher resolution (which can in turn, be smeared by DXT compression.)


Hey!

Thanks for the reply!

So, if I understood you correctly, the YCoCg compression shouldn't be used for Oblivion.
When you mean DXT1 and DXT3/DXT5 - you mean the BC1, BC2 and BC3 variants? I'm asking because there is a http://cs.elderscrolls.com/constwiki/index.php/Choose_the_right_DXTC_compression_algorithm that says there are two compression methods for DXT1: DXT1A and DXT1C. The first one is recommended for inventory icons (fully transparent part). I'm not sure which one Gimp uses, but I think it's DXT1C - which has a white alpha channel.

Any ideas on the BC3n/DXT5n and Alpha Exponent algorithms?

In the meanwhile, I'll try saving an icon with DXT1 to see if it keeps the trasparency :)

Cheers!

cc
User avatar
Andrea P
 
Posts: 3400
Joined: Mon Feb 12, 2007 7:45 am

Post » Wed Jan 20, 2010 6:25 pm

bc1,2 and 3 are the same as DXT1,3 and 5. I'm honestly not sure if they are actually variants or not, I've never looked that up. (I use nVidia's http://developer.nvidia.com/object/texture_tools.html btw). As far as DXT1A and DXT1C, I couldn't really tell you, it's long been the standard that DXT1 always has an alpha channel, even if it's flooded with white.

bcn/DXT5n is another http://code.google.com/p/nvidia-texture-tools/wiki/NormalMapCompression, and again, would need a special shader to use, so these won't work in Oblivion. It's a great little trick, similar to the YCoCg methods, leveraging the fact that the alpha channel is compressed separately from the RGB channels.
User avatar
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm

Post » Wed Jan 20, 2010 2:05 pm

Hey!

I swapped over for Fallout 3 for a while, and things are different there. For one, Nifs don't have textures applied to them directly, but rather have a "BSShaderPPLightingProperty" with a "BSShaderTextureSet" where the textures are hidden. Most peculiar :P

What I wanted to ask you guys is this. I was looking at some sunglasses mods and I noticed that they have an additional texture file - a "_em" or "_m". I'm guessing it's a specular map, but I'm uncertain as to what's the advantage of using one instead of tweaking the material properties in NifSkope.

I hope the mods don't move this over, since it's really still a dds file question. I though it would be best to keep 'em together.

Cheers!

cc
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Wed Jan 20, 2010 7:07 am

Hey!

Does anyone have tips for levelling the luminosity of a given texture in Photoshop? I'm playing with a seamless texture for a larger one I'm working on, and little variations are quite troubling when the pattern repeats itself that often.

Right now, the only way I know is using the "Dodge" tool, but that's not really an optimal variant.

Thanks!

cc
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am

Post » Wed Jan 20, 2010 1:40 pm

You probably should have started a new topic instead of reusing your old one for a different issue.
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am


Return to IV - Oblivion