Jump to content

Recommended Posts

Posted

Is there detailed documentation regarding what types of texture will be borked if in sRGB format.  I ran DDS texture informer on my skyrim SE mod list and noticed a few random textures being in sRGB format.  a lot of these were gradients and cubemaps... some normal textures, and rarely the diffuse.

Should these all be converted to Linear or does it not always matter?

Posted

I haven't found any comprehensive source for this with respect to Skyrim, but I did find a very informative source on color management. There's a lot of specialized info there that I don't fully understand. There's some great GIMP info as well, but my GIMP skills are very limited. Ps is easier for me. I also compiled Elle's profiles using the latest code and Little CMS 2.16 (see profile descriptions). From my limited understanding, one of the CIERGB|Rec2020|sRGB V2 g10 profiles might be good choices in your workflows

Chat GPT has a considerable answer:

Do textures in skyrim need to be linear?

Spoiler

No, textures in Skyrim do not need to be linear—they can be sRGB (gamma-corrected) or linear, depending on their intended use. Here's what you need to know:

1. Diffuse/Albedo Textures (Color Maps)

These should be in sRGB color space. sRGB accounts for how human eyes perceive brightness and ensures that the game displays colors correctly. Skyrim’s rendering engine assumes that color textures are gamma-corrected.

  • File types: Usually .dds (DirectDraw Surface)
  • Texture types: diffuse, albedo, color, etc.
  • Use sRGB (non-linear) format.

2. Normal Maps, Specular Maps, Roughness, Metalness, etc.

These should be in linear space. They represent data, not color, and must be interpreted numerically by the engine.

  • Normal maps: Linear
  • Specular/metal/roughness maps: Linear
  • Use non-sRGB formats when saving/exporting these.

3. Game Engine Behavior (Skyrim/Creation Engine)

Skyrim uses DirectX 9 (original) and DirectX 11 (for Special Edition). In both, the shader expects:

  • sRGB textures for color maps
  • Linear for data maps

If you incorrectly save a data texture in sRGB, it will get gamma correction applied, leading to lighting errors or incorrect surface appearance.


TL;DR

Texture Type

Color Space

Why?

Diffuse/Albedo

sRGB

Matches human vision

Normal Maps

Linear

Vector data

Specular/Roughness

Linear

Numeric/physical data

 

... and here's the answer for complex grass textures, which are a bit of a 'gotcha':

Complex grass textures consist of both diffuse and normal on an atlas, so both can only be saved in sRGB or linear color space. Which should it be?

Spoiler

Great question—and you're absolutely right to point this out.

If the complex grass texture atlas contains both diffuse and normal map data in one texture, then:

You must save it in linear color space.


💡 Why?

  • The normal map data must remain linear. If you save the texture as sRGB, the normal data will be gamma-corrected, which will break lighting calculations and cause visual artifacts (like incorrect shading or flattened normals).
  • While the diffuse/color portion ideally wants sRGB, it is less damaging to store that in linear space than it is to incorrectly gamma-correct normals.

🎯 Best Practice:

If you must pack both diffuse and normals into a single atlas, prioritize linear color space.

  • Save as linear (non-sRGB) to preserve the accuracy of the normal data.
  • Accept the trade-off that the diffuse portion may look slightly off, but this can often be adjusted via shaders, tinting, or ENB post-processing.

🛠 Alternative (if possible):

If your engine/mod setup allows, separate the diffuse and normal maps into two textures:

  • Diffuse → saved as sRGB
  • Normal → saved as linear

But in Skyrim, where texture slots can be limited (especially for grass meshes), this isn’t always viable.


Final Answer:

Save your combined complex grass atlas (diffuse + normal) in linear color space.

 

...and how to save the texture properly:

How do I save a texture in linear color space?

Spoiler

To save a texture in linear color space, you need to disable sRGB/gamma correction when exporting. The exact steps depend on the tool you're using, but here are instructions for the most common workflows when exporting for Skyrim (usually to .DDS format):


🎨 If you're using Photoshop + NVIDIA Texture Tools Exporter:

  1. Open your texture in Photoshop.

  2. Go to File > Save As or Export As.

  3. Choose NVIDIA DDS (.dds).

  4. In the export window:

    • Choose the appropriate compression (e.g. BC5 for normal maps, BC1 or BC3 for color).

    • Uncheck any option labeled "sRGB", "Gamma-corrected", or similar.

    • This ensures it exports in linear color space.

  5. Save.


🧰 If you're using Intel Texture Works DDS Plugin (Photoshop):

  1. File > Save As > DDS (Intel Texture Works).

  2. In the export dialog:

    • Choose your compression format.

    • Set "sRGB" to OFF (it's a checkbox or dropdown).

  3. Save — it will now export in linear space.


🪟 If you're using GIMP + DDS Plugin:

  1. File > Export As > DDS.

  2. In the DDS export dialog:

    • Choose compression format.

    • GIMP usually exports in linear by default unless you're applying a color profile.

    • To be safe, make sure to not assign an sRGB profile to the image before export.


💻 If you're using command-line tools like texconv (Microsoft DirectX Tool):

Use the -nosrgb flag:

texconv -f BC5_UNORM -nosrgb your_texture.png

This will convert the image to DDS with no sRGB flag, meaning it is saved in linear space.


How to Verify

  • Open the saved .DDS file in a viewer like NVIDIA Texture Tools Preview or RenderDoc.

  • Check whether the sRGB flag is set in the metadata.

  • Tools like texdiag (from DirectX SDK) or Compressonator can also inspect the texture format.

 

...and what if it's a CG texture?

How do I save a complex grass texture in linear color space, given it has both a diffuse and normal together on an atlas?

Spoiler

To save a complex grass texture atlas (that contains both diffuse and normal maps in one file) in linear color space, you need to:

Export the texture as a DDS file with sRGB disabled

This preserves the numerical accuracy of the normal data, which is more sensitive to gamma correction than the diffuse.

Here’s how to do it depending on the tool you’re using:


🖼️ 1. Using NVIDIA Texture Tools Exporter (Photoshop or standalone)

  1. Open your combined texture atlas.

  2. Go to File > Save As > choose DDS (.dds).

  3. In the NVIDIA export window:

    • Set compression format:

      • Use BC3 if you need an alpha channel.

      • Use BC1 if no alpha and you're saving space.

      • Use BC5 if your normals are packed in R/G and you’re not storing diffuse RGB.

    • Uncheck “Use sRGB format” or “Gamma correction”.

    • This ensures linear output, preserving normal accuracy.

  4. Save the file.


🧊 2. Using Intel Texture Works DDS Plugin (Photoshop)

  1. Save As > DDS (Intel Texture Works).

  2. In the export dialog:

    • Choose compression (BC3 for RGB+A, BC5 for normals).

    • Make sure “sRGB” is disabled.

    • If there's an explicit gamma toggle, set it to linear or uncheck gamma correction.

  3. Save.


🔧 3. Using texconv (Command Line Tool by Microsoft)

Convert from PNG or TGA using this syntax:

texconv -f BC3_UNORM -nosrgb complex_grass_atlas.png
  • -nosrgb disables the sRGB flag → texture is saved in linear space.

  • Replace BC3_UNORM with BC5_UNORM if your normal map is packed in red/green only.


🎨 4. Using GIMP with DDS Plugin

  1. File > Export As > DDS.

  2. In the export dialog:

    • Choose BC3 compression (for RGBA).

    • Do not assign a color profile.

    • GIMP will save in linear by default unless you explicitly embed sRGB.


🔍 Verification (Optional but Recommended)

After saving:

  • Open in RenderDoc or NVIDIA Texture Tools Preview.

  • Ensure the texture is flagged as linear (no sRGB).

  • The RGB values should appear as raw/unmodified.


⚠️ Why Linear?

Since normal maps rely on accurate vector math, applying gamma correction (via sRGB) distorts lighting and reflections. It’s better to have the diffuse look slightly off than ruin the normal data.


Summary

Always save your complex grass atlas in linear space (sRGB off), to protect the normal data, even if it also contains diffuse color.

 

 

  • z929669 changed the title to DDS: sRGB BC7 (non-linear) or Linear Color Space?

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.