Raytraced Shadows in Unreal - a fix!

Content Creation Bugs 2D Compositing Unreal


Hi Everyone,

I wanted to make a quick post about an issue that I was having yesterday and the solution I found - in case this is interesting to anyone else.

One of my VP goals is to be able to tightly integrate the live action into virtual environments and Ray Traced Shadows are an essential deal to this. Previously, in long-past UE4 versions, I had no issues with casting a nice raytraced shadow from the billboard but in 4.27 I could only get a solid black, full coverage shadow from the entire billboard (a big black rectangle!)

Some fidgeting around and I could confirm that Shadow Maps could work but they're so awful and I wanted to pursue this as I'd done this before with success.

Searching the forum here I found several topics near to the concern but not solid solutions/anything that could work for me.

I ended up building a diagnostic scene to test it and found that the default "Translucent" blending mode indeed casts only a solid shadow without considering the Opacity plug. "Masked" mode works so I hacked into the "Billboard_lit" and "Billboard_Unlit" master materials and changed a few parameters and found that this worked!

Translucent Blending Mode,

Clipped Blending Mode,

Material parameters I changed.


Profile Image
8/11/2022 8:11:49 AM

Well done Renbry, many thanks for sharing!

Looking forward to testing this solution too.

Profile Image
8/11/2022 10:02:16 AM

@Renbry: The problem with using masked blending mode instead of translucent is that the masked blend mode is binary, so you won’t get any semi-translucency and soft edges on the keyed foreground. 

Did you enable RayTraced shadows in the Aximmetry camera settings? This *should* give you raytraced shadows from the standard billboard. If not, this is a bug that Aximmetry needs to investigate. 

Profile Image
8/12/2022 12:32:54 AM

Hi @TwentyStudios,

Yes I started with that Raytraced settings on the Camera. It didn't work so that's where i began the chase.

I knew I'd done this before in Aximmetry, however that could have been <UE4.26. I went back to 4.26 to check things and it doesn't case any shadow from materials set to Translucent. In 4.27 I do get shadows, but they're solid black (they don't respect the Opacity material plug - shown in the Checker example above) but going to Masked suddenly did the right thing.

Yes the masked material is boolean; that's a disadvantage but it seemed to be the only way to work with Raytraced shadows - even in vanilla UE4.27. It seems that the raytrace code is expecting translucent materials to be something like Glass or so - that would make sense that they've done work to at least cast black/solid shadows from Glass objects (rather than no shadow as in 4.26) however our use case is Translucent with variable Opacity and that's what is looking to be a challenge.

I haven't noticed artefacts from the Masked clipping but I'll be looking more closely at that next time I test.

(apologies for the double image in the first post; Aximmetry's forum doesn't let me Edit Post - seems broken at the moment.