Mapdev:normal

From Spring
Jump to navigationJump to search

Normal Texture

FIXME: description as to why you want to use normal textures.

Caution
Requires clients to have GLSL-spec hardware
Example
FIXME: needs image file FIXME: needs image file
Without Normal Map With Normal Map

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      detailNormalTex = "normal.png",
      ...
   },
   ...
}

Image File

File Location ./maps/
File Format PNG, TGA
Colour Depth 8bpp
Channels RGBA
Resolution Any, recommended powers of two, will be stretched over the terrain.
Modifies the shading normal as follows

shadingNormal.xyz = NORMALIZE(terrainNormal.xyz * (1 - detailNormalTex.a) 
                               + detailNormalTex.rgb)