Coderebel

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

107 Neutral

About Coderebel

  • Rank
    Newbie
  1. Shadow map surface aspect ratio ?

    I am still a bit confused   I fully understand that sm texel to pixel relationship is never 1:1, but still, if sm ratio differs from screen size ratio, sm texel would be scaled more in one direction than other when projecting to screen, producing less acurate shadows. Or am I wrong?? I did a test of both versions, and some shadow details look more correct to me when sm ratio matches screen ratio.   In terms of performance and compatibility: suppose the quality of final result is about the same if my sm size is 2048x2048 and 2048x1500 (I am making up the numbers). Which one would be better to use(taking into account my gaussian blur pass on sm)? I am targeting gpu's that support at least SM3.   Thanks to all of you!
  2. Shadow map surface aspect ratio ?

    Hey, thanks for your answer.   So if i get it right: Let's say my screen res is 1024x768. If I create a sm of size 1024x768, there would be a minor accuracy gain, and a minor performance gain on gpus that support non power of two sizes and no performance gain on gpus that dont support non power of 2 sizes over a 1024x1024 sm ?   The size of sm is important for me to be as small as possible not only because the memory and bandwidth, but also because I am doing a 5x5 gaussian blur prefilter on shadow map, and since I am fragment shader bound, that does affect final performance.   Thanx!
  3. 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!