Jump to content
  • Advertisement
Sign in to follow this  
echeese

2D shadowing - need help

This topic is 3690 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

I need a bit of help with a problem I've been having. Basically, I'm working on a tile based game, with point lights all over the place. Currently, I am rendering the light, and then putting shadow polygons extending from the edges of the wall tiles. Then the composited shape is multiplied onto the game map, every frame. To help speed it up, I'm using a quadtree to only render lights that are onscreen, and the grid to only render shadows that are both onscreen and within the light radius. I'm guessing there's probably a better way than casting a shadow shape for each tile. Do you have any suggestions for speedup? EDIT: This is only for the dynamic lights, btw.

Share this post


Link to post
Share on other sites
Advertisement
If Your shadow polygons for one light are overlaping, then You could use the z-buffer to save fillrate and prevent shadows from overdarkening. Just clear the z-buffer before rendering the light. Then render shadow polygons with depth test and write enabled.

Share this post


Link to post
Share on other sites
Well, I'm trying to make the actual calculations faster, and i'm doing this this in software (for a number of reasons)

Flaws I see with my current approach are that walls that are already in shadow are calculated anyways.

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!