Cloud Zbuffer

Started by vigilantes sidekick, November 01, 2011, 10:51:25 AM

Previous topic - Next topic

vigilantes sidekick

I'm looking for a way to render out a zbuffer / depth buffer pass for cloud data. I've tired various ways including distant shaders and I cant figure out a way to map it to a clouds color to get a pseudo depth pass like shown in the tutorials on www.nwdanet.com for terrain.

Anyone have any success with this in the past or tips?


-N

Matt

The way I usually do this is to render black clouds in a white haze, so that nearby clouds are black and become progressively lighter as they disappear into the haze. You won't get linear data this way, but if you only need the data for colour correction or manipulating haze in post then it works well.

I would set this up is like this:

1) Disable all lights so that clouds are rendered black and no render time is wasted calculating shadows. If you have any ambient light in your clouds layers, you'll need to reset that to black.

2) Change your planet atmosphere to one that has bluesky density at 0, haze density at 1 (or choose a more appropriate value). Set the haze horizon colour to pure white, as this will be the lightest colour in your depth map. On the atmosphere's 'Tweaks' tab, set the ambient colour to pure white. If you disabled all lights in step 1, then the pure white ambient colour should be the only thing to illuminate the pure white haze, giving you a pure white background in your image.

3) Make sure the camera's light exposure is set to 1.

4) If you are saving your depth map in an 8-bit format such as BMP or TIFF, then you might want to disable all of the checkboxes on the render node's 'Effects' tab, because some of them change the white point in the image. You're better off saving as EXR, however. The settings on the Effects tab have no effect on EXRs.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

vigilantes sidekick

Awesome, thank you very much. I will give this a try. In a perfect world I would like true linear data but will take what I can get.

-N