Shadow on translucent material disappear at distance

Hello,

I’m not sure if this is a bug, setup issue or intended behavior so any input is appreciated.

The first image of Saturn is the desired result. Up close the planet looks as intended with the body of the planet casting a shadow on the rings. When the camera is moved further away or at certain angles the shadow will “fade away” until it there it is no longer darkened at all.

2180-saturnring_nearest.jpg

The rings are a translucent material while the body of the planet is solid. It should be mentioned that the planet is very large (~400 units?) and normally quite far away. Making the planet small and close doesn’t fix the issue and moving far away will have the same result at a certain distance or viewing angle. I have toggled every option in the material and meshes relating to shadows and translucent materials and still can’t seem to get this working.

In the second photo you can see that moving away from Saturn will cause the shadow to dissipate and it will eventually disappear all together. This also seems to occur even when not moving further away but instead rotating the camera in certain ways. The shadows seem to disappear when the camera is rotating ‘away’ from them so the camera is pointing in the same direction as the light source.

When moving away from the planet from behind the shadow the shadow’s edge nearest the planet moves back towards the outer edge with a square edge. If you need more images I can provide them (Can only upload 2).

2191-saturnring_far.jpg

If there is something new or obvious that can resolve this I would love to hear it. Hopefully the issue is on my side. If this is intended then I would appreciate knowing so I can focus on an alternative method.

Thanks for your time,

Jared

P.S. I recently noticed that shadows cast on the planet from the rings were quite pixelated. Upon further inspection of the shadow I noticed the work “Preview” shows up inside the darkness of the cast shadow albeit small.

You are going to use dynamic lighting for this i suppose? If that is correct, is your light set to Movable? You should play with the light’s values(most probably Cascaded Shadow Maps settings) for this one.

Really nice looking Saturn, btw!

Thanks!

The UE4 lighting did all the work :slight_smile:

I am using Dynamic lighting only and have disabled static lighting in properties. There is only one directional light. If I remember correct they are not movable by default? I’ll have to try messing with the light properties tomorrow. (sleep…)

Not sure whats going on but somebody else marked the question as answered… (and I don’t have permission to un-answer it… waat)

Sorry for any confusion I was thanking you for the compliment but haven’t figured out this issue yet.

I’ve had a chance to play with the Cascaded shadow map settings to no avail. The light is Movable and lighting is fully dynamic. Even thought this question is “closed” I don’t suppose you could tell me if there was a specific property you had in mind? Or perhaps you could point me to some documentation. Searched “cascaded” on the wiki here with zero results :confused:

I’ve tried settings the “Dynamic Shadow Distance Movable” property up and slowly incremented up to ridiculous amounts (9,000,000+) and while I can see the “shape” of the shadow changing it still fades away :<

I’ve also tried increasing the Number of cascades and lowering the shadow fadeout distance fraction and transition fraction.

Judging by the names of these properties it seems like they should be spot on but besides making the shadow jiggle around a bit they don’t seem to actually increase the distance where the shadow will dissipate?

Thanks for you time. If you have any ideas I’d love to hear them.
(Don’t really want to create a duplicate question to get this done!)

It is ok. :slight_smile: We can continue here.

One thing that comes to mind is the scale of things. What is the size of the planet mesh? Can you try scaling it up as much as you can afford and see if it helps with shadows?

Also make sure it’s mobility is set to Movable.

Thanks for your help.

I changed both the planet and rings mesh to movable.

I’m not sure how the ‘scale’ is calculated by currently the scale is ~7500 units. The mesh I exported was pretty tiny so I may try exporting a larger one to see if that helps? If it helps, even at quite a large scale, you can still see Saturn moving in the sky while the player is walking so its not ‘super’ big.

Interestingly enough, making the mesh larger actually makes the problem worse because the fade distance is still the same and as such occurs much closer to the planet.

I finally found some docs about this. If anybody is interested you can find them at [link text][1].

I’m not sure if it could be considered a “bug” but it appears that the ‘Dynamic Shadow Distance Movable Light’ property has no effect after a certain point. I’m guessing that anything past the default 20,000?

Making the planet larger did introduce this interesting thing to happen though. This is similar to what I mentioned briefly in the original post about the ‘square edge’ to the shadow map but a bit more odd.

2270-saturn_shadow_square_2.jpg

It seems like unless they have an option to do “unlimited” cascade maps or a much higher distance that I’ll probably have to use a mixture of static/dynamic lighting and have the baked lightmaps appear when the dynamic shadow fades away. This seems like the only option for the time being.

If you have any thoughts let me know.
Thank you

So, i gave it a quick try and yeah, something is wrong with translucent materials. I got half, blocky shadowing when i used translucent material for the ring. But this is the result i get with opaque material;

You can see my settings for the light. The planet is a single mesh with a radius of 8k units inside the editor. Those may help you as starters, if you want to go with opaque ring for now.

You may want to start another thread for translucent shadows tagged as bug though.

Hope it helps!

One more thing;

You can use SSS instead of translucent. It works as good as opaque and SSS suits better than translucent considering the real nature of Saturn’s ring.

That’s the idea I was going for was a far away but large planet. Opaque material still looks pretty good except that you can’t see the rings from the other side or tiny stars through the rings. :slight_smile: It will have to work for now though!

You’ve been a big help. Thanks a bunch. For you payment, here is another pretty picture of Saturn at 120FPS :wink: Haha.

I guess it comes with the territory of ‘early adopter’ but I’m still blown away by the tools and how great everything looks!

Thanks again and have a nice day,
Jared

Haha! Thanks, that looks awesome. :slight_smile:

I’ve created a bug report at → Unreal Engine Issues and Bug Tracker (UE-59802), I’m pretty sure that bug is also the reason for your troubles :slight_smile:

I have this exact problem in my current project. I have an earth model and then layered on top of it is another mesh for translucent clouds. I’m mimicking a solar eclipse so when the moon passes in front of the sun I want both the clouds and the earth to receive a shadow. This works great up close, when the clouds enter the shadowed area they appear darker as intended. However as soon as I pull the camera away they start to fade back to appearing unshadowed. I’m using 4.19.2, my Dynamic Shadow Distance MovableLight is set to 110,000 (this keeps the shadow on the earth from disappearing, but not the clouds) I’ve tried changing the cloud material’s blend mode to additive, translucent, and masked, but nothing works.