Terrain point light progress.

I’ve built a GGR (Geographical Grid Registration) component for the terrain, which will permit better draw call arrangement and in particular, better effect state management when drawing many point lights — which is a goal.

Since the terrain is arranged into equal sized chunks, this fits well into a GGR style space partitioning system, as one chunk can be equal to one GGR cell. This is simpler, and in my case faster, than using a quad tree, which was an approach I used in the past.

A view of the terrain from below, demonstrating that it is broken up into fixed size chunks.

A GGR grid is a very simple idea, which I took from Game Programming Gems 6, Chapter 1.4. I’m sure many, many programmers have implemented this concept, perhaps under a different name. Simply partition the space into a grid, register objects into whichever grid cells they occupy, and only test collision of one object against another if they occupy the same cells. Or, only light chunks of the terrain if a light occupies the cell corresponding to that terrain chunk.

Despite being one of the simpler types of space partitioning constructs, getting everything partitioned and grouping terrain chunks appropriately so that geometry instancing can be used is not a one day affair.

However, I do have point lights working:

Two point lights, lighting the terrain.


Here are the same lights with brightness greatly increased, and with rolling fog:

The blue haze is the rolling fog. Watching the fog move is more interesting than seeing this still capture.

This entry was posted in Coding, DBP2011, XNA and tagged , , , . Bookmark the permalink.

3 Responses to Terrain point light progress.

  1. Kamel says:

    Kris, your game is looking great.

  2. olhovsky says:

    Thanks! :)

  3. Caleb says:

    This looks awesome!

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>