Wednesday, May 12, 2010

New Graphics Engine


The GUI is coming along nicely, but I'm taking a break and moving back into some graphics stuff. It will be easier to test additions to the GUI later on when I have more uses for it.

Lately, I've been working on a new graphics engine. The central idea of the new engine is that everything is customizable and modular. It manages all of the resources, buffers, shaders, etc. Various entities in the game that need to be rendered check in with the graphics engine upon initialization and give it the details on how/when they need to be rendered.

So far I've got the terrain loading from a height map, per-vertex fog, and a fairly convincing skydome. The sky colors are actually sampled from a 2D texture. The sampled U value is proportional to the angle from the horizon (phi), and the V value is determined by the time of day. This 2D texture is calculated using the Preetham paper, A Practical Analytic Model for Daylight. Each column of pixels in the texture is a gradient of colors at a particular time of day. Tasks that remain for the skydome include clouds, stars, sun/moon sprites, and lens flare.

No comments:

Post a Comment