How To Composite Fog (which is rendered as VrayAtmosphere)

I have 2 lights and Environment Fog in a scene.
When rendering the scene, I also rendered this fog as VrayAtmosphere pass.
Then I made seperate passes for light1 and light2 (without fog active)

When I try to composite, I can’t get the same result as the main render:

Light 1 (NoFog)
+ (Linear Dodge)
Light 2 (NoFog)
+ (Linear Dodge)-also tried with other blending modes and none worked.
VrayAtomosphere

is not equal to the render when both lights and fog is on.
Where am I making the mistake?
How should I composite this?

The atmosphere should be added; linear dodge is not exactly the same as pure addition. Also do you have any color mapping in your images? Gamma correction?

Best regards,
Vlado

Color mapping is linear.
Gamma on Color Mapping Rollout is 2.2

The difference is so huge. I don’t think it will be sorted out with the difference between linear dodge and add.
Let me try to make a sample scene and I will send.

Humh

Far away form me experience but basic thinking tells me…

Render to png with alpha channel and just drop in ur PS ?

I guess u would have to render mask for ur object to subtract them from fog at the end tho…

Ok here are the passes:

Both lights and the fog:

VrayAtmosphere Pass

Light1 Pass

Light2 Pass

Composited Image

There is huge difference between the rendered image (first) and the composited image (last) one.





Nobody?

Is this a bug?
Or can these passes be composited just like the render?

Look at Peter Guthrie’s notes on how he comped the fog for his Farnsworth house.

I checked- if it is this what you mean, I couldn’t find andy detailed info but in one sentence he mentions that he SCREENED the fog pass over the render.
BUT as I already sent the passes above, the rendered image (with fog) is never equal to renderss(without fog)+fog(added as screen, linear dodge or anything)
Please look at the renders in my previous post and you will see the problem.

Hm, you would also need the transparency of the fog for proper compositing. Unfortunately this is not currently output as a separate render element - I’ll make a note to add it. For the time being, you can get this pass by rendering the scene a second time with the objects set as matte objects.

Best regards,
Vlado

As mentioned earlier, would it be possible to have a setting in the vray fog that removes it from the regular rgb output when the RE fog is added, and that the opacity\alpha of the fog is included in the fog pass automatically? this way one would not need to render the stuff out twice, and you would not have to reassemble the regular passes to get the scene without the fog on top.

It’s certainly not impossible…

Best regards,
Vlado

Sorry if I am asking silly question- pls bear with me, I just have so limited knowledge about compositing.
You mentioned to render the transparency with objects set as matte. Isn’t VrayAtmosphere Pass already this?
Thanks

Yes I agree with this. This way we will not have fog rendered both in RGB pass and the atmosphere pass twice.

Not exactly - it doesn’t include the transparency of the fog. If you render the objects as matte, you will be able to use the alpha channel of the resulting image.

Best regards,
Vlado

I am a little confused.

1. LightingPass + VrayAtmospherePass (masked with Alfa of Fog-Render-With-AllObjects-MAtte
2. LightingPass + (Fog-Render-With-AllObjects-Matte)

Are these equal to each other?
Then we don’t need to render a sepearate WvrayEnvironment Pass if we make a Fog-Render-With-AllObjects-Matte- am I right?

This is correct, yes.

Best regards,
Vlado

I had lots of issues with vray fog pass too.

Finally i decided to comp the vray fog in screen mode (just like Peter G. mentioned i guess), played with opacity and adjust it properly to my needs. The difference wasnt huge, but still i cant do this well if i dont uncheck affect background.

I think best way to render is making all object matte and then comping it. (as stated above)
I rendered as a VrayAtmosphere pass and had problems with it.

Is there still any chance of getting the built-in option to simply render the Atmosphere as an element only? It’s very cumbersome to tweak (IMO) compared to being able to quickly adjust it in post. Plus I *always* need to layer things up to adapt to client requests for changes so burying fog into the render is rarely workable for me, even if it looks great :slight_smile:

Do you have MAX compatible shadecontext on? (render settings > settings tab) I am not sure if that will fix the issue, but it might.