Original Post
I'm currently implementing a cache system for shadow maps, massive models and per-pixel lighting. I vaguely remember something you wrote about shadow maps in your engine some month (years?) ago, and after digging into the archives, i found this: Yann about shadow mapping. And indeed it's extremely similar to what i'm currently doing. Your last post was left unanswered, so if you don't mind, here are a few questions for you: 1. In your cathedral screenshot, which amount of video memory was allocated to the shadow maps cache ? To get a good quality i found i need _at least_ 50 Mb of shadow maps. In my engine i have a scale factor for shadow maps which i can adjust to lower the memory requirements, but then the quality of my shadow maps starts to decrease, and becomes noticeable. 50 Mb of shadow maps is quite a lot, and you can't compress them. 2. Again in your cathedral screen, how many lights are visible on screen ? You mention 39 lights for the whole cathedral, but they're not all visible at once. Also, how many lights do you have in each category (how many point lights, how many spot lights, and how many directionnal lights ?). Do you have some lights not casting shadows ? What are the typical resolutions for your shadow maps in that scene ? 3. How are you handling the soft edges ? I am antialiasing my spot/directionnal shadows from 4 to 8 times, but i get a speed hit that is quite high. It's even worse for omni lights since i must access a cube map many times. Basically, for a single scene, i am shader limited to 50 fps on a Radeon 9700 pro with a single light (filling the whole screen). I am guessing that's not the way you are antialiasing your shadows since you get 60 fps on a GF4. Are you rendering your shadows to a texture, blurring it, and modulating it in your lighting equation ? 4. Speaking of the lighting equation.. which per-pixel effects did you handle in this cathedral screenshot ? It only looks like dot3 bump mapping - i cannot see any specular/gloss contribution - but i might be wrong ? 5. I am going to implement LOD in the next months, but i am afraid to see some geometry popping in the shadows, as the shadow maps are cached, and not updated every frame.. did you have that problem ? 6. How do you quickly render your shadow maps to a texture ? I am using a Radeon 9700 and i must admit that even if rendering a 1024x1024 shadow map is quite fast, i hit a bottleneck to upload it to the graphics card. I'm not using the traditionnal render-to-texture approach, since given the amount of lights, it would require one PBuffer per light. Instead i'm using a constant amount of PBuffers, i generate my shadow map in the oldest one, and i copy its contents it to the graphics card by using glCopyTexSubImage2D. How were you doing it ? That's a few questions but i hope you do have the time to answer them :) Thanks, Y.



