Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

Fast test/heuristic for viewpoint in shadow volume

This topic is 2874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


so I am toying with dynamic shadowing techniques in a minecraft-style (inifiniminer-style?) situation. I abandoned shadow maps because the special geometry of the scene seems to make the glitches of shadow mapping extra obvious. Now I implemented a shadow volume technique that works so far. But there is still the issue of handling the case when the viewpoint is inside one of the shadow volumes. To handle this, I implemented the preloading technique (the not patented one), which sadly has a prohibitively high fill rate requirement since the sheer amount of geometry and the structure of a block landscape can lead to massive "shadow volume stacking". Pretty much the same would happen with z-fail by the way. Now luckily if no part of the visible view plane is inside the shadow volumes, a z-pass technique is sufficient and has way nicer requirements on fill rate and also cuts the amount of shadow geometry about in half in my case (no capping of shadow volumes). While i do have something in mind that will help reduce the fill in the preload pass (only render shadow volumes that point "towards" the camera) I'm still trying to find an efficient way to determine whether I even need it in the particular frame. So I need figure out if part of the near plane of the frustum is inside the shadow volume.

Is there an efficient way to do that?

I think checking that on the cpu the brute force way is out of the question, for one because the shadow volumes are mostly generated on the gpu (I generate the "shadow base geometry" on the cpu and then extrude that on the gpu as required), but mostly because of the sheer amount of geometry (my test case is only a 128x128x64 "world" which already gives me like 200'000 triangles of shadow geometry). I suppose one way would be to look up the lights position in the depth buffer to decide whether it is visible from the camera. But that would pretty much mean I'd have to prerender a depth buffer just to check that (since the preload pass has to come before the world geometry gets rendered).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!