Old_2013/tutorirls & Tips2008. 6. 30. 10:33

by zap's mental ray tips

I keep getting requests from people saying things like "I saw you at SigGraph showing of the mental ray sky and it had clouds in it. How did you do that?".



To which I twirl my moustache and say, 'tis a deep secret....

....just kidding.

Here's the thing. The mia_physicalsky shader uses a 'haze' value to derive a sky color based on the sun position/angle. So a 'hazier' sky is more white/yellowish and a less 'hazy' sky is deeper blue. Okay fine, weather control, you say, but that's not clouds, is it?

Well... actually... it is... if you modulate the haze value across the sky!

Observe this video that I made... it's basically a collection of all test animations done during the development of the sun&sky. Some are bad, some are worse, some are nice, some has bugs in them, some use very low anti aliasing, and none is a peice of art. However they do demonstrate the cloud feature...

What I did was use this texture map (which is a slightly modified version of one I found from some old CD-ROM with public domain sky textures) as a spherical environment map plugged into the haze parameter of mia_physicalsky. That's basically it!

In Maya or XSI you can do this directly, in Max you need to drag&drop your "mr Physical Sky" from your environment dialog into the material editor, uncheck the "Inherit from Sky" and apply the map there.

What is important - though - is this; This is a normal run-of-the-mill LDRI .jpg image, which means it causes a "variation" in the range 0.0-1.0 ... this is way too little for being visible as "clouds" in the sky (the haze has a range of 0 to 15)

So to see results, you need to multiply the level of the texture. How you do this differs between the applications (in Maya you can use the Gain, in Max you use the Output rollout and turn up the RGB Level, etc etc) but setting it somewhere between 5 and 10 tends to look nifty.

Note that this is not a "physically correct" effect in any way, notably because it doesn't actually scatter light, or block light, or create any shadows, or anything like that. But it does simulate "light" cloud coverage very nicely (like high altitude cirrus clouds), and the cool thing is that the clouds coloring automagically follows the sun angle, making very nice sunsets possible....

반응형
Posted by dhkim DongHwan, Kim

댓글을 달아 주세요