Download

Shadow Casting actor - Light that casts shadows but doesn't illuminate the scene?

In Source Engine there existed an entity for casting shadows specifically. It was like a dynamic light source that simply didn’t emit light. Is there an equivalent in UE4.26 ?

Shadows are where light is occluded so how does this even work exactly? Is the shadow just multiplied over the texture? Does it erase other lighting?

In Source engine it was just like having a spotlight that cast a stencil shadow on any dynamic actor it hit, but as I said, didn’t emit light. Maybe I should calrify what I mean with a screen shot:


I want the shadow of the player on the ground, without the light illuminating the scene.

You could do this in the floor material by using a depth render target, darkening any area that is occluded (in shadow)

You replied faster than I could edit my response :stuck_out_tongue:
Dynamic shadows are just projected onto the environment. That’s why they’re dynamic. It’s essentially just another mesh - I’m not 100% certain of how it’s coded, but that’s the gist of it. Static shadows are baked into a texture that’s overlaid on top of the environment and won’t be possible to get what I want.

I still don’t think that’s correct. You can certainly make a fake shadow by projecting it into the scene (ie: decal blob shadows) but I do not think that is how shadow maps for dynamic/stationary lights are done. They’re essentially a depth texture that masks the light out

I appreciate the response, but that wouldn’t get me what I want either because the light is illuminating the character too.

There would be no light, by using a render target and building the shadow in the material you’re essentially creating the shadow without the light.

I’m not a programmer so I can’t tell you how it’s coded and I imagine it’s completely different in UE4, but I know how it functioned in Source engine which is why I mentioned it. Load up a game like Left 4 Dead - shine your flashlight on a piece of furniture and then walk around it. It’s just another version of the mesh that’s textured black and transparent and then the flashlight is creating a pivot offset of some kind. I imagine that dynamic shadows in UE4 use a similar technique.

Okay, so if I wanted to do this, would it only work on the objects in the environment using this material? Also, I’m hoping for something less expensive and I thought Render Targets were quite expensive

You could dump it into a material function and reuse it in multiple materials but yes. It would also multiply over other shadows from regular lights (same as using blob shadows)

Generally yes but since you only need the depth, it shouldn’t be too bad.

hmmm… I was hoping the engine already supported something like this. I’m gonna see if anyone else knows anything, but thank you for your replies.
Oh, and here’s an article on Lighting in game engines:

If you scroll down half way to the screen shot of Kingpin, they talk about Projection shadows and then Doom 3 using a modified version called Shadow Volumes. I think Source engine’s version is similar to this as it was developed around the same time period.

If you keep scrolling down that page they eventually describe shadow maps using a depth texture, which as far as I know is how shadows in UE4 are rendered.

Still, interesting article, thank you for the link

1 Like