Instead of creating materials for your self, like one usually does in 3d modeling programs, a couple of predefined materials are used. What needs to be filled out are the different maps used.
Settings for General Use Alpha: TODO Depth Test: Value:
This material shows the diffuse map without any lighting. Texture units: Diffuse
This transparent material is blended additively with the background.
Result = source_pixel + screen_pixel
It is not affected by lighting. Texture units: Diffuse
This transparent material is multiplied with the background.
Result = source_pixel * screen_pixel
This transparent material is multiplied with the background times two, like this:
Result = (source_pixel * screen_pixel) * 2
Each texel on the texture is transperant according to the alpha channel on the texture.
The diffuse map with lighting. Texture units: Diffuse and Illumination (optional).
The diffuse map with lighting and specular term. Does not have any support for specular map. Texture units: Diffuse and Illumination (optional).
This material shows the diffuse map with a bump mapped surface. Texture units: Diffuse, Normal-Map and Illumination (optional).
This material shows the diffuse map with a bump mapped surface and specular term. The alpha channel of the normal map is used as specular map. Texture units: Diffuse, Normal-Map and Illumination (optional).
This material shows the diffuse map with a bump mapped surface and a color specular term. Texture units: Diffuse, Normal-Map, Specular and Illumination (optional).
This material shows the diffuse map with a environment reflection from a CubeMap. Texture units: Diffuse and CubeMap.
This transparent material is blended additively with the background. It also has a bobbing surface.
It is not affected by lighting Texture units: Diffuse.
The different material types uses texture units to calculate the value of pixel. Each texture units have the following properties:
The r,g and b channels contain the color values. The alpha channel is used for transparent materials.
This is a map showing the topology of a surface in tangent space. The r,g and b channels contain the compressed normal vectors. The alpha channel is used for specifying the specular term for specular material, 0= no specularity 1 = full specularity.
This map is additively added after all lights has been rendered.
The r,g and b channels are used to create a specular effect. The whiter the shinier, black = no shine.
Cube map texturing is a form of texture mapping that uses a 3D direction vector (a fancy phrase that means nothing more than a direction) to index into a texture that is six square 2D textures arranged like the faces of a cube. See this cube map tutorial for extensive information on it's construction.
The CubeMap is used to create a "reflection" of the environment in a texture, for example the ice in the ice cave level in penumbra.
For the HPL engine you make the 6 images as separate images, and you name them: nameofimage_neg_x nameofimage_neg_y nameofimage_neg_z nameofimage_pos_x nameofimage_pos_y nameofimage_pos_z
In the material editor under Texture Units at the file prompt: you add one of the images and only use the "nameofimage" excluding _ckgedit_QUOTneg_x", the engine will then automatically locate and use the 6 images. ==== 4.3 File format ==== Material files has the extension “.mat”, are made in XML and has the following format: <code xml> GESHI_OPENMaterial> GESHI_OPENMain Type=GESHI_QUOT[material type]GESHI_QUOT/> GESHI_OPENTextureUnits> GESHI_OPEN[Texture unit] File=GESHI_QUOT[file name]GESHI_QUOT Type =GESHI_QUOT[type]GESHI_QUOT Mipmaps=GESHI_QUOT[true or false]GESHI_QUOT Compress=GESHI_QUOT[true or false]GESHI_QUOT Wrap=GESHI_QUOT[wrap mode]GESHI_QUOT/> [additional texture units…] GESHI_OPEN/TextureUnits> GESHI_OPEN__/Material> </code>
Instead of handwriting these files HplHelper can be used to create material files.
This is gives the material physical properties as well. Read more about the different types under chapter 5.6. Note that this property is only useful for static scene geometry and is NOT used for entities, entities specify their physics material in the entity file.