- finally we add an event hook on mesh initialization in order to add diffuse color to


InitBumpMesh method :

- this method is called on mesh initialization

- we lookup the cube mesh and add a diffuse part to vertex declaration

- we fill a new vertex buffer with the old vertices + diffuse information

- we setup a TBN matrix for future processing

MoveBumpCube method :

- this method is called before each frame rendering

- we update the point light position to make it look realistic

- we compute the new light position

- we update vertices diffuse information (vertex buffer lock) by encoding the light

normal vector informations for hardware processing.

// texture 0 parameters

cube.RenderStates.Texture[0] = this.GetTexture("normalmap2.tga");

cube.RenderStates.TextureStates[0].ColorArg1 = BrumeTextureParams.ARG_TEXTURE;

cube.RenderStates.TextureStates[0].ColorArg2 = BrumeTextureParams.ARG_DIFFUSE;

cube.RenderStates.TextureStates[0].ColorOperation = BrumeTextureParams.OP_DOT_PRODUCT3;

// texture 1 parameters

cube.RenderStates.Texture[1] = this.GetTexture("multitex2.tga");

cube.RenderStates.TextureStates[1].ColorArg1 = BrumeTextureParams.ARG_TEXTURE;

cube.RenderStates.TextureStates[1].ColorArg2 = BrumeTextureParams.ARG_CURRENT;

cube.RenderStates.TextureStates[1].ColorOperation = BrumeTextureParams.OP_MODULATE;

This tutorial will show you how to adapt a simple Dot3 Bump mapping sample to Brume game engine.

Note that this tutorial is really simple because you can find a lot of information on Dot3 bump mapping technique on the Internet.

We just wanted to outline Brume's integration capabilities.

Here is a quick explanation of the steps achieved in the source code of this tutorial :

InitGame method :

- we define a point light that will virtually shadow a cube (look at the PointLight

tutorial for more detailed information)

- we create a cube that will support bump mapping (the cube will have a dynamic vertex

buffer because we need to add a diffuse color to the vertices)

- we setup texture's stages to achieve dot3 bump mapping :


Tutorial : Dot3 Bump mapping


Please click here to install flash player in order to see this website