Creating God Rays through clouds

I’m working on a cloudy overcast scene with mountains in the background. I have my character starting on the lower part of the map with the mountains visible. I’d like to have some god ray highlighting the mountains in the bg, with god rays (like this basically
image

but all of this in the background.

I tried to fake the god ray with a blueprint but it just doesn’t look as good.

another image of what im trying to do (but with multiples location)


My setup right now is:

1st directional light for ambient lighting on the whole scene, and not have the sky and cloud black

2nd directional light with a light function mask to highlights only some spots, but no god rays because the highlights spot are at a higher level than the playable area = I can’t increase the fog height otherwise it would destroy the playable area

Even with one directional light and have my ambient lighting from cloud/ skylight, I can’t get the god ray visible because of the lower location of the fog actor.

Basically I have the highlighted spot working with the lights, but not the god rays coming from the sky. I’d like them to be visible from all angle. It’s the same with spotlight since no fog= increasing volumetric scattering does nothing

What could I do ?

Thanks, hope I was somewhat clear

1 Like

Hello!

You can create God Rays not only with fog but with the light propierties too.

In a Directional Light search in it’s propierties “Light Shafts” and activate “Light Shaft bloom”. With this option your light will always generate godrays if you see in the right position.

For more info I leave you the link from an official Unreal tutorial.
The first method is what I told you here:

Now, I couldn’t get the clouds in the Skysphere to cast shadows, but you can always create a cloud from an external object.

I hope this helps you!

Thanks for the answer :slight_smile: The problem with this is that I can’t get it to make the ray visible when not looking at the source light directly. I’d like to have more of a stylized render and have the god ray visible from anywhere, regardless if the source light is visible on the camera screen
Also, I know there a fyi at the end of the documentation from unreal on fog to achieve strong god ray without strong fog, but my scene has the mountain on a higher level than the playable area. I would have to completly drown out my playable area in fog to have the moutain god ray visible :confused:

2 Likes

There is a material in the DMX plugin that it used to make light frustrums. I’d look into how they did that as a decent out of the box starting point.

Essentials you have a static mesh frustrum shape with a material on it. Think of flashlights from old splinter cell.

Volumetric clouds actually do this by shadowing the skyatmosphere, the documentation has a beautiful example of it:

Unfortunately I find the effect is actually pretty subtle in practice.

It also requires you use expensive settings for the clouds, and I find you really need to double the max shadow resolution (from 2k to 4k) in order to capture any meaningful detail. I wouldn’t really even consider this for a realtime application (unless you have a huge budget for clouds… like a flight sim or something)

Yea i’ve tried with the sky but I agree with you, I can’t afford it and it’s too subtle. I find clouds and documentation in Unreal really lacking sadly.

Ill look into it, but it sounds like it’s a cone mesh with a fake god ray material on it right ?

It’s not a cone, its a frustrum. Same idea though yes.