2d light shadows

KiroNeem
Unregistered
 
Post: #1
So I have been reading over a few articles that cover the subject of creating 2d lights and shadows for a game. Although before I proceed with the task of putting this into my game, I would really like to find out what kind of speed this process will have. I'm actually more concerned about the gathering and calculation of points and angles then anythings else. Has anyone else done this for a full-featured game, also what kind of speed did you get? Also if so what troubles did you run into?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
If you have efficient collision detection in place you can quickly cull out vertices. And you really aren't casting that many shadows anyway in 2D. (compared to a 3D scene) The biggest hit is from the fillrate usage.

I don't have any 'real' numbers, but I currently have Ruby doing the math work and calling openGL. For a few hundred line segments at 640x480 my G5 has never had trouble making 60fps. (I've never uncapped the framerate to try a speed test.) Whatever that's worth. Implemented in C, the math would probably be 50x faster, so the number of shadows cast clearly aren't much of an issue.

Gish uses 2D shadows and seems to run fairly well. (The physics in that game are the real bottleneck though.) How well does that run on your machine? Does increasing the resolution seem to have much of a hit on performance?
Quote this message in a reply
KiroNeem
Unregistered
 
Post: #3
I have never actually ran Gish on my computer, although I have heard and read about it. I will most likely download Gish tonight. Anyway I have lights up at the moment, seems to be working so far, just need to create the algorithums to cull out the shadows. I guess the only reason I am worried about the speed is because I have never really looked into whats goes into it. We will see though, and I already have some testing project templates so I will report what my speed tests are as well.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Window drop shadows NelsonMandella 9 5,190 Mar 21, 2010 02:34 PM
Last Post: NelsonMandella
  Transforming directional light to eye space in GLSL Coyote 4 6,392 Dec 8, 2009 03:16 PM
Last Post: Coyote
  Making 2D Stencil Shadows Soft metacollin 16 14,510 Jul 22, 2009 01:59 PM
Last Post: NelsonMandella
  OpenGL Blending for 2D Light Effects metacollin 10 12,674 Jun 6, 2009 12:51 AM
Last Post: NelsonMandella
  light attenuation NelsonMandella 2 3,606 Jun 4, 2009 03:28 PM
Last Post: reubert