Shadowing part IV

Published October 22, 2007
Advertisement
Shadowing, part IV

In the previous shadows update I was explaining how I experimented LiSPSM and trapezoidal shadow maps. Both were a bit disapointing due to the quality change based on where the camera is looking at ( dual frustum case ).

I decided to do a step back and to go for parallel-split shadow maps (PSSM), which are very similar to my first implementation, cascaded shadow maps. In PSSM, the camera frustum is split in N depth sections, and each section gets it own shadow map. Here's a small diagram to explain it:



It offers twice the resolution compared to cascaded shadow maps; the reason is that the shadow frustums are tightly placed on the camera frustum, while in cascaded shadow maps, the frustums were *centered* on the camera origin. Performance is similar.

My version of PSSM is a bit simplified compared to the original algorithm: the distances at which to split the shadow frustums are constant and not determined dynamically. So far I haven't felt the need for it.

The good news is.. with this implementation, I'm finally getting close to the point where I'll call myself "satisfied". In particular, I can now get shadows on small ships, plus shadows on terrain at a long distance. I reached my target of 64 Km for the maximum distance at which shadows can be seen ( using 4 splits ). Pics of the shadowed terrain will come in a future update.

Of course, to get shadows at 64 Km, you'll need a monster PC. I currently "only" get 40 fps on my 8800 GTX, although there's still room for optimizations. Apparently I'm still heavily CPU limited. The bottleneck is, to do atmospheric scattering, shadowing etc.. I need to set for each object tons of shader constants ( plus for precision issues, rendering in camera space requires to compute many matrices per object ), and with the terrain LOD there can be up to a thousand objects in view. Since for shadow mapping the scene has to be rendered for each of the 4 splits into a depth texture, it's rendering many thousand objects per frame. Serious overhead.

Sovereign

WhiteSpade01 sent an update of the Sovereign ( a 650m long ship ), textured with UV tiling and SpAce's texture pack. With the new shadows, I couldn't resist taking a few screenshots. The shader is still basic and only features diffuse, bump, specular, emission and shadows. It lacks the custom/dirt maps as well as the anisotropic lighting ( giving the metallic look of ASEToBin ). No HDRI/bloom yet.












0 likes 5 comments

Comments

LachlanL
Looks awesome. Keep up the good work!
October 22, 2007 06:23 PM
OrangyTang
I am constantly in awe at the performance you manage to achieve - how on earth do you do it? I seem to end up bumping into fillrate limits and I'm just doing 2d stuff @ 800x600, yet you seem to be rendering lots of shadowmaps at big resolutions (and the rest of the crazyness you've got going on) and still hit slick framerates.

Btw, I thought you were avoiding shadowing methods like cascading shadow maps due to the performance impact of having to re-render the shadow maps whenever the camera changed position. Have you found a way around that or is it just less of an issue now?
October 23, 2007 07:28 AM
Ysaneya
Quote:Original post by OrangyTang
I am constantly in awe at the performance you manage to achieve - how on earth do you do it? I seem to end up bumping into fillrate limits and I'm just doing 2d stuff @ 800x600, yet you seem to be rendering lots of shadowmaps at big resolutions (and the rest of the crazyness you've got going on) and still hit slick framerates.


I don't know, 40 fps on a Q6600 with a 8800 GTX is not what I call "slick framerates". I'm far from being happy with those performance numbers, especially as they'll continue to go down with more effects (and gameplay/logic code).

Quote:Original post by OrangyTang
Btw, I thought you were avoiding shadowing methods like cascading shadow maps due to the performance impact of having to re-render the shadow maps whenever the camera changed position. Have you found a way around that or is it just less of an issue now?


It's not "less of an issue" :) I only realized that there was no way around it, except in very specific scenarios. So I'm still updating each shadow map every frame.

The problem is, unlike in many games, the sun is constantly moving in the sky. Because the planet on which you're landed rotates; because the planet orbits the sun; or because ships can be moving very fast (many kilometers per second).
October 23, 2007 09:30 AM
pc123
It's getting increasingly difficult not having to pick up my jaw in awe everytime you post some pictures...
I got a question, and I'm sorry if this topic has been focused elsewhere in the forums:
regarding collisions, how "fine-grained" will the bounding volumes be?
I suppose you've got several of these, increasingly complex, specially for those big cruisers, and it came to my mind that I could easily picture some seriously cool dogfights around those cruisers, very much like the attack to the Death Star in the Return of the Jedi.
Looking forward to what's coming next! Regs.
October 23, 2007 02:22 PM
swiftcoder
Quote:Original post by pc123
I got a question, and I'm sorry if this topic has been focused elsewhere in the forums:
regarding collisions, how "fine-grained" will the bounding volumes be?
I suppose you've got several of these, increasingly complex, specially for those big cruisers, and it came to my mind that I could easily picture some seriously cool dogfights around those cruisers, very much like the attack to the Death Star in the Return of the Jedi.


I managed to play the combat prototype a few times, and it is better even than you were thinking - you can fly *into* the hangars on the capital ships.
November 10, 2007 12:19 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement