Remember Me

Recent Uploads

Hot Downloads

Most Popular

Home Jeff's Blog Quick note on gamma issue (dark textures)
Quick note on gamma issue (dark textures) PDF Print E-mail
Written by Jeff Patton   
Sunday, 27 July 2008 08:00

I wanted to take a few minutes to explain the current gamma setup of the 3ds

Max matlab scenes, and what to do if your output doesn't look similar to the default render that comes with the scenes.
Current setup:
When you unpack the matlab scenes you'll find a simple document included that explains a bit about the various gamma options. The scenes are currently configured for option B, because I felt that it had the most benefits. This doesn't mean it's the best work flow or the one that you should immediately switch to. It's merely my opinion, nothing more, nothing less! Don't read into it any further than that.

In the gamma document included with the 3ds Max Matlab's, I've even gone the extra step to explain my thought process on this tough decision and the pro's and con's of each method that I weighed out to come to my conclusion. I did this so you could make an informed decision as to which gamma method works best for you.

Overly dark texture:
The most common issue that people will encounter is if you're using a gamma setting of 2.2 for your Bitmap input setting as illustrated in the following screen capture:

(click image to enlarge)


If you're using this particular setup then the matlab textures will render overly dark, like this:

(click image to enlarge)


How do you resolve this issue?
It's rather simple actually. Since I'm using a bitmap input gamma of 1.0 I locally control the gamma of my textures by wrapping them inside the gamma/gain utility shader, shown below:

(click image to enlarge)


If you're using an input gamma of anything higher than 1.0 then you'll need to adjust the scene a bit to get the correct results. The three areas you need to adjust are the floor grid material, the white sphere material, and the environment.

You'll want to load these three materials into the material editor and then either change the gamma setting on the gamma&gain utility shaders to 1.0, or you could remove the gamma&gain shader all together and just apply the maps as you normally would.

A word of caution: The .hdr we used in this scene has a baked in gamma curve (2.2). So while floating point images such as .hdr/.exr's would normally be loaded into 3ds Max in a linear format (gamma 1.0), you'll need to load this particular .hdr in at gamma 2.2. Although I personally prefer 1.8 for this particular .hdr.

If this doesn't help explain the gamma/texture issues let me know and I'll upload a short video to help clarify these issues.

Thanks for your support!

Blog entries may be discussed in the 3DA forums HERE
Trackback(0)
Comments (17)Add comments
Dan Cocker wrote on July 28, 2008
 
Title: ...
I had this issue, and as it was the first time with Mental Ray it did throw me a little. Thanks Jeff.
report abuse
vote down
vote up

Votes: -2
Scott wrote on July 28, 2008
 
Title: ...
I too was a little confused, totally because gamma stuff is new to me (if I rendered it and it looked good, so be it) But I read the included file and all is well now. For me, when opening the bitmap I change the gamma in the open dialog, but what I'd really like to know is how to save it out of PS so it comes in at 2.2 without touching anything.
report abuse
vote down
vote up

Votes: +0
Jeff Patton wrote on July 28, 2008
 
Title: ...
Scott, I'd say most of what you save out of Photoshop will be gamma 2.2 (sRGB) by default.

Therefore, in 3ds Max if you set the bitmap gamma input to 2.2 then you won't have to mess with the import options, until you need to import something linear (gamma 1.0), like bump maps, displacement maps, or floating point formats (.hdr/.exr).

Just be aware of the pro's & con's of this as I mentioned in the gamma document included with the matlabs.
report abuse
vote down
vote up

Votes: +0
Scott wrote on July 28, 2008
 
Title: ...
Thanks for your reply. I think I got confused because I set Max up for g2.2 for everything, then when I rendered my material in the matlab scene, the floor was very dark. So I set the Bitmap import to g1.0 and that fixed the floor, but then my material was too light. So when opening the bitmap I set it to 2.2 and all went well.. anyways I'm sure you can tell I'm still a little confused smilies/smiley.gif It's working none the less.
report abuse
vote down
vote up

Votes: +0
ex Cathedra wrote on July 29, 2008
 
Title: ...
Thank you Jeff.
report abuse
vote down
vote up

Votes: +0
Ata Ul Munim Sipra wrote on August 22, 2008
 
Title: ...
Thank you very much for your kind information. I seek a lot from this method and got excellent results. Thanks again.
report abuse
vote down
vote up

Votes: +0
Josh Purple wrote on August 23, 2008
 
Title: ...
Excellent info, Thank You for your time and help! I appreciate it! smilies/grin.gif
report abuse
vote down
vote up

Votes: +0
Godslove wrote on August 26, 2008
 
Title: ...
Wow all of this is good information to know, but I'm still a little confused on how the matlabs is affected, & I'm totally lost when your talking about importing something linear. I guess the video would help me to better understand because I am just getting into Gamma issues. Either way, I'm thankful for all that you do.
report abuse
vote down
vote up

Votes: +0
Godslove wrote on August 26, 2008
 
Title: ...
Ok, I was slightly confused in reading through this; however, after watching the video it is a lot clearer. However I'm left with one question that puzzles me, what is the ultimate purpose of the Gamma setting to start with? Is it due to the color variations of monitors or something else?
report abuse
vote down
vote up

Votes: +0
Jeff Patton wrote on August 26, 2008
 
Title: ...
Yes. Here's an excerpt about gamma from the 3ds Max help file: "Gamma correction compensates for the differences in color display on different output devices so that images look the same when viewed on different monitors.

A gamma value of 1 corresponds to an "ideal" monitor; that is, one that has a perfectly linear progression from white through gray to black.

However, the ideal display device doesn't exist. Computer monitors are "nonlinear" devices. The higher the gamma value is set, the greater the degree of nonlinearity. The standard gamma value for NTSC video is 2.2. For computer monitors, gamma values in the range of 1.5 to 2.0 are common."


There's more information in the help file that is worth the read.

Another place to watch for useful gamma information will be this site by my friend Zap:
http://www.lysator.liu.se/~zap/lwf/
report abuse
vote down
vote up

Votes: -1
johan belmans wrote on November 09, 2008
 
Title: ...
Hi all,

I am using the above description on gamma in my workflow. But it is a hassle to replace all my bitmaps with the gamma/gain utility shader. So I am looking for a script which will replace, in an old scene or material library, in the difuse and reflective slot the bitmap shader with the gamma/gain utility shader and copies in this last shader the previous bitmap shader.
Hope I make myself clear :-)

cheers

report abuse
vote down
vote up

Votes: +0
Ata Ul Munim Sipra wrote on February 04, 2009
 
Title: Reflectance value with gamma 2.2
I am confused in reflectance value and gamma value. I have read from mental ray white paper and there they mentioned the reflectance value is very important for material behavior in light. They also gave some sort of table for common materials. If we use it for wood at max 50% value. The texture in render is too dark. What should I do? Use only gamma or gamma with reflectance.
report abuse
vote down
vote up

Votes: +0
mentalboy wrote on February 10, 2009
 
Title: about utility gamma & gain
Hi Jeff.
I work with 1.8 values for bitmap input and output.
It only refers to bmp format? or jpg works too.
For example i try with arch&design Satin Varnished Wood first with 1.8-1.8 and without gamma gain shader, its look some dark. Then i try put in input value 1.0 and then add the gamma& gain and put 1.8 in gamma label and it works fine.
Its the right form to work with this shader
for all the arch&design materials that have a texture ????
Thanks.
report abuse
vote down
vote up
website
Votes: +0
Jeff Patton wrote on February 10, 2009
 
Title: ...
Ata Ul Munim Sipra: I would just make sure to load the texture map in at it's correct gamma setting (probably 2.2 if it's a color image that you plan on using as a diffuse texture map). Then tune the reflectivity accordingly. Or maybe I've misunderstood the question.

mentalboy: The bitmap reference = any texture map that can be loaded into 3ds Max (.hdr, .png, .jpg, .tga, etc.).

I don't know what your 3ds Max gamma settings are or what the gamma is of the texture map you're using (probably 2.2 if it's a diffuse/color texture map) but your gamma settings affect the settings you'd use on the gamma/gain utility shader.

I've included a PDF document with the material lab files that explains some common gamma configurations and that may help in getting your gamma settings configured.
report abuse
vote down
vote up

Votes: +0
Ata Ul Munim Sipra wrote on February 11, 2009
 
Title: Reflectance
Dear Jeff very firstly thanks for your reply. Actually I was asking about Reflectance and Transmittance values. I want to understand that how we can use reflectance value in a scene combined with gamma.
I adjusted the gamma input value = 1.0 and output value = 2.2 in max gamma LUT settings. And for deffuse map I would use gamma n gain utility for jpg = 2.2 and for png = 4.4 and also make sure the colors and saturation of the rendered texture and original by any image viewer. And all other maps without using gamma utility.
report abuse
vote down
vote up

Votes: +0
Jeff Patton wrote on February 11, 2009
 
Title: ...
Ok, it looks like the reflectance/transmittance values do not like the gamma/gain utility shader as they go to 0.0 when using it. Therefore if you wish to use the reflectance/transmittance values you won't be able to use the gamma/gain utility shader.

You'll have to assign your bitmaps directly to materials without the gamma/gain shader and then adjust the gamma from your global gamma settings.

Then if you have a map that needs to use a different gamma setting from your global values you can do so locally when you load the bitmap via the bitmap loader.

In other words, I don't know of a way you can use the gamma/gain utility shader AND maintain the functionality of the reflectance/transmittance information.
report abuse
vote down
vote up

Votes: +0
Ata Ul Munim Sipra wrote on February 12, 2009
 
Title: ...
Thanks very much.I think too that is the only way.
report abuse
vote down
vote up

Votes: +0

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy