x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Dynamic shadows on static meshes ?

Hi all,

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.

Product Version: UE 4.9
Tags:
more ▼

asked Nov 19 '15 at 04:18 PM in Rendering

avatar image

Teapot Creation
160 21 32 46

avatar image Teapot Creation Nov 20 '15 at 08:21 AM

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.

pic1 pic2

clipboard01.jpg (200.0 kB)
clipboard02.jpg (115.1 kB)
avatar image Logan Bailey ♦♦ STAFF Nov 23 '15 at 06:12 PM

Hello TeapotCreation,

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.

Logan

avatar image Teapot Creation Nov 24 '15 at 09:55 AM

Hi Logan, 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...

avatar image Logan Bailey ♦♦ STAFF Nov 24 '15 at 02:43 PM

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.

Logan

avatar image Teapot Creation Nov 25 '15 at 10:22 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/DynamicSceneShadows/index.html

https://answers.unrealengine.com/questions/164985/glass-transluency-shadow-vs-specularity.html

Logan

more ▼

answered Nov 25 '15 at 03:01 PM

avatar image Teapot Creation Nov 25 '15 at 03:28 PM

Hi Logan, 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...

avatar image Logan Bailey ♦♦ STAFF Nov 25 '15 at 06:27 PM

Here is a little more information on shadows, specifically cascade shadows.

alt text

alt text

alt text

avatar image Teapot Creation Nov 26 '15 at 09:28 AM

Hi, thanks for these explanations.

Here is a screenshot of what I see with my cascaded shadows. alt text

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).alt textalt text 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 !

clipboard01.jpg (262.1 kB)
shadows_far.jpg (18.7 kB)
shadows_near.jpg (25.7 kB)
avatar image Teapot Creation Nov 27 '15 at 03:06 PM

Well well... 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 : alt text

it disappear when i check "Shadow Indirect Only", but AO seems not to work with this option enabled.

clipboard01.png (1.3 MB)
avatar image Teapot Creation Nov 30 '15 at 02:17 PM

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.

avatar image Logan Bailey ♦♦ STAFF Nov 30 '15 at 02:30 PM

This is a link to documentation on light Translucency. This may help with your glass mesh.

https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/LitTranslucency/index.html

Logan

avatar image Teapot Creation Dec 01 '15 at 01:09 PM

Hi Logan,

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 !

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question