Jump to content


Shadow techniques


4 replies to this topic

#1 Stainless

    Member

  • Members
  • PipPipPipPip
  • 577 posts
  • LocationSouthampton

Posted Today, 08:57 AM

I'm struggling at the moment with getting shadows working on OpenGLES 2

At the moment I'm using a depth buffer based technique, but my scene is so big that the shadows end up big and clumpy.

I'm thinking about stencil shadows, but I'm not sure it will work with a huge scene.

Any ideas people?

I started this project two weeks ago and have two weeks left, so I'm very tight for time and can't afford another failed attempt.

#2 Vilem Otte

    Valued Member

  • Members
  • PipPipPipPip
  • 345 posts

Posted Today, 03:01 PM

How big is the scene? What is target platform?

I implemented Z-fail shadow volumes through geometry shader some months ago (and had a thread about it here), and it performed very well for complex scenes on Radeon 6770 (also on GTX 580 - but what doesnt perform well on this category of GPU), and for moderate scenes even on notebook graphics (Mobility Radeon 5470). Though if youre targeting mobile devices, I doubt they will perform that good.

There are also other possibilities of computing shadows. Ray tracing on GPU (it IS realtime, but most probably will need a bit more work than 2 weeks)? Plannar shadows (assuming you dont have too much geometry you cast shadows on)? Shadow blobs + light maps (works well, light maps do awesome work in static scenes)? Light maps + shadow map for N dynamic actors/objects in specific range (you can create shadow map atlas pretty well, smaller objects get smaller shadow map, larger objects get larger shadow map)? etc.

If you describe a bit more details, I might give you few suggestions on how to implement it quickly, because 2 weeks arent that much time.
My blog about game development (and not just game development) - http://gameprogramme...y.blogspot.com/

If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D

#3 TheNut

    Senior Member

  • Moderators
  • 1696 posts
  • LocationThornhill, ON

Posted Today, 03:15 PM

Stencil shadows will give you pixel accurate resolution, but it's not without its problems. z-near is faster than z-fail and would be more suitable for mobile devices, but you have to deal with in-shadow problems. Your shadows will also be tact sharp, something shadow maps can alleviate almost for free. I would suggest investigating cascaded shadow maps if you have some spare cycles to support it. An alternate solution would be to limit your shadow casters so that you can focus your shadow map only on the most important area in the scene rather than everything. Not that awesome, but I've played a few games that do that. If however you're not bluring your shadow maps, then switching over to stencil shadows might not be all that bad since both will look the same.
http://www.nutty.ca - Being a nut has its advantages.

#4 Albertone

    New Member

  • Members
  • PipPip
  • 28 posts

Posted Today, 03:37 PM

What about Dual-Paraboloid Shadow Mapping and its improvement, Improved Paraboloid Mapping?
http://hpcg.purdue.e...Vanek11ISVC.pdf

#5 Vilem Otte

    Valued Member

  • Members
  • PipPipPipPip
  • 345 posts

Posted Today, 03:58 PM

#TheNut - first a note, i think you mis-written z-near for z-pass :)

Blurring the shadow volumes is another thing. You can perform accurate penumbra shadows by penumbra wedges (this comes at high cost though), or just simple screen-space bilateral blur - both are although suited for PCs rather than mobile devices.
My blog about game development (and not just game development) - http://gameprogramme...y.blogspot.com/

If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users