Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make a 2D isometric RPG and I kind of hit a wall when it comes to lighting. I was thinking of using shaders, if I manage to understand them.The problem I am anticipating is the presence of light sources outside the screen.In order to calculate shadows and so on I'd still need to have those objects rendered even if they're offscreen or else light would pop in and out if I move the view around the map. I was thinking of drawing the entire level, not just what is seen, but that would mean drawing at negative and outside the view coordinates.Does that work or I should seek a better, more efficient alternative?

share|improve this question

If you just want to know if drawing outside of the bounds is possible, yes it is. The GPU will cull what is not visible and keep what is onscreen. Really, you should be using a transform matrix on your spriteBatch calls though; draw everything via its world position and then transform it to view cordinates using a matrix transform.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.