Download

Shadows cast on translucent material doesn't show up in game

This really drives me crazy…

I have materials for different translucent effects… water planes, Shore foam Particle effects, and so on. Everything works fine with one exception: I do not get shadows to show up on these planes and effects in game.

Weird thing is: since I switched my materials to not use a seperate translucency pass, the editor viewport shows the materials with proper shadowing. I just don’t see these shadows when I hit “play game”. What could I do wrong?

On a separate note, switching to no use a separate pass of course did mess up my refractive effects. refraction now not only affects the scenecolor behind the translucent material, but also the translucent material itself. I guess I could duplicate the plane and create a material that just applies the refraction, but I use a spline as a river water “plane”, so question: is there a way to duplicate a landscape spline?

Oh, engine Version is 4.8.3… I’ll upgrade when I need to, I am a little hesitant about that (as this was always a lot of trouble in Unity, don’t know about Unreal Engine yet… is the upgrade smooth for minor versions?)

EDIT: After more testing it seems that shadows do show up ingame… just at a range that is very close. As I am using a pseudo-isometric viewpoint that is of course not desirable. Realtime shadows on stranslucent materials also disappear after zooming out in the editor window, but I can zoom out much more until that happens (haven’t checked if that is dependend on the Field of View yet).
I am rebuilding the shadow map with much higher settings now, don’t think this will help much though as this should be dynamic shadows.

I tried setting the light to dynamic, thus making all shadows dynamic… didn’t help.

I will reduce StaticShadowDepthMapTransitionSampleDistanceX in BaseLightMass.ini even more if the shadowmap rebuild doesn’t work, read somewhere that this has an effect on translucent shadowing… I am not sure though if it has to be reduced or enlarged to make translucent shadows better quality.

EDIT 2: Found the culprit. The shadow depth has an extremly low range per default, and it seems also pretty low resolution. As per this page: https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/LitTranslucency/index.html

I have set these settings to the following values:

r.TranslucencyLightingVolumeDim=128
r.TranslucencyLightingVolumeInnerDistance=4000
r.TranslucencyLightingVolumeOuterDistance=4500

Distance is still rather low for my use case, but with any bigger distance shadows get so blurry that they are hard to see. Any “Dim” (Resolution i guess) over 128 resultet in laggy performance even with my GTX 970, so I’ll rather not increase it for now.

Well, I’ll analyze more what StaticShadowDepthMapTransitionSampleDistanceX and StaticShadowDepthMapTransitionSampleDistanceY does… maybe they have an effect on the blurriness of the depth shadow map?