问题
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:
- Check if your RayHandler is set to blur. Blurring with small objects can hide shadows.
- Check the Shadows are enabled in the ray handler.
- Check the ambient light is off or lower than the directional light. If ambient light is too high it may hide shadows.
- Check your objects are larger than 0.1f as this is the smallest distance box2dlights works with
- Check the light is not set to x-ray
- 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