RE: [Algorithms] lights/shadows rendering architecture
Brought to you by:
vexxed72
|
From: Tom F. <tom...@ee...> - 2005-08-18 20:28:17
|
> From: Marc Fascia >=20 > 3) 1 pass =3D n lights, shadow mapping done in scrreen space at the = end > This is a variation of 2). After the rendereing is done, i=20 > render a shadow > map for a light and then apply it in screen space. I repeat=20 > that for all > lights. This also requires n+1 render passes. > + limit the total ram needed to store shadow maps as they are > applied one after another That means you'll have a pipeline doing: -Render shadowbuffer A *stall* -Use shadowbuffer A -Render shadowbuffer B *stall* -Use shadowbuffer B -Render shadowbuffer C *stall* -Use shadowbuffer C etc. As you can see, you're going to be stalling the pipeline a lot there. = Also be aware that some cards will lose hierarchical/easy-Z testing if you = switch away and back from a rendertarget (the framebuffer in this case) without doing a clear in between, so passes B and C may be much slower. Even = when they do work, they tend to have to save/restore a bunch of state. In general, the memory savings are not worth the effort on PCs. Now = _maybe_ on a console with a specific arcitecture they would be, but I'd start = with assuming you can't, and then maybe you can optimise it later. > 4) deffered rendering : ... > - does it scales easily to translucent materials ? No, terribly. I really wouldn't even consider deferred rendering unless you're going for a fairly constrained world with a very particular look = - it's pretty hard. Ignacio mentioned the joys of only shading each pixel once, and they're appealing, but you can get 90% of that benefit by = doing the ambient+unshadowed lighting pass first for the whole scene, and then doing lighting passes. That way you get nice fast Z-rejects. I would start with method #1, and maybe later you can hand-compile your = ten most popular shaders to use method #2 (if you have enough instruction slots). My own take on doing shadowbuffering is in my GDC 2004 "Practical = Shadows" notes here. Not directly related to this question, but might be useful: http://www.eelpi.gotdns.org/papers/papers.html TomF. |