Hi, I’m setting up a scene for a simple game I’m making. Loaded the basic terrain mesh and a simple character successfully. I’m using no textures, I’m planning to use low poly meshes with flat shaded materials. It shouldn’t be a problem casting some simple shadows, I guess… but there ain’t any. The basic and advanced samples in samples/shadows work fine.
Here, the code: pastebin.com/BkBh1iuT
It would be helpful if you attached models/terrain.egg so we can run your code example.
I didn’t use shadows for directional lights but don’t you need to give the directional light a meaningful position?
The light itself may not need a position, but the camera that renders the depth map of the scene needs a point in space to render from.
If your terrain is above ‘zero level’ then the shadow camera will not see it, because it’s located at point (0,0,0), looking somewhat down (hpr=(10, -60, 10)) and has a near plane of 10.
Viewing the frustrum (sun.showFrustum()) is a good way to debug and fix shadows …but not always
Thank you very much. Quite usefull. This is the github of the project github.com/fnadalt/run4life