Ideas for reducing lighting and GI when going "Deeper" into fog.

Hi,
I’m using a combination of particles and “Global Fog” to achieve flying into the gases of a gas planet effect. Any techniques for reducing the lighting effects as you go deeper into the fog people could think to use? I’m using a directional light when above the fog but need it to “fall off” as you go down (but not for objects above the fog as they should still be light brightly).

Basically I need fog to reduce the effects of lighting and global illumination.

Any way people can think to approach this problem?

Thanks!

Another way to think about the problem I’m trying to solve would be to think of an underwater scene. I’m trying to get the sun light to effect objects less the deeper they are. (but still effect objects higher up at more intensity.) I’m not sure how to reduce the effects of a single light on an object without reducing the effects of all lights (e.g. a shader)

Thanks,
-Matt

Create a script that changes your directionnal light settings when you’re going away from a specific gamobject’s transform.

I’m not a dev so I can’t write an exact code for that purpose, but it should be something like :

You’re welcome,
-Matt :slight_smile:

Heya Matt,
Thanks for replying.

Your solution is my backup plan but the thing is I’m trying to find a solution that does not involve changing the light intensity. The problem with changing the light settings is that objects above the cloud layer are also effected.

E.g.
Ship 1 - still above the clouds - lighting should stay the same
Ship 2 - moving lower below the clouds - lighting on this ship should be getting darker.

With the above if I change the light intensity going into the clouds would cause the things above the clouds to get lit different as well. Its sort of like being underwater but being able to still see out. The player and other characters that are going underwater should be getting darker but the objects outside of the water should be lit the same.

I really need something like a directional light with falloff on just the y axis. Sort of a conundrum

I may have found a solution that I originally tried but couldn’t get working. Having a series of planes with semi-transparency so as objects pass through them they get darker.

This didn’t work originally though increasing the Shadow distance in the quality settings fixed that… I have no idea why as the camera distance should not be an issue in this case…the object get shadows just fine when they are being case from smaller objects (rather then huge planes)

Shadow Distance The maximum distance from camera at which shadows will be visible. Shadows that fall beyond this distance will not be rendered.

I have a feeling the above setting isn’t’ doing exactly what it says.

It depends on how you’re rendering the fog. And are you using a deferred or forward pipeline?

I’m using deferred. Fog is a modification of the “Global Fog” standard asset.

have you thought about using a command buffer to modify the lighting GBuffer?

I had not. I’ve never used command buffers but will do some research on them. Thanks.