Bump Mapping

Bump mapping has been recently introduced in X3D V2.
X3D V2 allows the game to have upto 8 different light points at one time

Example of a bumpmap

The first image is a regular Texturemap (the is the one you see)
The second image is a Normalmap which describes where the light is going to hit the surface
This example will not work since the .jpg compression scrambled the normal map.

How to setup a bumpmap

To set up a bump mapped material you put this line of code into the create event:
MaterialCreate('name1','filepath');
MaterialCreate('name2','filepath');
MaterialSetSecondTexture('name2','name1');
bump=BumpShaderCreate(true);
MaterialSetShader('name2','bump');
bump is the variable that creates the bumpmap

How to apply a bumpmap

This code allows you to apply the bump map as a texture
ObjectSetMaterial('objectvariable','name2');

How to make a bumpmap

To make your very own bumpmaps can be very simple. To get started you need two files which I have provided for you starterkit001.
The starter kit contains two files
- tgatool.exe
- tgatodot3.exe
The TGAtool is an image converter for the .tga image format developed by Leadwerks
The TGAtoDOT3 tool is a image to normalmap converter developed by ATI
To use these tools you simply load TGAtool, take the texture you want as a bumpmap and save it as a tga. To convert the texture to a normalmap you then load the .tga file into the TGAtoDOT3 tool and this will generate a second image named whateverDOT3.tga
You then load everything into Game Maker and voila you have a bumpmap.