   2d soft shadows
  I'm trying to create a shadow effect when moving from one room to another. http://i642.photobucket.com/albums/uu150/ari556655/shadows.pngMy current method works fine but I'm unable to figure out how to shade the penumbra to achieve a soft-shadowed effect. Now I am aware that there are ways of achieving this using shaders and(or) a stencil buffer(and yes I have read the article on gamedev about the most prominent of those methods) but for a number of reasons I am consciously trying to avoid that route.Background: The game is isometric(fully 2d) and is opengl based with dynamic per-vertex lighting. Depending on the circumstance, I will often subdivide ground tiles into a bunch of smaller quads to achieve smooth lighting and a smoother, less jagged, shadow edge.So far the effect is just what I want, minus the jagged shadow edge. How can I shade the penumbra without resorting to stencil tests, shaders, and all that kind of stuff?[Edited by - ari556655 on May 15, 2009 12:45:56 AM]
  I haven't ever heard of soft shadows without using shaders to be honest.  However, you may want to do something on the CPU side for filtering the shadows.  The idea would be to either read back your shadow buffer or do the shadow generation on the CPU, then blur and upload it back to the texture you are using.It wouldn't be too hard to do, and shouldn't cause a big performance hit since you will only have a few objects to shadow at any given point.  What do you think?   ;  Could I trouble you to be a bit more specific because I'm not quite sure what you mean(I'm still a very novice programmer).Also, I don't use any kind of shadow buffer, I just perform a LOS test on  tiles(subdivided into smaller quads) in rooms adjacent to the player and if it fails I draw the tile without lighting, if it passes I light it.   ;Quote:Original post by ari556655Could I trouble you to be a bit more specific because I'm not quite sure what you mean(I'm still a very novice programmer).Also, I don't use any kind of shadow buffer, I just perform a LOS test on  tiles(subdivided into smaller quads) in rooms adjacent to the player and if it fails I draw the tile without lighting, if it passes I light it.So are you using the same technique with the character shadows?  If so, you would just average the sub-divided tiles around each other.  Depending on how fancy you need it to be, you could use something like a Gaussian kernel to do a weighted filtering of the shadow results.In more detailed terms, you could calculate all of the line of sight tests for all of the smaller tiles.  Then for each tile, take the average of it and its neighbors to perform a blending transition between shadowed and not shadowed.BTW - that's pretty cool that you are doing CPU side shadow calculations.  Most people use shadow mapping nowadays, and you are actually using a form of ray tracing.  That's pretty cool!;Quote:So are you using the same technique with the character shadows?No, the character shadows are mapped. In fact, I didn't even intend for them to be present in the previous screenshot- I simply forgot to remove them. Here are a couple more screens with a single light source, 4 objects,  and no shadow maps.http://i642.photobucket.com/albums/uu150/ari556655/shadow1.pnghttp://i642.photobucket.com/albums/uu150/ari556655/shadow2.pngQuote:Original post by Jason ZIn more detailed terms, you could calculate all of the line of sight tests for all of the smaller tiles.  Then for each tile, take the average of it and its neighbors to perform a blending transition between shadowed and not shadowed.I do currently calculate line of sight for each smaller subdivided tile. And while I understand your idea of averaging each tile's shading(or light intensity) value with each of it's neighbor's, I'm having difficulty in understanding just how to keep track of and store these values themselves. Quote:BTW - that's pretty cool that you are doing CPU side shadow calculations.  Most people use shadow mapping nowadays, and you are actually using a form of ray tracing.  That's pretty cool!Thanks, I started fooling around with it the other night and I just thought the shadows looked so cool when moving around the room game(especially for a 2d dungeon crawler). When I got the above scene running at 30 fps on my 2.33ghz core 2 duo, I thought that perhaps with some serious optimization, this could be fast enough to use in my engine.   ;Quote:Original post by Jason ZI haven't ever heard of soft shadows without using shaders to be honest.  ?It's possible in old techniques without self-shadowing(one shadowmap per light per object).You can render such shadowmap and smooth it using StretchRect ping-pong in realtime.   