# Volumetric Rectangle Light not working

**URL:** <https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266>\
**Category:** Rendering\
**Tags:** Exponential-Height-Fog, Fog, unreal-engine, Rendering, Lighting, UE4\
**Created:** [October 14, 2022, 7:22am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266 "2022-10-14T07:22:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [October 14, 2022, 7:22am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/1 "2022-10-14T07:22:54Z")

</div>

Dear support,

I am trying to recreate a technique I used once without success.  
Basically my goal is to create a light rig that produces volumetrics, like this:

 ![wanted result](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/e/0eeb09ffce06fb94bde433052720c7a1c921ca07.jpeg)

In the past, I used a rectangle light + a light blocker mesh in front of the actual light. When adding the Exponential Height Fog Element to the scene, the rays show up nicely.

However, doing this again on another project, I am not getting the desired effect.  
This is my model blueprint:

 ![rect light and holes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/d/20d763d9987164818412b90b11be1eb4e63723d7.jpeg)  
and this is the result:  
 ![result](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/c/f9cfe884462fa2487f941487f554e0502eddc4b2.jpeg)

What am I missing? or is there maybe a better way of getting this result?

Thanks in advance,

Elad

---

<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:** [October 14, 2022, 7:50am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/2 "2022-10-14T07:50:43Z")

</div>

Most likely the light is not set to cast volumetric shadows, or you’re using raytraced shadows which don’t support volumetrics.

You’d most likely get better results with a spotlight, this really doesn’t seem like an appropriate use of a rect light.

---

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [October 14, 2022, 8:13am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/3 "2022-10-14T08:13:25Z")

</div>

Hey Arkiras,

Thank you so much - it indeed was the issue.

With the spotlight I am getting cute results, but not when I try to activate the gobo effect with the mesh covering the spotlight.

Then I’m barely seeing the effect, unless I raise the Volumetric Scattering Intensity, which in that case the result is very blurry/low quality.

Any tips about how to make this happen better?

 ![light settings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/3/103c48eaecb6be98c4411a7558ced4068da17ed8.jpeg)  
 ![scatter result](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/1/0b164b220ac1403df6331384e70ed595c8bcddaf.jpeg)

---

<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:** [October 14, 2022, 8:23am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/4 "2022-10-14T08:23:30Z")

</div>

There’s no need to raise your intensity so high, you can increase the volumetric scatter intensity beyond what the slider will allow by typing the number in:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/a/25a7fbf7faa4e248477da68d6c18c99cf79c8a4d.jpeg)

The noise is probably because the holes are so small, you may need to decrease the voxel size of the volumetric fog using this command: `r.VolumetricFog.GridPixelSize`

The setting defaults to 8 (I think), lower numbers will capture finer detail at the cost of a lot of performance. I wouldn’t suggest going below 4 if this needs to run in realtime

---

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [October 14, 2022, 8:30am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/5 "2022-10-14T08:30:39Z")

</div>

> [@Arkiras](#):
>
> r.VolumetricFog.GridPixelSize

Using an intensity of 20 + 250VSI I’m getting nothing at all, I tried 200 instead, still getting a very subtle result compared to yours which looks clean and crisp.

Also set the pixelsize to 4 but it didn’t help (I’m loading the fog element via BP) cause it can be turned on/off

What did I do wrong?

 ![settings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/9/7a914a64c586598d8adab4eefc910a26c9deb7b1.jpeg)  
 ![result](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/8/b7850f60d78a9ef17768913b148fe26bae5750e6.jpeg)

 ![fog blueprint pixel size](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/d/61dc327e08fa89e808284085deb8e4ff85158b68.jpeg)

---

<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:** [October 14, 2022, 8:45am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/6 "2022-10-14T08:45:28Z")

</div>

I can only assume its related to the size, volumetric fog generally cannot capture small details. You can try setting gridpixelsize to 3 or 2… but expect a huge performance hit…

Only other thing I can suggest is maybe try using a light function instead of a blocker. If the issue is with the shadowmap resolution that should fix it. Again though this will probably come at a performance cost…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/1/fb18fa90f3de6984ceb18b6b35cc39baa89f991f.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/a/b6ad1741cccb037c61d56636c9a3c25087ef6ae7.jpeg)

---

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [October 14, 2022, 9:09am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/7 "2022-10-14T09:09:00Z")

</div>

The light function idea sounds great, but on my end it ignores the setting,  
Is there another setting somewhere to make sure it works?  
I’m on 4.26

 ![light function](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/9/449cf32faa001b353c5d5368502703ae9005f6b7.jpeg)  
 ![light function 2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/d/80d3655ddf5db7c2256ec270f885a42a9ed57934.jpeg)  
 ![result](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/1/1b11b9f17b2cf4d066a94114439e3eccdcf11bc9.jpeg)

Thanks again for everything

---

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [October 17, 2022, 9:20am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/8 "2022-10-17T09:20:44Z")

</div>

any updates here?

thanks again

---

<div class="post-metadata">

**Author:** ![EladMagdasi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EladMagdasi](https://forums.unrealengine.com/u/EladMagdasi)\
**Post date:** [December 1, 2022, 8:12am UTC](https://forums.unrealengine.com/t/volumetric-rectangle-light-not-working/669266/9 "2022-12-01T08:12:55Z")

</div>

Another update:  
I upgraded to 5.1 to check the matter, so light functions work now,  
but I don’t get the same clean ray as you, the areas closer to the beginning of the spotlight are super pixeled, even thought I’m on pixelsize 4:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/6/306db307f9b97adbb573b3bab7836b43d1197095.jpeg)

Any tips about how you got such clean smooth ray?

Thanks again
