PDA

View Full Version : 3D Fog from Z-depth


Patryk44
08-21-2007, 01:38 AM
I want to use a 3D fog, and I know it only works with a files which can store a 3D channels such as rpf for example. Unfortunately, I'm saving a file from Vray frame buffer which doesn't allow me for storing this information in rpf. Is it possible to use seprate single pass (for example in jpg format) of the Z-depth and aplly 3D fog to it or something like that? I was trying do it but had no effects.
Thanks

Mylenium
08-21-2007, 06:13 AM
I want to use a 3D fog, and I know it only works with a files which can store a 3D channels such as rpf for example. Unfortunately, I'm saving a file from Vray frame buffer which doesn't allow me for storing this information in rpf. Is it possible to use seprate single pass (for example in jpg format) of the Z-depth and aplly 3D fog to it or something like that? I was trying do it but had no effects.
Thanks

Z-Buffer fog is nothing more than blending the objects with the background. Therefore you can use any greyscale image as a matte e.g. on a solid to create the illusion of fog which would be what you are after if I understand you right. so no need to worry. Just render out a plain image sequence. I wouldn't use JPEG, though, due to potential problems at the edges of objects. Use TIF, TGA or other uncompressed formats.

Mylenium

Patryk44
08-21-2007, 06:17 AM
Thanks Mylenium! So I will try to do this that way. If I get stuck I will post with some more questions ;). Thanks again!

yikesmikes
08-21-2007, 07:07 PM
I've never used 3D Fog, but it seems like you can do the same thing (since you don't have those "rpf "-thingies) with an Opacity expression on a Fog Layer. By Fog Layer I mean a Solid with Fractal Noise and Knoll UnMult (or other Fog Simulation with alpha), placed in AE's 3D space just in front of whatever layer you want to fog up. So the Fractal Noise layer sits .2 pixels in front of a Hill layer that you want to fog up.

Add this expression to the Fog/Mist layer's Opacity:

startFade = 1000;
endFade = 20;

minFog = 0;
maxFog = 100;

L = thisComp.layer("Camera 1");
d = length(L.position,position);
linear(d,startFade,endFade,minFog,maxFog)

When you get within 1000 pixels with fog will stat to fade from 100% to 0% at 20 pixels distance.
Change the startFade and endFade as needed.

If you want the lowest level of fog to be 20% opacity and the maximum to be 80%, change minFog to 20 and the maxFog to 80.

The only bad news is that the Fractal Noise Layer can't be the child of something, that code is beyond my paygrade.

Patryk44
08-23-2007, 05:29 PM
Thanks! I will give it a try.

CGTalk Moderation
08-23-2007, 05:29 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.