BulletPhysicsBasic sample: no shadows on D3D11 and Metal
floooh opened this issue · 3 comments
at least in Metal, nothing gets rendered to the shadow map render target, probably easier to debug in visual studio...
Reasons (at least for D3D11) are the different D3D/OpenGL projection space conventions for D3D vs OpenGL, see here: http://www.slideshare.net/Mark_Kilgard/opengl-32-and-more/29-Direct3D_10_to_OpenGL_ulliHow, this usually goes unnoticed unless working in post-projection-space, I guess it's best to move all of Oryol to D3D10 conventions
Ok, fixed for D3D11, I had to fudge the light projection matrix to move clipspace Z into [0,1] and inverse the shadow map lookup in the shader when not running on GL. I wonder if it makes sense to provide helper functions to build 3D-API-agnostic projection matrices.
The D3D11 fixes also fix shadow rendering on Metal.