# How To Composite Fog (which is rendered as VrayAtmosphere)

**URL:** <https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287>\
**Category:** Tutorials, Tips & Tricks\
**Created:** [February 24, 2011, 10:56am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287 "2011-02-24T10:56:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 24, 2011, 10:56am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/1 "2011-02-24T10:56:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 24, 2011, 11:00am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/2 "2011-02-24T11:00:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 24, 2011, 12:14pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/3 "2011-02-24T12:14:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dariusz\_Makowski\_Dadal](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@Dariusz\_Makowski\_Dadal](https://forums.chaos.com/u/Dariusz_Makowski_Dadal)\
**Post date:** [February 24, 2011, 12:21pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/4 "2011-02-24T12:21:19Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 24, 2011, 12:32pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/5 "2011-02-24T12:32:38Z")

</div>

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.

 ![BotjLights.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/d/0/d0cfa0ef3400c39d86d801b165a68580727e4f3f.jpeg)  
 ![LT2.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/1/f/1f7cd471eebda99ffe2a6edcef727eb679fd06fe.jpeg)  
 ![Composite.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/4/9/49bf6d34ed638f88c4af0fc49f169950a521b287.jpeg)  
 ![LT1.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/b/e/be73c2369450ea84054ea4b1d565438d6980af89.jpeg)  
 ![BotjLights_FogPass.jpg](https://europe1.discourse-cdn.com/chaosprd/original/3X/4/0/40f37efc11d499e928112d8802041606105098b8.jpeg)

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 25, 2011, 8:17am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/6 "2011-02-25T08:17:01Z")

</div>

Nobody?

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

---

<div class="post-metadata">

**Author:** ![Morne](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/morne/32/11335_2.png) [@Morne](https://forums.chaos.com/u/Morne)\
**Post date:** [February 25, 2011, 8:59am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/7 "2011-02-25T08:59:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 25, 2011, 9:15am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/8 "2011-02-25T09:15:25Z")

</div>

> [@simmsimaging](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 25, 2011, 10:49am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/9 "2011-02-25T10:49:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![trixian](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/trixian/32/60402_2.png) [@trixian](https://forums.chaos.com/u/trixian)\
**Post date:** [February 25, 2011, 11:17am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/10 "2011-02-25T11:17:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 25, 2011, 12:01pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/11 "2011-02-25T12:01:24Z")

</div>

It’s certainly not impossible…

Best regards,  
Vlado

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 25, 2011, 4:26pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/12 "2011-02-25T16:26:12Z")

</div>

> [@Metzger](#):
>
> 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

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

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 25, 2011, 4:27pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/13 "2011-02-25T16:27:48Z")

</div>

> [@pskdude](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 25, 2011, 4:31pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/14 "2011-02-25T16:31:50Z")

</div>

> [@rivoli](#):
>
> 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?

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

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [February 25, 2011, 4:39pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/15 "2011-02-25T16:39:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vlado](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vlado](https://forums.chaos.com/u/vlado)\
**Post date:** [February 25, 2011, 4:49pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/16 "2011-02-25T16:49:36Z")

</div>

> [@joconnell](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![CA\_Portugal](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/ca_portugal/32/64063_2.png) [@CA\_Portugal](https://forums.chaos.com/u/CA_Portugal)\
**Post date:** [February 28, 2011, 4:20pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/17 "2011-02-28T16:20:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pixela](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/pixela/32/2876_2.png) [@pixela](https://forums.chaos.com/u/pixela)\
**Post date:** [March 1, 2011, 6:06am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/18 "2011-03-01T06:06:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![simmsimaging](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/simmsimaging/32/49287_2.png) [@simmsimaging](https://forums.chaos.com/u/simmsimaging)\
**Post date:** [June 9, 2011, 3:47am UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/19 "2011-06-09T03:47:27Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![jonnyallenlwt](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/jonnyallenlwt/32/34943_2.png) [@jonnyallenlwt](https://forums.chaos.com/u/jonnyallenlwt)\
**Post date:** [September 30, 2011, 8:07pm UTC](https://forums.chaos.com/t/how-to-composite-fog-which-is-rendered-as-vrayatmosphere/27287/20 "2011-09-30T20:07:07Z")

</div>

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