Skip to main content
gamedev.net
🔒 Locked

Partially update shadow map

Started by FeverGames 3 replies 1.1k views
Original Post
FeverGames
FeverGames
Theres a topic by Yann L in the OpenGL section that is about shadow mapping. In his last post (on page 2) he says (link to topic)
Quote:
The system also checks, if a shadowmap is already available in the cache, if so at what resolution, and if it needs partial of full updating. It then inserts the lightsource into the cache. The thing is repeated for all visible sources. Note, that at this point, nothing is rendered yet.
I understand the idea of sorting lights and caching shadow maps for reusing when geometry doesn't change in the bounding area of the light, or when a light would be marked as static or whatever. But what I fail to understand, is that he talks about partial update of shadow maps. how does one partially update a shadow map? That would only be possible if: - light is not moving - only static geometry is rendered into the _mother_ shadow map - dynamic geometry is rendered to the shadow map with blending is this correct, or am I missing something that makes other situations good for partially updating shadow maps? btw. i know it is an OpenGL topic, but I think it is about a more generic subject. Kind regards
Hodgman
Hodgman
Well back when GPUs were just blitting chips, all objects within the partial-update region would be re-rendered.
So, assuming a static light source, you would determine a frustum for the "dirty" region of the texture in order to find the objects the need to be re-rendered. Then clear this area of the map and render these objects again using a scissor test.
zedz
zedz
I dont think hes doing that

I think hes doing similar to what I do

if ( light static && !num_moving_meshes && last SM update.num_meshes_in_frustum == thisSM update.num_meshes_in_frustum )

return

else update SM
FeverGames
FeverGames
so yeah, only in special cases where nothing has moved within the frustum of the shadow map that was already rendered a map can be updated. If something is removed from the frustum the clip region could be used to update the part where an object should be removed. If nothing moved nothing added and light == static then use previous depth map

is this about right?
zedz
zedz
Quote:
If something is removed from the frustum the clip region could be used to update the part where an object should be removed.

I wouldnt do this as it sounds very error prone + most likely wont see any major speed benifits

Quote:
If nothing moved nothing added and light == static then use previous depth map
think of a depthmap that a shaowcaster has moved out of, this critera will fail to pick it up.

use the
if (prev number of meshes in frustum != current num meshes in frustum) render
test

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.