Find Intersection of shader/ or use shadows


I am wanting to do an effect of a laser beam being cut from the shadows of objects/people. Like this :

I considered, if it was possible, to have a second shader with a light above the laser start point casting shadows onto the object and somehow using those shadows to mask out another shader. Have no idea if that’s insane or not.
Or possibly are there intersection nodes I could plug that will allow some control?

Do I need a programmer if none of this is possible?

Thanks for any pointers,

That’s a volumetric type thing, there’s nothing like that in the engine at the moment, you’d have to program it in.

I have a simple triangle laser set up and that works fine and can be animated and it looks fine. But no cut outs.
If I use the built in geometry I can do a subtractive cylinder from the laser, which is a squashed cone and get something close to what I had previously but a little closer to what I want.
Few problems with that is, that it looks pretty bad, it doesn’t match the bounding box of the people and it’s not animated. Also won’t allow me to parent to anything so I can’t attached it the main laser to inherit animation.


I only have a triangle mesh in my laser (not the ue4 geo one), if there’s a way to get the intersections of other meshes with the triangle beam maybe it could be used to cutout via a radial ramp on the material or something…just thinking aloud.


Without the volumetrics, this could be done with a green movable spotlight + light function that masks the spotlight into the laser shapes. With the volumetric effect, it would require a new feature that samples the spotlight’s shadow depth map as it raymarches through the volume. This type of thing can be very slow on the GPU unless implemented smartly.

I’ve gone with a light shafts for the moment to get a fake looking volume over the top of the laser. Works at the moment, going to layer up a few things and that should look close-ish.
What would the light function do? Is it possible to mask? Confused to see how it would work, can you elaborate a bit more?


I don’t see how that could possibly generate the desired effect?

I do however suspect you might be able to do it using a camera at the light source and depth buffer.

Light function + spotlight shadows gives you the effect on surfaces, basically only where the laser intersects geometry. It’s mostly a volumetric effect though, so ignore =)

If you had access to the spotlight shadowmap in the pixel shader of the green laser beam, you could do a shadowmap comparison to get the shadowing. That would take some hacking though.

just as an exercise in learning, could you post a picture of what it would like? I am not any clearer on how it would work.