View Full Version : Inverting a mid grey color in UDK Material Editor
kodde
12-15-2010, 05:43 AM
Hey guys,
I was trying to invert a channel of a normal map by shader code in UDK. So I used the OneMinus node in UDK and I was confused with the middle grey tones ending up being a different shade of grey after inverted. What am I doing wrong here?
I was expecting a mid grey color to have no change when being "inverted" (OneMinus, 1-x).
Pic:
http://img220.imageshack.us/img220/7697/udkinvertgrey.jpg
Ben Apuna
12-15-2010, 11:54 AM
Double click your texture in the Content Browser to bring up the Texture Properties window. Then scroll down and uncheck SRGB.
Hopefully that should fix it.
kodde
12-15-2010, 12:04 PM
Thank you Ben!
Now to read up on SRGB and what I just missed out on by unchecking it :)
kodde
12-15-2010, 12:08 PM
Was solved with applying a Power node with Exponent of 2.2 after loading the texture. Now this whole dilemma makes sense.
EDIT:
Sorry, in my case, add the Power after applying your OneMinus. :)
Ben Apuna
12-15-2010, 12:12 PM
Cool!
I'm pretty sure it has something to do with linear VS. non-linear interpretation of the colors - gamma correction.
http://udn.epicgames.com/Three/TextureProperties.html#SRGB
http://udn.epicgames.com/Three/GammaCorrection.html
kodde
12-15-2010, 12:27 PM
Yes it does.
I've done similar when creating shaders in Mental Mill.
You generally want your to convert your texture from gamma space to linear space since your other shader calculations are done in linear space. The at the end of all your shader calculations before sending along your shader result you want to convert back to gamma space.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.