Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  
1Mac

DDS compression, alphas, normal maps

Recommended Posts

There's a big retexture mod that I'd like to try my hand at optimizing. I know my way around GIMP, but there are still some things about DDS files I'd like to learn. This tutorial at Beyond Skyrim is excellent, but leaves me with a few questions.

1.) The tutorial author is adamant about not using alpha channels where they are not needed. But it wasn't clear on when they are needed or not. I would guess that things like architecture, armor, and clutter don't really need it, while landscape, flora, effects like fire, age maps do; plus I've read that lores files for RAEVWD shouldn't have them. Any other rules that I should know of?

2.) Relatedly, the rules for compression seem to be, use DTX5 if there is transparency, DTX1 if not. Is that right?

3.) The tutorial author claims that undersized png files work better for normal maps than DDS because there are no artifacts from compression. But I've never seen such a thing in Oblivion. So is he right, and how would that work in practice?

Share this post


Link to post
Share on other sites

The CS Wiki has some information on this. Here's the page regarding DDS files. It tells you which format to use for each kind of texture.

I think you mean LOD files for RAEVWD? You want LOD to be super simple and it wouldn't have alpha. Alpha is for transparency. The page I linked explains it.

Share this post


Link to post
Share on other sites

There's good information there, thank you! I'd still like a better sense of why some modders would include transparency on certain textures. Should I assume that textures with no visible transparency don't need an alpha channel and can be exported with DXT1?

Also, the CS Wiki leaves me a little confused about alpha channels and normal maps. From the page you linked to:

Quote

 

DXT1 compresses the alpha map as all-black/white, which is highly compressible. DXT1 has a two-bit alpha channel, either white ("Implicit") or black (the color-channels are set to 0). DXT3 has a larger grayscale available ("Explicit"), and DXT5 has as wide an alpha map grayscale as it has for the color channels ("Interpolated").

Because of this, saving a Normal map as DXT1 has the unwanted side effect of causing full specular highlighting over the whole mesh to which the texture is assigned to. DXT3 or DXT5 are strongly recommended for normal maps.

 

Versus the info on this page:

Quote

Notice that the common mistake of choosing DXT5 instead of DXT1 in this case is even worse, as the completely white alpha channel will make the texture shining like a star!!. For the same reason, if you decide to store the normal map as uncompressed to get rid of the DXTC blockiness, remember to change the alpha channel into black if the texture is meant to be dull.

Plus info here that suggests the best course for normals is uncompressed dds at a quarter resolution (sort of like the Beyond Skyrim tutorial guy).

In summary, the course of action I'm thinking of for optimizing would be:

-If it has obvious transparency, use DXT5.

-If not, use DXT1.

-If it's for VWD, use DXT1 no matter what.

-For normal maps, reduce to quarter-size and export as uncompressed dds.

Does that seem right?

Share this post


Link to post
Share on other sites

Unfortunately modelling and textures are not really my thing. I can do simple models and I’ve had quite a bit of experience in creating normal maps. My advice is to follow the CS Wiki  for Oblivion. Skyrim NIF’s are very different.

The answer to your question about transparency and using DXT1 is in the block you quoted. Alpha is the degree of transparency. Absolute transparency is white, like clear glass, but you have a full gray scale to work with. Think about clear glass versus tinted windows. A subtle tint is just a bit of gray and it just tones down the brightness a bit. As you add more black, or increase the alpha value, the tint gets darker and it hides the stuff under the window more.

So to take that to a game example would be a shield.  If you want the shield to be shiny, you want the alpha to be white, or transparent. Alpha is gray scale, so increasing the alpha will put  gray mask on the shield and make it dull.

Have you checked out PyFFI? It optimizes meshes. It’s all automated, although you do need to follow the instructions in the readme. Many modders use it to optimize their meshes before releasing their mod. I suggest you check it out.

Share this post


Link to post
Share on other sites

Cool, thanks for this. Do you happen to know how to change the alpha color in GIMP? It looks like it's Layer > Transparency > Color to Alpha..., then you pick whatever color from the color picker, but I'm not sure. Also, when you make normal maps, do you use a tool like Crazy Bump, or do you have another method?

I've looked into PyFFI, but it requires installing a bunch of Python libraries, and on my Mac it turns out that's a way more complicated affair than it ought to be. Ponyrider at TESRenewal gave me a little tutorial, but I haven't taken the time to tackle it.

(Similarly, I've had no luck getting either Ordenador or DDSOpt to work properly in Wine. I like my Mac a lot, but it's...not ideal for gaming or modding!)

Share this post


Link to post
Share on other sites

I've had pretty good luck with Wine and Wineskin for a lot of my needs. It's not an emulator, so it's usually pretty fast. It does take some futzing to get it to work for a given game, though there are a few sites that offer ready-to-use wrappers for popular games.

Share this post


Link to post
Share on other sites

Well, the way Wine wrappers work is that they aren't universal like that; that is, if I made a wrapper with Python libraries, it would only work for apps installed in that wrapper. I could maybe make a Blender/PyFFI wrapper that way, but I can also do it natively, I think, so I'd just as soon do that even if it takes a few steps because it's more likely to work. I couldn't get Nifskope to work in Wine, for example.

By the way, am I right that I need Blender to use PyFFI, or is there some sort of standalone app?

Share this post


Link to post
Share on other sites

PyFFI is standalone. You don't need to know anything at all about modelling or texturing which is what makes it so handy for us modders that don't do that stuff.

Share this post


Link to post
Share on other sites

Where do you find this PyFFI standalone? I've found tools that use PyFFI like Niftoaster or the PyFFI Optimizer on Nexus, but I'm not sure if I've found any standalone.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×