Help with Persistent Volumetric Light (God Rays | Light Shafts | SunBeam | sunBurst) for Underground Cave Scene

Hi everyone,

I’m working on an underground cave scene with an organic ceiling hole where I want realistic god rays to fall onto the cave surface. My goal is to achieve a persistent volumetric light effect without having the source mesh visible in the final render.

What I’m trying to achieve:
Blender Visualization:

I’d like the light rays to appear naturally coming down through the irregular ceiling hole, giving a dusty, volumetric look to the cave atmosphere.

My current approach with postprocessing GodRaysEffect:


I used the postprocessing GodRaysEffect on my source mesh. It works well when the source mesh is in view; however, when I move the source mesh off-screen, the god rays fade away completely. I want to hide the source mesh entirely while still having the volumetric light effect.

Other attempts:

  • I tried combining a light with an occluder (a plane with holes) to simulate the effect, but due to light falling and being blocked by geometry, it didn’t produce the characteristic dusty feel.
  • I also considered using a mesh that simulates light rays with custom shaders, but I’m not sure this approach would yield the natural look I’m aiming for.

Question:
Has anyone managed to create a persistent volumetric light effect in a scene where the light source is hidden (or offscreen), yet the god rays remain visible? Specifically, for an underground cave environment with an organic ceiling hole, how can I achieve realistic, dusty, persistent god rays?

If you’re using WebGPU there’s a newly added volumetric light that has the potential to meet your needs for this three.js webgpu - volumetric lighting

3 Likes

Obs: THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend. Running OK!
volume_lighting_174.zip (3.2 KB)

2 Likes

Thank you so much, @jrlazz! This is exactly what I was looking for. The demo you shared looks great, but I noticed it’s just a demo and doesn’t include the source code. Would it be possible for you to share the source code as well? I’d really appreciate it! :grinning_face:

The source code is embedded in the official example I shared here three.js webgpu - volumetric lighting :blush:

It is in the zip included…
volume_lighting_174.zip (3.2 KB)
or

Where You can get the code with CTRL+U

1 Like