PDA

View Full Version : Physical Sky and .... moon ?


myself44
08-18-2007, 04:04 PM
Hi
I always use manual spotlight GI+FG,etc to light my interiors but now I decided to test the Physical Sun/Sky. Well I'd say it's pretty good; nice sunlight although the interior is always dark even if the multiplier is very high..
anyway... the real problem is how do I get sunrise, sunset and night physical sky ? I mean maybe a 'physical moon' ? :P :)

Here are the only nodes and parameters I have... I really don't see how to acheive a evening/night time ...

http://i14.photobucket.com/albums/a350/myself-44/sky.jpg

Thx

myself44
08-19-2007, 03:24 PM
hm nothing ? Is the answer too obvious :P ?

Emil3d
08-19-2007, 07:37 PM
Hi
I always use manual spotlight GI+FG,etc to light my interiors but now I decided to test the Physical Sun/Sky. Well I'd say it's pretty good; nice sunlight although the interior is always dark even if the multiplier is very high..... The secret is tone mapping and color correction.
Without it you canít see what you are doing. This process happens after rendering and can be done either in post processing program or in Maya with a lens shader that is in effect a post processing stage that happens automatically after rendering. The trick is to render to a high dynamic range image like openEXR file with Framebuffer x32 bit. The image will have all necessary light but you wonít be able to see without a tone mapping.


The image below is rendered using the test classroom scene that people use to practice their skills.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_01.jpg

I added physical sun & sky environment and assigned mia_materials with different colors and parameters to the different objects. I didnít put any lights and textures in the scene to make it easier to examine the effect of the environment lighting.
Without tone mapping this is what you see when you open the rendered x32 bit file in Photoshop and when you render using Render view in Maya. That is the typical result ending the stage where you applied your excellent modeling, texturing, shading, lighting, and rendering skills. Unfortunately no matter how excellently youíve done you job the result is typically good for nothing as you can see from this sample yourself (no pun intended:)).

Welcome to the world of tone mapping. Whatís the purpose of the tone mapping and why do we have to go through that? Think of it as this analogy: imagine two painters who are required to create a picture with letís say 256 beautiful colors. One of the artists has a palette of just 256 colors while the other has a palette with millions of colors. It is obvious that the guy with the millions of colors has a greater choice and chance to create a better picture with 256 colors than the guy who has just that much.
The purpose of rendering to x 32 bit colors is very similar to this. First it gives you a very high range of colors so that you have much more options when you need to create an image limited to the display capabilities of the monitor - which is x8 bit (256 colors per channel) and this is what the tone mapping is all about.

Tone mapping is not a major objective in the 3D programs including Maya. It is a 2D process and is typically done in advanced 2D programs. Iím using Photoshop simply because thatís what I know best but there are other and specialized programs specifically designed for that.
Anyway for this example letís proceed with the image in Photoshop. What I do next is check what range of colors I have. In the image below I used the Set White Point Eyedropper from the Exposure dialog box to check how far I can go towards the brightness by clicking on what I want to be the brightest spot.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_02.jpg

Then I do the same but with the Set Gray Point Eyedropper to change the tones to what I want to be the middle tones. As you can see now the image actually contains a lot of light in it because of its high dynamic range even though initially it dindít appear so.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_03.jpg

Now after I know what limits I have to my disposal I can use all tone mapping and color correction tools that Iím familiar with to make this HDR image look good within the limit of the colors displayed on my monitor. I usually restrict myself to global editing that can allow easy batch editing of sequences but in this case I went more to partial layer editing by first saving different dynamic ranges similar to the clipping trick used in photography where you take several pictures at different exposures and then blend the best parts of them in one image in Photoshop. And this is what I got as you can see the end image is pretty well lit and in fact has nothing to do with what the renderer produces without tone mapping.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_04.jpg

Instead of using external programs like Photoshop for tone mapping, you can set Maya to do that by using a lens shader like mia_exposure_simple. And when you combine this with color utilities like HSV remap and contrast as Floze reminded me at the end of this thread (http://forums.cgsociety.org/showthread.php?f=87&t=522786&page=2&pp=15) you can have a very good tone mapping plus color correction solution that in my experience gives very good results. Although may be due to my limited experience with it Iím still not completely able to have the control and expected results as with my Photoshop skills, but I came with very close results that are perfect for previewing purposes.


I hope this helps.

myself44
08-19-2007, 09:12 PM
OMG Emil3d... what can I say ? Thx very much !! :):) I learned alot and your detailed post helped me alot. But Im curious about the fact that the first image in your post(the one before post-processing, right ?) was acheived ONLY with Phys.sun.sky ?
I mean I have to normally add more lights then tweak their positions and photon emition, etc. When I only use the direct.light that phys.sun gives me, the interior is very, very dark... so I don't how ppl have very 'normal' bright interior result by only enabling MR phys.sky.

And if it's not asking too much, can you explain me the other prob I have; regarding the different day time (sunrise, sunset, night, etc.) I can't seem to acheive with MR Phys.env system... ?
Meanwhile I'll try to find some help on the web, but none seems to have the answer. I know FinalRender, you can choose the month/day/year/hour.. but is there a similar way in MR ?

thx again for taking your time to do a post like that :)

Emil3d
08-19-2007, 10:24 PM
Hey mayself44, no there are no lights in the scene. It is just the physical sun & sky with its default settings. I only increased the FG interpolation to 50 in the render settings to smooth out FG artifacts. The physical sun & sky uses a directional light as a control to define the direction and angle of the sunís rays and thatís how you can control the time of the day/night. I simply rotated it to get direct sunlight coming through the windows and have no idea what time of the day that would be. Iím sure someone interested can find that easily by googling a bit but I didnít care about that. Sun light will get lower with making its direction more horizontal and if it pointing up that would be after sunset. You can use Night color attribute to define the brightness of the sky after sunset and that can be used for a night scene where you can put a weak directional light for a moon.

myself44
08-20-2007, 12:18 AM
Oh I see, the direct.light is acting like a sort of 'Star' that mimics the sun and moon movements through the day ?. Im gonna give this a try. Actually working on an interior set and having trouble with PhysSky, seems that whatever the Sun is Photons Enabled or not, there is no difference.

Btw, I spent some time reading a thread; which I guess talks a bout a kind of plugin we can downlaod but can't find it; about the PhyEnv.
Here look at his PhySun/Sky parameters (alot of additional controls ) : http://img174.imageshack.us/my.php?image=iblhorizontproblem001hx4.jpg

And with that , it's possible to acheive this result without guessing and 'trial-error' method (link > 4th post) : http://forums.cgsociety.org/showthread.php?f=87&t=422814&page=4&pp=15

EDIT :
Here the test render I did with my interior scene. Only enabled Phys.Sun/Sky in the render globals and rotated a bit the direct.light. That's the thing I cannot understand, the interior is sooo dark (always like that), although your classroom lighting looks incredibly balanced.
Maybe you could upload the classroom scene, so I could run a render of that to see if it's problem related to my computer...
http://i14.photobucket.com/albums/a350/myself-44/openRoom2.jpg

Thx again

Emil3d
08-20-2007, 12:34 PM
You can make it look much better just with color correction as you can see from the image below. I tried this with the 8 bit jpg file by grabbing it from the image in your message and color corrected it in Photoshop without any tone mapping. If it was a 32 bit file, the conversion to 8 bit would give you the possibility to tone map it yourself which should make it even better and without the artifacts associated with the jpg image here.


http://img2.putfile.com/main/8/23108272759.jpg

myself44
08-20-2007, 01:26 PM
Ok thx, If I understood well, post-processing is kind of essential for interior scene if I want a nice and clean result presentation.
Just a last little question. You said to save render image file as OpenEXR format with 32 bit... I never heard of that kind of format, but is there a 32 bit format as jpeg or tif or targa,etc ?
I guess I'll have to read more about HDR because I never really cared about that and now it seems more and more important..

thx

royter
08-20-2007, 11:51 PM
The secret is tone mapping and color correction.
Without it you canít see what you are doing. This process happens after rendering and can be done either in post processing program or in Maya with a lens shader that is in effect a post processing stage that happens automatically after rendering. The trick is to render to a high dynamic range image like openEXR file with Framebuffer x32 bit. The image will have all necessary light but you wonít be able to see without a tone mapping.


The image below is rendered using the test classroom scene that people use to practice their skills.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_01.jpg

I added physical sun & sky environment and assigned mia_materials with different colors and parameters to the different objects. I didnít put any lights and textures in the scene to make it easier to examine the effect of the environment lighting.
Without tone mapping this is what you see when you open the rendered x32 bit file in Photoshop and when you render using Render view in Maya. That is the typical result ending the stage where you applied your excellent modeling, texturing, shading, lighting, and rendering skills. Unfortunately no matter how excellently youíve done you job the result is typically good for nothing as you can see from this sample yourself (no pun intended:)).

Welcome to the world of tone mapping. Whatís the purpose of the tone mapping and why do we have to go through that? Think of it as this analogy: imagine two painters who are required to create a picture with letís say 256 beautiful colors. One of the artists has a palette of just 256 colors while the other has a palette with millions of colors. It is obvious that the guy with the millions of colors has a greater choice and chance to create a better picture with 256 colors than the guy who has just that much.
The purpose of rendering to x 32 bit colors is very similar to this. First it gives you a very high range of colors so that you have much more options when you need to create an image limited to the display capabilities of the monitor - which is x8 bit (256 colors per channel) and this is what the tone mapping is all about.

Tone mapping is not a major objective in the 3D programs including Maya. It is a 2D process and is typically done in advanced 2D programs. Iím using Photoshop simply because thatís what I know best but there are other and specialized programs specifically designed for that.
Anyway for this example letís proceed with the image in Photoshop. What I do next is check what range of colors I have. In the image below I used the Set White Point Eyedropper from the Exposure dialog box to check how far I can go towards the brightness by clicking on what I want to be the brightest spot.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_02.jpg

Then I do the same but with the Set Gray Point Eyedropper to change the tones to what I want to be the middle tones. As you can see now the image actually contains a lot of light in it because of its high dynamic range even though initially it dindít appear so.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_03.jpg

Now after I know what limits I have to my disposal I can use all tone mapping and color correction tools that Iím familiar with to make this HDR image look good within the limit of the colors displayed on my monitor. I usually restrict myself to global editing that can allow easy batch editing of sequences but in this case I went more to partial layer editing by first saving different dynamic ranges similar to the clipping trick used in photography where you take several pictures at different exposures and then blend the best parts of them in one image in Photoshop. And this is what I got as you can see the end image is pretty well lit and in fact has nothing to do with what the renderer produces without tone mapping.

http://i111.photobucket.com/albums/n129/Emil3d/tonemaping_04.jpg

Instead of using external programs like Photoshop for tone mapping, you can set Maya to do that by using a lens shader like mia_exposure_simple. And when you combine this with color utilities like HSV remap and contrast as Floze reminded me at the end of this thread (http://forums.cgsociety.org/showthread.php?f=87&t=522786&page=2&pp=15) you can have a very good tone mapping plus color correction solution that in my experience gives very good results. Although may be due to my limited experience with it Iím still not completely able to have the control and expected results as with my Photoshop skills, but I came with very close results that are perfect for previewing purposes.


I hope this helps.


i am not new to the PS tonemaping technique but i really like how you put it all together.
things starts to be more logic and clear.

basicly what you are doing in PS, is lowering the exposure of the highlights and increasing the exposure of the midtones and combine the 2 images together.
-what's the difference of using Set White Point Eyedropper and the Set Gray Point Eyedropper? what does each eyedoper selects?

when you talk about color correction as a tonemaping technique, you mean selecting a color range and tuning it's hue, saturation and specially it's lightness, right?

the HSV remap and contrast nodes are meant to do directly within Maya what you have done in PS.
-But how do use them? how do you achieve with these nodes what you did in PS?

Emil3d
08-21-2007, 03:53 AM
Hey Royterr, Iím busier than usual this evening because I got Artizen today and Iíve been playing with it for several hours already and I canít stop it:bounce:.
I canít believe I havenít got it long time ago Ė it is a steal for about cdn$ 60 and an amazing program thatís not only very capable but also easy and fun to use. It can handle HDR images from tone mapping to color correction without any destruction keeping them at 32 bit all the time. At the moment Iím very excited about Artizan and not tuned to talk about Photoshop right now but I will answer your question step by step sometime tomorrow.

MrHoo
08-22-2007, 02:13 AM
@Emil3D

quite nice your explanation! Got a new view about all this.

But would it be possible that you share the "classroom scene" in a maya format, because the only one I could find in the web is the one from evermotion - but only in 3ds format, which comes with strange results in my Maya 8.5 if i import it.
And I unfortunately do not own a license of 3DsMax to convert it :cry:

I would appreciate much ifyou could do this.

Thank you in advance

Dominik

Emil3d
08-22-2007, 02:52 AM
@ royterr, as I promised hereís the details:).
First I render to x32bit file without mia_exposure_simple or any tone mapping/color correction nodes.

When using Photoshop, usually I use the exposure and gamma controls from the exposure dialog window. Then convert to 16 bit channels, and use Curves and/or Levels to get the desired balance. Sometimes I also add/remove saturation usually after contrast changes which affect saturation. Although for this I like the Selective Color control more.

However in this particular example I did something different which is what I usually do when manipulating photos taken with my digital camera using a feature called bracketing. It is useful for taking picture like those in a room with a window in a sunny day. I put my camera on a tripod facing the window and the camera takes automatically 3 pictures with different exposures; first with details in the room but everything outside the window is bleached white, second some details inside and outside the window but still under and over exposed at the extremes, and the third is opposite of the first. Then I take these 3 pictures in Photoshop and merge them together to make a balanced image.

With this rendering I did something similar by breaking it into 4 images as layers with different exposures. In my previous message I showed only the first and the last layers used for the darkest and lightest areas. It doesnít really matter if you set the exposure with the eyedropper or just by dragging the slider. At the end its all eyeballing although I always use the eyedropper for the brightest point while for the darks and the in betweens I simply drag the exposure slider.

After converting to 16 bit and breaking the image into layers with different exposures, I display only the first two layers, and apply Color Range to the layer above to select only the good areas in it. To do this I first click with the eyedropper in the brightest spot and then drag the Fuzziness slider until the preview shows a selection that covers only the good areas. Then in the layers palette I click the make mask button to remove the rest and reveal the previous layer. Then I display the third layer and repeat the same for it and the rest. Once the masks are set I can click on the image (not the mask) and apply Levels to adjust it additionally and blend it better with the other layers.
This is a screen grab of the layer palette and the Set Range command being applied.

http://i111.photobucket.com/albums/n129/Emil3d/PhotoshopCC.jpg



When using Maya to tonemap, in mia_exposure_simple I enable the preview and choose the rendered file. Drop the mia_exposure_simple node on the color attribute in the remapHSV tab, then drop the remapHSV node on the value of the contrast tab, and finally drop the contrast node on the lens shader slot of the camera. These are the settings for this particular scene.

http://i111.photobucket.com/albums/n129/Emil3d/Settings.jpg


And this is the result displayed when rendered directly in Maya by Render View. Very far from what I wish it should be but it's ok for a preview. I think of a Render View now as a middle man between the vewport preview and the final real result:)

http://i111.photobucket.com/albums/n129/Emil3d/class_room_RenderView.jpg


@ myself44 openEXR is listed in the general tab the Render Settings and is a file format that supports x32 bit set in the Framebuffer section of the MR tab.

@ MrHoo I got the scene from the same place in Max format too but I opened it fine in 8.5. I donít mind sharing the Maya file but its about 12 MB, if someone tell me where and how to upload it Iíll do.

royter
08-22-2007, 03:19 AM
Emil3d thanks for taking the time to explain and illustrate your 2 workflows.

i can see the advantage of your first method, i really like the level of control to achieve a balanced image. I can really see how this method can be applied to achieve elegant resulst for fix images since it can not be batched in PS.

what i really like is the second method,is the fact that you can batch render and tonemap on the spot.i am going to try it and come with some feedback.

thanks agian for the details

cheers

MrHoo
08-22-2007, 12:16 PM
Hey

also thx for the explanation of your workflow.
You could upload the file at rapidshare.com.

Greets Dominik

Emil3d
08-27-2007, 11:11 PM
Hey MrHoo, sorry I didn't reply sooner, I'm away from my place and will be back in a couple of days. I'll try rapidshare.com and upload my Maya file then. The original file has bad and missing UVs that I have fixed and I will also share it with the materials and tone mapping applied. I also intend to use this as an opportunity to open a new thread dedicated to testing and studying primarily tone mapping and other aspects of rendering like lighting and material performance. Ideally it could be a thread with interested MR users who don't mind sharing the file back after improving it.

Keep an eye on this forum:).

slipknot66
08-27-2007, 11:43 PM
Nice test renderings Emil3d, in my opinion the only thing missing there are the contact shadows, thats why i always use area lights in front of each window, that is almost what the new sky portal do with the new mental ray 3.6 in Maya 2008 and Max 2008.

Emil3d
08-28-2007, 12:39 AM
Thank slipknot66, I realized that this is a major thing that is missing in this scene but I wanted to see what can be done just with sun and sky environment without any additional lighting. Increasing the point density of the Final Gather improves slightly in that direction but is nothing close to what it should be. If the ambient occlusion of the mia_material had a direction attribute like the Francescaís shader it would have been a help. But of course the best as you suggested is introducing a true light in the indirect light areas which as in real life always have a very diffused directional light presence.

Canít wait to see these new features in Maya.

MrHoo
08-28-2007, 12:47 PM
@Emil3D

Great to hear about that!!
I am looking forward to this thread and i will try to step in.

Thanks and cu

elvis75k
09-13-2007, 09:41 AM
yeah.. How do you set up a Mia_portal_light ? I get an error when rendering (also if the arealight is not visible i get a message that the portal doesn't work if the flag visible is off).
Anybody know what this means:

error: Shader 'mia_portal_light': Light direction must be 0 0 z


And what's mean "x/y light space" (from the docs)

cheers.

cpan
09-13-2007, 02:03 PM
i noticed that error too... but the portal light works apparently.

CGTalk Moderation
09-13-2007, 02:03 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.