Timeline for Directional light and finding relevant shadow casters
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 13, 2015 at 14:43 | comment | added | KaiserJohaan | I still don't quite get how the shadowcam frustrum is constructed. OK, you got the depth min/max for example.. how are they used in D3DXMatrixOrthoLH? | |
| May 13, 2015 at 1:26 | comment | added | v.oddou |
To answer the question of where is the far plane, it is like drawn on the schema, the farthest corner of the volume created by the 2 frustums. (far with respect to light pos). Now lastly, to construct the view matrix you can use some helper functions. D3DXMatrixOrthoLH for perspective; and D3DXMatrixLookAtLH for the view (which would set the rotation). These functions don't exist anymore in DX11 but the source code has been opened, so just google and copy :)
|
|
| May 13, 2015 at 1:15 | comment | added | v.oddou | you're right. you can optimize by taking a near plane that is only as near as necessary to get the first object in the semi-infinite reduced frustum :) Otherwise, scene box will still work, the resolution would be lost in the depth encoding indeed. There is a technique to mitigate this, which you probably know as "quantification". You can choose a custom "encoding" format of the depth. float, int32, linear, log... | |
| May 12, 2015 at 13:49 | comment | added | KaiserJohaan | Also if that is the same camera used when rendering the shadow map, wouldn't it possibly loose alot of resolution, if the near plane is scene aabb and there might alot of empty space between the near plane and the first object? | |
| May 12, 2015 at 13:38 | comment | added | KaiserJohaan | The shadow cam frustrum is an orthogonal projection matrix that is then rotated towards the light direction? If so how do you create such a matrix? And what would the shadow cam far plane be? | |
| May 12, 2015 at 8:59 | comment | added | v.oddou | @KaiserJohaan My guess is you are having fears of losing casters because you think of shrinking the volume longitudinally (in the direction of the light). This is something you are indeed not allowed to do, or you risk (and will), lose shadow casters. That is why the schema says "found from scene AABB". This tells you that the extreme global world limit is used, and it does not depend on view. Which is how you ensure all potential casters will be included. | |
| May 12, 2015 at 8:57 | comment | added | v.oddou | Your question is puzzling in the sense that you should naturally think that every existing solid casts shadow, end of story. therefore your rendering volume (==the shadow camera view matrix), should incorporate everything, which is on its coarsest, the whole scene. For quality (and performance as a bonus), it is best to shrink the volume like schematized above. You won't be missing casters FOR SURE because you shrink orthogonaly to the light direction. | |
| May 12, 2015 at 8:25 | comment | added | KaiserJohaan | I am using depth reduction through SDSM already, so I have the min/max depth. What I dont understand is, what do you use to test if the models are casting shadows or not? | |
| May 12, 2015 at 3:29 | history | edited | v.oddou | CC BY-SA 3.0 |
potential artefact discussion
|
| May 12, 2015 at 1:06 | history | answered | v.oddou | CC BY-SA 3.0 |