# Light though wall when using volumetric fog ?

**URL:** <https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429>\
**Category:** Rendering\
**Tags:** unreal-engine, Lighting, volumetric-fog, question\
**Created:** [June 23, 2024, 7:59am UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429 "2024-06-23T07:59:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tang\_yw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tang\_yw](https://forums.unrealengine.com/u/tang_yw)\
**Post date:** [June 23, 2024, 7:59am UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429/1 "2024-06-23T07:59:09Z")

</div>

Hi, I have this issue in my project when using volumetric fog to create god rays/ searchligh beam, the light volume go through walls. I was having hardware raytracing on and now turned off, but still have the issue.

I tried in a new map in the same project, still having same problem.  
I tried in a new blank project, there is no this problem, and turned on hardware raytracing, something similar to the problem came up, and turned off hardware raytracing the problem gone.

But my previous project still have the problem even with hardware raytracing off.

Does anyone know what might be the real problem? Thank you!

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [June 23, 2024, 1:02pm UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429/2 "2024-06-23T13:02:49Z")

</div>

There’s a setting in each light called “cast volumetric shadow” or something to that effect, enable it and so long as you’re using shadowmaps or virtual shadowmaps, it should work

---

<div class="post-metadata">

**Author:** ![tang\_yw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tang\_yw](https://forums.unrealengine.com/u/tang_yw)\
**Post date:** [June 23, 2024, 3:09pm UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429/3 "2024-06-23T15:09:08Z")

</div>

Thank you! It did solve some of the lights, and I also need to turn off the distance field shadow, but there’s still some of the light makes it through walls. So this has nothing to do with the hardware ray tracing right?

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [June 23, 2024, 3:12pm UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429/4 "2024-06-23T15:12:40Z")

</div>

> [@tang\_yw](#):
>
> So this has nothing to do with the hardware ray tracing right?

It does, raytraced shadows don’t support volumetric shadowing (neither do distance field shadows, capsule shadows, or indirect distance field shadows)

You can still use raytraced shadows on other lights in the scene, you just need to disable them on lights that need volumetric shadows.

---

<div class="post-metadata">

**Author:** ![tang\_yw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tang\_yw](https://forums.unrealengine.com/u/tang_yw)\
**Post date:** [June 24, 2024, 8:07am UTC](https://forums.unrealengine.com/t/light-though-wall-when-using-volumetric-fog/1913429/5 "2024-06-24T08:07:21Z")

</div>

I did some more test and found out in my case the problem persists.  
I’m having Hardware Raytracing off, with volumetric fog on. In the light, having Cast Volumetric Shadow on, and Distance Field shadow on or off. Now regular spotlights could work correctly with light ray blocked by walls.

But I’m making a searchlight from top of a mountain, lighting towards player pawn in distance up to 350m. So I need the light beam and lit area visible at 350m from the light source, and the light beam almost like a cylinder.  
So the setting for the spotlight would be at least  
intensity: 500 lm  
attenuation radius: 38000  
outer cone angle: 0.7  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/e/2aeab56b06bd9ff98c4c4e5298040ccef21b6fca.png)

And these 3 settings are the key to make light cut through anything within the range below half of Attenuation Radius, as long as the Intensity higher than 100 lm while Outer Cone Angle lower than 2. Seems there’s a blance there, felt like the the density of the light particles reach a level, it will cut through walls.

Is there anyway to stop this particular light to go through wall? If no, then maybe my only option is make the Attenuation Radius dynamically based on hit to the surfaces.
