PDA

View Full Version : A simple way to good results with physical sky.


davegreenwood
05-22-2008, 06:43 PM
I have read a lot on this forum about gamma issues using the physical sky, and while the threads about it are very informative, the solution offered is usually to de-gamma your file textures.
I've got another method, I don't think I've seen anybody talk about... here is a render from my set up:
results (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203261320665761010)

In simple terms , all your shaders in Maya are set up as 2.2 gamma, except for the physical sky, which is 1.0. So what you can do is add a gamma node to the sky and make it the same as everything else.
sky gamma (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203261324960728354)

Then you have to go into the mia_exposure and set it up as a straight path through...
mia_exposure (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203262317098173778)

your render will be very bright with the exposure gain at 1.0. Compensate in the sky AE and set the multiplier to somewhere around 0.1, but you will tweek this according to the angle of the sun you have set, as its more or less bright depending on "time of day".
sky multiplier (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203261324960728370)

I've put up the little file textures I use here:
file1 (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203261320665761042) file2 (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203261320665761026)

So you can set up your own scene. If you have a surface shader you can check your starting colour is the same as your render colour, by using the dropper in Photoshop. you can then use the same file texture in the colour slot of a regular shader, and tweek your sky multiplier until the values read the same...
This is not an ideal method, making everything Gamma1.0 is a better way, but the advantages are its simple, your swatches will make sense, and there are no third party shaders required.
Anyway hope it helps someone.
Dave.

ghostlake114
05-22-2008, 07:24 PM
Sorry but doesnt your method bring gamma correct in lense shader = 1 and let the gamma of texture alone.

If you do that because of just want to preserve the color swatch, I see you are doing sth nonsense by let the mia_simple at a value affect nothing to scene. So why not you remove it :shrug:, It play no role in scene as I see.

The gain, or like mia_photo shader is some kind of physical camera. If in physical sky shader, we must have just kind of tonemap/filter light before it go to light because the sun and sky is very bright. And with a very bright light source, it make sense if we make fstop and shutter change, it affect much to the final output.

The advantage of linear space (Gamma 2.2) has been discuss too much. It really make your final mood of your render smoother. And you do nothing but return to the normal way with gamma = 1, and use a lower value of physical sun to make it less bright.So, sorry, I see your network is much complex,more tweak but solve nothing

davegreenwood
05-22-2008, 10:11 PM
Absolutely, this is not the best way to go about it, but it is one way to tie all the values together, and achieve predictable results. You gain visual continuity with file textures, procedural textures and colour swatches with a quick set up. I left the mia_exposure in the network so tonemapping is still available (ie. compression >0) you can also mix in surface shaders with your scene, and if you need to do that you cant use tone mapping anyway (not if you want in value to equal out value). It is a quick cheap trick... but in the end its better to de-gamma all your shaders so all the render values are derived in linear space. This would also be true of every maya scene, not just those with physical sky.
Dave

davegreenwood
05-23-2008, 06:30 PM
Here are some comparison renders:

as in my first post:
link (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203629691420804466)

then remove the gamma node on the physical_sky, with the file textures gamma corrected, with mia_exposure gamma 2.2:
linear1 (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203629691420804482)

then with some further gamma correction on the reflection atributes:
linear2 (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203629695715771794)

and finally the gain correction is swapped back into the mia_exposure, and the physical_sky has its multiplier set to 1.0:
gain (http://picasaweb.google.com/dgrnwd/Cgtalk/photo#5203629695715771810)
its interesting to note that this makes no difference to the physical_sky.

to compare the results of the first image, with the linear workflow images, there is clearly a difference in highlight rendition. I don't know but I put this down to the 2+2 =10 factor in the first image. It could also be the rounding off difference when de-gamma-ing various nodes. When trying to linearise the shading network, it's necessary to compensate every contributing attribute of every shader... quite a task. In this example the reflections don't end up the same, and it's not clear why. All said though, what differences there are between the first and last example are quite small, and either one could be made to look like the other with a little tweak. I've left compression at zero all through these examples, but it's equally useful in both set-ups.
Anyway hope it helps someone.
Dave.

CGTalk Moderation
05-23-2008, 06:30 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.