away3d/away3d-core-fp11

DirectionalShadowMapper camera problems

Opened this issue · 0 comments

I'm trying to add shadows to my custom material. Sorry, but it's a real pain. No tutorials, no comments in the code, nothing. I need simplest shadows - directional light is good for me. But inside DirectionalShadowMapper there's a camera with strange FreeMatrixLens. The result - my shadow map always contain tiny projections if I use geometry with compact vertex positions (vector length up to 2). For example, I have an objects that fills almost all screen, but it's shadow depth projection fills 1% in shadow map. And because of that I have very pixelated shadow. I could't find parameters in DirectionalShadowMapper that affects depth projection. There's black magic in updateProjectionFromFrustumCorners() method, but it's beyond my understanding possibilities. If I scale my model - the quality increases (because projection fills more space in shadow map). Why don't you use OrthographicLens?