Stylized fake animated light shafts with fireflies?

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)

Take a look at this for faking God rays

2 Likes

Thanks! It should work

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

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?

2 Likes

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?

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.

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

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

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

1 Like

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 ).

2 Likes

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

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)

ideas?

1 Like

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

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

This took a couple of minutes

ray

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

ray2

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

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.

1 Like

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?

1 Like

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

1 Like

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

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:

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

If I used planes, even trying different positions:



so I don’t see how this could work

2 Likes

Point taken :slight_smile:

But, although this looks good

image

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

image

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?

2 Likes

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:

the first game is Diablo 3.

2 Likes

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

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

1 Like

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

2 Likes

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

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

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

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.

1 Like

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