why DirectionalLight is not casting shadow?

元气小坏坏 提交于 2020-01-06 05:34:35

问题


Code:

Color color = new Color(1f,1f,1f,0.9f);
DirectionalLight directionalLight = new DirectionalLight(rayHandler,200,color,-90f);
directionalLight.setSoftnessLength(0);

Result:

When light falls directly from above, why it is not casting shadows from boxes?


回答1:


This could be caused by a few things. Some things to check:

  1. Check if your RayHandler is set to blur. Blurring with small objects can hide shadows.
  2. Check the Shadows are enabled in the ray handler.
  3. Check the ambient light is off or lower than the directional light. If ambient light is too high it may hide shadows.
  4. Check your objects are larger than 0.1f as this is the smallest distance box2dlights works with
  5. Check the light is not set to x-ray
  6. check softness length. lights with high softness will have their light bleed through small objects.


来源:https://stackoverflow.com/questions/51858339/why-directionallight-is-not-casting-shadow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!