Hey there guys!
I've been fooling around with shadow mapping for quite some time, I've experimented a lot, implemented pcf, vsm, esm filtering, and got it working well now. However, one question still haunts me, and I havent been able to find a satisfying answer or discussion about it. Aspect ratio of the shadow map rendering surface.
I am talking about a simple scenario, one directional light, one shadow map for entire scene. I construct my orthogonal lightview projection matrix by creating a box to fit around my viewing frustum (as I believe is the standard approach). So obviously, the aspect ratio of the lightview projection matrix is the same as the one of my view matrix, which depends on screen resolution and is never 1:1 (16:9...etc...). So I believe, the shadows are more accurate if the aspect ratio of my offscreen shadowmap rendering surface would be like that, the same as screen aspect ratio ??? Please correct me if I am wrong??
Nonetheless, in vast majority of the samples and tutorials, the shadowmap size used is fixed, 1024x1024 for example, and not dependent on the frame buffer resolution at all. The interesting thing is that not in a single resource (and I checked MANY) there was not even a word about that, either used fixed square size, or the size of frame buffer. Furthermore, I checked how it is with some AAA games, and realised they were all using fixed square shadow map sizes, with quality settings either size of 1024^, 2048^ or 4096^, which seem like giant leaps to me... Would it not make more sense to have the size of shadow map for normal quality for example the same as frame buffer resolution, the lower quiality size*0.5 and higher quality size*1.5 ???
Are such sizes of shadow maps used only to be compatible with older hardware that doesnt support arbitrary rendering surface sizes? Or am I missing something really obvious here ??
I hope anyone can shead some light on this matter for me!!!
Thanks a lot!