Sunday, April 29, 2007

Galactic Engine 2 Materials with BSP

For the past few weeks I have been working on the version of BSP map class that would be added to the GE2. Some things are already working but some require the physical engine.

Currently it is mostly compatible with Quake 3 shader system it allows to animate texture coordinates , colors , vertex deformation. One of the latest additions to the engine itself was the AnimatedTexture. This is the special type of texture that points to multiple textures and selects only one of them depending on the frequency of animation and the elapsed time. This is used to animate the torches of the map.

Here is the video:



Direct Link

Monday, April 16, 2007

Custom texture added

The latest addition to the GE2 is a new Custom Texture.

The Custom Texture is a special class that is used to programatically generate texture for other engine/game components to use. For example this can be use to generate default , white or lightmap textures.

The texture itself is already using the base texture class STexture. When user creates the texture, He just needs to pass RGBA data with it for each pixel.

Further on the texture is registered with the TextureManager and other parts of the engine can point to it if required. 

This is the code for example that is used to create the "white" texture which is used to render objects that are missing the lightmap:


//the white texture is stored here
CustomTexture _white;

//data
unsigned char whitepixel[4] ;

whitepixel[0] = 0xff;
whitepixel[1] = 0xff;
whitepixel[2] = 0xff;
whitepixel[3] = 0xff;

_white.Create( "white" , (unsigned char*)&whitepixel , 1 , 1 );