VSM, the expensive shader

Started by
24 comments, last by AndyTX 15 years, 6 months ago
Quote:Original post by wolf
If you have several different shadow sources you can just alpha blend them in there.

Uhh, I assume you're accumulating illumination (a la deferred lighting) here rather than than munging up a single shadow "mask" over several independent illumination sources?
Advertisement
I read it as "accumulating occlusion" in screenspace. So you could do a multiply blend of a really detailed character shadow over top of a scene's less detailed shadows. Then you could use this screenspace shadow mask for the occlusion factor during forward (or deferred) rendering.

Brian Richardson
http://bzztbomb.com/noise/
Brian Richardsonhttp://bzztbomb.com/noise/
Quote:Original post by AndyTX
Quote:Original post by wolf
If you have several different shadow sources you can just alpha blend them in there.

Uhh, I assume you're accumulating illumination (a la deferred lighting) here rather than than munging up a single shadow "mask" over several independent illumination sources?


I think he's talking about doing this for only one light source.

Quote:Original post by MJP
I think he's talking about doing this for only one light source.

I would hope so, but one light source <=> one "shadow source" in my books :)
So. I have 4*6 plus one shadow maps.
And I have to collect results in screen space in 7 fourchanelled texture (indeed, that's at the worst situation).
Is it parctical using 32 (25 with smaller resolution and 7 with screen resolution) for 4 pointlights and a sun?
Asking it in another way, does Crysis take so much video ram?
Or does Crytec create an another way that let them use so much shadow maps with lesser vram?
No it's not at all necessary for so many textures. First of all, even if a point light requires 6 textures for a full cubemap, you still only need one channel to store the shadow occlusion term. So for 4 point lights + a directional light you need 5 channels, which is only 2 textures.

Also if memory is tight, you can reuse your cubemap for each point light. So you'd render all 6 sides for a light, then render the occlusion in one channel, then render the shadow maps for another light...rinse, wash, repeat.
So, your way is:
draw shadow map -> collector
overdraw shadow map -> collector
and so on...

Or did i misunderstand?
Yup that's basically it. It'll probably be slower than rendering your shadow maps up front (since you'll have more state changes), but it would use a whole lot less memory.
Then what way would be the best solution?
(In the correct memory-usage ratio)
Quote:Original post by AmidaBucu
Then what way would be the best solution?


There is never a "best" solution that perfectly fits all problems. What works best might depend on your scene, the size of your shadowmaps, the backbuffer resolution, or the hardware the game is running on.

This topic is closed to new replies.

Advertisement