I’m currently working on shadows in my scene, and have to face a problem :
I use features (especially trees) from the Procedural Nature Pack Vol.1 and (grass from) Kite Demo.
My problem is, the trees cast moving shadows from their branches, but no shadows from their trunk on the grass foliage. Both branchs and trunk have a wind effect. Grass foliage has a wind effect too. The light is set as stationnary. I’ve tried changing the state (static/dynamic) of all the elements (branches, trunk, grass), as th lightmap resolution.
When I set the light as movable, shadows from the whole trees are cast on the grass, but pretty gross (black squares flicking), and all the shadows of my scene are shown as little squares with almost no shading at all - also transparency material don’t cast proper shadows. I changed the Dynamic Distance Shadow from 0 to 3000 to have an acceptable shadow for the branchs, but the rest of the shadows are creepy. Is there a way to set static shadows on static meshes and dynamic shadows on dynamic meshes ?
When I set the light as static, the branchs don’t cast any shadows and the trunk doesn’t cast shadow on the grass foliage. Although I’ve got an error when compiling, saying that LOD+1 meshes of the grass may be incorrect rendered.
Looks like there is a bug as I can’t post any pictures… I hope I described my problem enough.
Resuming : has someone any idea why the trunk doesn’t cast any shadow on the grass ?
Is there a way to make it cast any ? If dynamics shadows are the only solution, is there a way to let only the dynamic objects cast these dynamic shadows, and set the static objects to cast only static shadows ?
Thanks a lot.
Ok finally pictures work again.
pic1 : stationnary light, dynamic shadows disabled : no trunk shadow
pic2 : stationnary light, dynamic shadows enabled, bad rendering for static objects shadows.
If you set all of your foliage to dynamic as well as change your lighting to movable does the shadow on the trunk appear on the foliage?
For the lower quality shadows in pic two you can go to your world settings > Lightmass > Volume Light Sample Placement Scale and adjust the distance at which UE4 samples lighting. Set this to something like .5. This should allow for the calculation to happen at much smaller intervals and allow for the light to be seen through the gaps between the wooden planks.
as soon as I set my lighting to movable (or stationnary with dynamic shadows on), the trunk casts a shadow on the foliage (himself set as static either movable).
I’ve tried changing th Volume Light Sample Placement Scale to 5, but the dynamic shadows looks similar for the planks. Also the shadows of the glass are way too dark…
I am glad the first issue has been resolved and that changing from static lighting has resolved the issue of the shadow of the trunk casts on your grass.
The larger you set the scale the larger the space between calculations. For smaller spaces, and more accurate calculations set it to something like .5. This is also usually limited to dynamic objects as opposed to static objects. What you can also try is increasing the light map resolution of the surface that the shadow is being cast to. So, on that glass change it’s resolution to something like 1024.
Let me know if this works.
Hi, thanks for your answers.
Currently I’ve set the lightmap resolution of the glass objects to 512, and the shadow is completely dark. It looks like a creepy aliasing (as shown on the picture above).
However I found yesterday some informations about distance field shadow, but I am unable to make it work correctly.
Thanks to dynamic lighting and cascaded shadows, I’m able to get near dynamical shadows and far static shadows, but dynamical ones are not as precise as it should/could be.
I believe this documentation on Dynamic Scene Shadows will help with more information on how dynamic shadows work. When using movable lights and dynamic shadows, in conjunction with cascade shadow maps, dynamic shadows fill in the space after the cascade shadow maps end. So you could set up your cascade shadow maps to end at 1000 units of measurement away and then set the dynamic to pick up at 1000 units away. So when the cascade maps end the dynamic ones will begin.
The other thing to note is shadows on translucent objects such as glass. Glass is finicky. If you find a glass bowl or window, or something around the house that is glass and shine a light on it your shadows pass through the glass. Unlike opaque objects where the reflection of light bounces off more than it absorbs your shadows will not be solid. I will also link you to a thread where another user was experiencing much of the same issue.
Hi , thanks a lot again.
The second post you linked could be helpfull, i’ll check that.
I already viewed the first one and can’t figure exactly how cascaded shadow work… For now I activated them, and tried to chage some parameters but… are cascaded shadows similar to dynamic shadows in viewport ? I mean I don’t figure how it works : in my scene, when cascaded shadows end and “disappear”, nothing replace them unless I activate some static shadows. By now I guessed cascaded shadows ARE dynamic ones.
Thoses shadows will make me crazy…
Here is a little more information on shadows, specifically cascade shadows.
thanks for these explanations.
Here is a screenshot of what I see with my cascaded shadows.
I’ve activated the DistanceFieldShadows, Static and cascaded shadows. Light is set to stationnary.
I’ve set up the Cascaded shadow distance to 2000. When deactivating DistanceField Shadows, transition is ok. When activating them, there’s a “gap” between static and dynamic shadows, and I don’t figure why DistanceFieldShadows don’t work.
(Well I guess I can do without them, too).
However with this setup, only 1 cascade seems to be shown. When going far or near from the shadow, it’s the same (see pic).
Also is there a way to boost the quality of dynamic shadows ?
I’ve noticed that scaling down the Dynamic Shadow Distance gets better results from near, but it let static shadows nearer too.
And those damned planks shadows are so horrible !
I looked around and around, and found that my “shadow quality” setting was set to low… I set it to Epic and… voila.
However I’ve got another issue with cascaded shadows : some objects got a stripe effect :
it disappear when i check “Shadow Indirect Only”, but AO seems not to work with this option enabled.
Alright I’ve resolved this issue using the ShadowBias option and changing its value.
For now my scene looks much prettier… Still these glass mesh to adjust.
This is a link to documentation on light Translucency. This may help with your glass mesh.
thanks for this link. It seems that for now, translucent objects can’t cast dynamic shadows (unless they are part of cascade particle systems), or through some complex way.
I’ll try to use some other way to fix it.
Thanks a lot again !