# Stylized fake animated light shafts with fireflies?

**URL:** <https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111>\
**Category:** FX\
**Tags:** unreal-engine, question\
**Created:** [July 17, 2024, 9:13pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111 "2024-07-17T21:13:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 17, 2024, 9:13pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/1 "2024-07-17T21:13:29Z")

</div>

Hi, I want to achieve this look:

which ideally would be a stylized and low cost way to recreate dust particles in a light shaft like TLOU:

But all I managed to come up with was this:

it’s a rectangle light touching the floor (as light from a door would probably be) and some self illuminated niagara particles, but:  
-light on the ground is too harsh  
-dust don’t look as if it was being lit by the door light  
-no light shafts (haven’t figured out how to fake them)  
-light doesn’t look dynamic

any suggestions on how I could improve it? (or redo entirely, probably)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 18, 2024, 6:42am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/2 "2024-07-18T06:42:23Z")

</div>

Take a look at this for faking God rays

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/5/e9560510407ef5fc8073858df8e9a0d0ef44601b.jpeg "Creating simple God Rays (light shafts) in Unreal 4") ](https://www.youtube.com/watch?v=gOdTrIB5te0)

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 23, 2024, 1:23am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/3 "2024-07-23T01:23:17Z")

</div>

Thanks! It should work

However, I need some extra control, since my light shaft geometry has to be different than a perfectly round cone:

 ![Screenshot 2024-07-22 221901](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/b/28bd2e30b91728bc9911088b146c6d649b9a274b.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/d/37dbadc4d4d3fc6f60d3edb9574d4c2f1451d0c8.jpeg)

I’m using a fresnel node like the vid suggested to get it fading smoothly at the round edges (in red), but this node produces a smooth curve, making it very opaque where the geometry is facing the camera (in green).

How do I adjust the fresnel curve? I need the center (of a hypothetical fresnel sphere) to be a flat color such as white, and only then after a certain distance from the center, start fading to black. a cheap contrast won’t do it. I remember from old Ben Cloward vids that he used to do this all the time, but I can’t remember how or find a vid showing it. has to do with getting the fresnel node and adding or multiplying to a power or something.

Any ideas?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 23, 2024, 6:48am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/4 "2024-07-23T06:48:19Z")

</div>

It looks like you need it to be more opaque on the ‘axis’ of the actor?

Maybe you could measure the distance from that vector somehow, or, I recall BC talking about ‘wetness decals’ and a lot of masking going on there, could it have been that?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/c/08c59228cfb4c192413f503f9427b900a2cccecd.png)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/4/0842568a888546ba3db101f262f6182249528396.jpeg "Water Decals - Building Worlds In Unreal - Episode 10") ](https://www.youtube.com/watch?v=olk41batGSA)

Be aware, that the player can’t walk into the god rays, as the illusion totally breaks down then. If you want that, you have to use a real volume.

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 23, 2024, 2:30pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/5 "2024-07-23T14:30:33Z")

</div>

It’s just the fresnel node, really. right now it looks sort of like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/e/c2e261f9baa8738c6e60832bf4d48a3774d5cbdf.jpeg)

and I need to have control over that ramp, so i can make it look more like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/6/f6684d405214040c7f6a6672d39236f876ebea60.jpeg)

fresnel is camera based though, not a flat texture, so I suppose I’m looking for the math to control this ramp

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 23, 2024, 2:41pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/6 "2024-07-23T14:41:42Z")

</div>

What I gave there should work, as long as that ‘square tube’ is made from one UV square.

( Although it will pull away from the seam ).

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 25, 2024, 3:52pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/7 "2024-07-25T15:52:10Z")

</div>

your method worked very well for the outer edge! (which is something i was going to need later on)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/1/461699ce5c35f716e4d376c32b0bc8aa977b4577.jpeg)

however I still need to fade the inner edge (red), similarly, and the upper and lower edges (green, which are the ones I was trying to use the fresnel node, without much success)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/2/cc2b058e51cd80cf5abafae5d7a687c886bc3455.jpeg)

ideas?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 25, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/8 "2024-07-25T19:02:15Z")

</div>

I don’t think it’s going to work with a mesh this shape. I’m pretty sure the one in your original pic is a flat plane.

I don’t know if you’ve seen this

[https://www.unrealengine.com/marketplace/en-US/product/lazy-godray](https://www.unrealengine.com/marketplace/en-US/product/lazy-godray)

It’s basically a blueprint that takes all the guess work out of it.

This took a couple of minutes

![ray](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/6/3b6056afd52b208749268e3d195dc8c7c563e444.gif)

It’s totally flat, but you can walk around it

![ray2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/e/c1e599f2984146541ae1059807f8dac660c1724a.gif)

It think you need to go down the ‘flat’ route, or just use volumetrics 🙂

The vendor stopped on 4.27, I assume because of volumetrics, but I still use this now. Volume fog is too hard to control ( inside and outside ), and eats frames the way this method doesn’t at all.

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 25, 2024, 8:30pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/9 "2024-07-25T20:30:34Z")

</div>

Right, volumetrics would be “easy”, but I don’t want to use volumetrics since this game is supposed to run on a potato.

I want to use these god rays to make it more obvious where doors are located on hidden front walls in my top-down game, since I’m not showing any door meshes or anything, and these hidden doors can be at different angles, so if I just used a plane mesh it wouldn’t work for the shape of the doorway, specially when viewed from different angles.

any other way I could set this up?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 26, 2024, 7:42am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/10 "2024-07-26T07:42:18Z")

</div>

Can you show me a place you could have a door where using a plane won’t work?

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 26, 2024, 3:27pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/11 "2024-07-26T15:27:59Z")

</div>

Sure, these are the 3 most common angles I’ll have hidden doors: (R, G and B)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/f/2/9f20dfc2d7d25e120dcc4edddb15464c6af53506.jpeg)

where would you put a plane that would work for all 3 of them? even if you could move the plane for each case, I don’t think a plane works for each of them individually

also worth noting that this is an “isometric” perspective, not purely isometric, so as the character moves and the camera moves with it, the perspective changes ever so slightly

ideally, regardless of the shape, the final result should look like this:

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

but with the edges with gradient opacity, something like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/d/97dbe0b1446b9bb8fdf30b8f13a6953811936e78.jpeg)

If I used planes, even trying different positions:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/d/53d075c51a4a78f37b6df71fec58830d9f1ae52a.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/a/5ca5b1fa1fad5469bae767cc707bd50625388f8d.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/9/27994e25090870d0cac9d81c63913c5cd2ce2eb1.jpeg)

so I don’t see how this could work

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 26, 2024, 8:20pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/12 "2024-07-26T20:20:24Z")

</div>

Point taken 🙂

But, although this looks good

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/e/c8ee783e113b795597b19fe8881bf5948df62d22.jpeg)

What about when you want to see this from over here?

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/0/ad0f0a596062ec651d6ac3573e1e733879d63d14.jpeg)

Keeping the color away from that edge works from this side, but it won’t work looking the other way.

What’s the name of the first game?

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 26, 2024, 9:43pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/13 "2024-07-26T21:43:37Z")

</div>

Right, so the thing is, camera is fixed on this angle. character rotates but the camera stay fixed so it will never be seen from that angle you pointed.

and if it was to rotate, then the hidden walls would be shown (such as is already the case for when there are doors on the opposite, visible walls), and the door mesh would also be visible, eliminating the need for light shafts (which, unlike the first game I showed, my plan is to use them just to represent doors that aren’t visible to the camera). like this, just as an example:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/1/021442cb7569daa7733728c182f47349f0d557b4.jpeg)

the first game is Diablo 3.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 27, 2024, 6:53am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/14 "2024-07-27T06:53:59Z")

</div>

Sorry, can’t find anything, I’m out of ideas 🫠

That previous pic looks like you have it pretty much nailed, though.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [July 27, 2024, 8:40am UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/15 "2024-07-27T08:40:19Z")

</div>

Why not just do it with a gradient map uv’ed on a slightly rounded box  
You can pretty much get it running on older hardware. Only downsize is the overdraw cost when many overlap

[](https://www.youtube.com/watch?v=dRp6Aso45uQ)

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 27, 2024, 2:50pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/16 "2024-07-27T14:50:02Z")

</div>

Ah but that’s just a photoshop representation of what I wanted to achieve 😅

now if I could do that I’d be satisfied. I guess I just need the “front” gradient (the part where the player would “enter” the beam, like the arrow you drew) to be a bigger fade than the other edges

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 27, 2024, 2:58pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/17 "2024-07-27T14:58:23Z")

</div>

Because I want all edges to have some gradient opacity, not just the front of the box, and the other ones are camera dependent

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [July 27, 2024, 4:07pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/18 "2024-07-27T16:07:45Z")

</div>

You can’t get gradients from every angle. You would need multiple planes to try to emulate this (sort of like how game dev used to do muzzle flashes).

The problem with this type of multiple planes is that you get massive overdraw which is pretty bad. You also can’t use additive blending because it will exaggerate the visibility of the planes at an off angle.

In a muzzle flash it’s no problem because it’s all bright and glowing. In the case of light shafts they are more subtle.

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [July 27, 2024, 4:20pm UTC](https://forums.unrealengine.com/t/stylized-fake-animated-light-shafts-with-fireflies/1941111/19 "2024-07-27T16:20:28Z")

</div>

it kinda works if I round the box’s edges and use a fresnel ramp as opacity, as the first vid posted by ClockworkOcean suggested, along with his method for the front fade.

if I could somehow alter the contrast of the fresnel ramp like I mentioned in my third post, so the round edge of the box which is closest to the camera doesn’t become less transparent than the rest, I guess it would work ok

it’s not ideal sure, a way to make a gradient opacity at the pixel edges of the mesh would be perfect, but idk how any of that would work
