Gamma Correction for Physical Sun and Sky

German Town

Using the Phisical Sun and Sky is meant to give realistic results for rendering, but it also seems to wash out all the colours. This is apparently due to a gamma value of 2.2 that gets applied twice. I’ve tried to fix it using a few lazy approaches (such as in post production) but came to the conclusion that there is only one way that seems to work – the proper way, aka linear workflow.

To make the sun and sky, go to Render Options and choose Mental Ray as the renderer. In the Indirect Lighting tab, click the Create button next to Physical Sun and Sky. (Once you hit Create, the button text changes to Delete – which you can press if you want to get rid of the sun and sky.)

When you render your scene, the colours look washed out like this.

To fix this, you need to add a Gamma Correction to every texture you use in the scene. To do so, you need to do the steps below to all material nodes in the Hypershade.

Right click on a material node and select Graph Network.
Delete the link between the texture file and the very last material node.
Find the Gamma Correct node in the left hand list labeled Create Maya Nodes under Color Utilities and middle mouse drag it to the Workspace.
Middle mouse drag the texture file node onto the Gamma Correct node and select value.
Middle mouse drag the Gamma Correct node onto the last material node and select color.

Click on the Gamma Correct node and in the Channel Box, change the three Gamma values to 0.454 (the inverse of 2.2).

You need to add a Gamma Correct node to every texture you have in the scene. There are mel scripts out there that automate most of this task for you.

Once you’ve added the gamma correction to all textures, the render with Physical Sun and Sky (in its default state) looks like this.


8 Comments Add yours

  1. Anonymous says:

    how do you gamma coprrect a basic lambert with no texture applied?

  2. Anonymous says:

    no need to correct basic lambert. already linear

  3. noushadahamed says:

    nice one very use fulll ,,,,,,,,,,,,,,,,,,,,,,,,thanks man

  4. Anonymous says:

    HI, Thanks for this tutorial. I am having issues with applying the gamma correct between a file texure and mr car paint shader. Any ideas?

  5. you can check my blog, it is related. It was nice if you had any information on the way Gammas are computed and then posted it. thanks

  6. Anonymous says:

    what about the gamma correction on the mia exposure node that gets connected to the camera when creating physical sun and sky?it`s 2.2 by default so if you change it to 1 it will do the trick.if you want to debug your linear workflow put in the scene a black a white and a fully saturated red material(or anything you like)and check if the swatches an textures have tha same colours.mia exposure is also the reason for color dodging if you try to bake textures in a scene with physical sun.just delete the mia exposure(it`s a post process on the camera lens)and tune the render without it and then bake.

  7. Anonymous says:,topicNumber=d30e623483 manual refers to what i am saying above and also swatches are not need to apply gamma correction

  8. Save Tiger says:

    where is the mel script for automating this process??? having many textures in a scene.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s