Jump to content

Shadows in Volume Fog


photo

Recommended Posts

Hi All,

While using fog volumes to create foggy areas in our application, we noticed that shadows inside of the foggy area appear very strong. The environment presets can be used to counter this effect, however they are applied scene wide.

For our application a scene is possible where we have one camera inside of the fog and another camera outside in clear weather simultaneously (so just changing the preset depending on whether the camera is inside of the fog is not possible). Is it possible to have strong shadows and clear weather outside of the fog volume but less strong shadows inside of the fog?

Here you can see the mentioned hard shadows with environment preset0 (Pic1) and the solution with environment preset 1 (Pic2):

Pic1volumetric_fog_preset0.png.52cac5c6342eb27af8a38ac95561f322.pngPic2volumetric_fog_preset1.png.51dfa6336df111e730a5c615dc0db63b.png

Without fog it we have preset0 (Pic3) and preset1(Pic4):

Pic3no_fog_preset0.png.c99a3937f5edafe4c51275e4fe0511a7.pngPic4no_fog_preset1.png.b659382aba2cb5b700b0a1f08b08841b.png

So we basically want something like Pic2 inside of the fog but something like Pic3 outside of it. Of course we are open to other solutions not using Environment presets.

Any ideas are welcome.

Thanks a lot in advance.

 

Link to comment

You could affect shadow parameters in relation to the position of the camera i guess.

Or maybe switch between 2 worldlights?

The cloud layer does affect the sun's behavior. Maybe via that something is possible as well?

best.

Edited by werner.poetzelberger
  • Like 1
Link to comment

Thanks for the suggestions.

I just played around in the Editor and using different viewport masks with different cameras seems to be the way to go.

So for people running into the same issue:
Every camera gets its own viewport and the scene objects are rendered in every viewport. Then you can create a new sun for every camera and only render it to the cameras specific viewport (using viewport masks). If the camera is inside of fog, the sun intensity can be reduced for this specific camera. This would even allow for smooth transitions if you move inside or out of the fog.

We haven't implemented it yet but this seems like the way to go.

Kind regards.

  • Like 1
Link to comment

Well done!

The cool thing with Unigine is, that there is a lot possible. 

Always stay creative in thinking ;) (and try a lot)

best.

Link to comment
×
×
  • Create New...