sRGB/RGB confusion + PBR + photoshop

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

sRGB/RGB confusion + PBR + photoshop

Post by al2950 »

Hi

I am not an artist, so apologies if this is a stupid question but I am confused about gamma correction in textures exported from PhotoShop using NVIDIA's DDS export tool. The question is simple;

Is the exported texture in linear space or has it had gamma correction!!? Furthermore is there a rule for all images formats, ie all images saved to a disk by a photoshop type tool are in gamma space?

Cheers

Gus
Last edited by al2950 on Thu Jan 08, 2015 5:00 pm, edited 1 time in total.
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: sRGB/RGB confusion + photoshop

Post by al2950 »

After a little while I have had to come back to what had previously confused me to the point of insanity. I have now resolved my confusion (I think!) and thought I would share my findings incase it helps others. This is nothing complicated and many reading this will probably just say "yeah, of course thats how it works", however I could not find a definite answer in my googling! If anyone reads this and finds something incorrect, please correct me!

Firstly if you are unaware of this very important but subtle issues regarding gamma spaces and rendering the following post is a good read;
http://filmicgames.com/archives/299
Understanding gamma issue becomes even more important when using a PBR rendering system, which Ogre 2.0 will do out of the box. Here are some useful posts for understanding PBR from an artists point of view
http://seblagarde.wordpress.com/2011/08 ... ting-mode/
http://www.chrisevans3d.com/pub_blog/mo ... d-shading/
http://www.marmoset.co/toolbag/learn/pbr-conversion

Many of the PBR guides will tell you to make sure you author various textures in sRGB space, and so make sure the colour space in Photoshop is set to sRGB. This is correct, but somehow I got into my head that that this would apply gamma correction as it saved, meaning the pixels values in the file would differ to one that was saved in linear space. THIS IS COMPLETELY WRONG. The colour profile in photoshop is just meta data, and the reason some guides tell you to set it is so the exporter/importer for an specific engine like unity or UE4 can read it and decide if its needs to convert it to linear space. At least that is my assumption.

So when authoring things like diffuse textures, you are automatically creating it in sRGB space anyway as you are creating it to look correct on your monitor which will generally make the assumption the input pixels are in sRGB. Furthermore if you are creating texture from real photos, they are already in sRGB as all cameras will convert the image to sRGB before it saves it so it will display correctly on (almost) all monitors.

Now the other bit of confusion for me was when authoring PBR textures, you would ideally use some sort of reference for things like metalness. What is important here is to make sure that reference is in sRGB space and not linear space, this reduces confusion and then only pure data textures, eg normal maps are treated as linear space. Where I got confused was when a guide says to use a metalness (or specular) of [255, 219, 145] for gold, what values do I put into photoshop, as I was not sure if those were values that should be stored in the file or entered into photoshop as I said before I somehow thought photoshop would convert the values when it saved to file. BUT IT DOES NOT

I hope this might help anyone in a similar position, and for everyone else you may laugh at my apparent stupidity :D

Oh and one last point, I would highly recommend when creating things like DDS textures to create your own converter. The NVIDIA photoshop plugin is great, but it is getting a little old and it created a layer of confusion for me as I was not exactly sure what it was doing.
Post Reply