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.

Friday, May 7, 2010

New GUI


I've been spending the past few weeks working on a custom GUI in DirectX. I modeled the GUI after MFC, making heavy use of inheritance. Gotta love c++. I went with this approach because it gives me (and potentially other developers) the freedom to derive modified versions of existing controls, along with creating new ones down the road.

The first week was pretty much spent getting the basic framework put together and getting a basic window drawn to the screen. Then I moved on to adding buttons, checkbox, edit box, and slider controls. The text box is capable of being assigned a value, but I haven't gotten around to allowing the user to enter values into it.

The next big tasks are to complete the edit box control and move on to list boxes.