Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of content/BumpMapping


Ignore:
Timestamp:
Nov 28, 2018, 11:12:10 AM (5 years ago)
Author:
wiesep
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/BumpMapping

    v1 v1  
     1= Bump Mapping =
     2To use a bump map in a material, you can create a new material script inheriting from the base bump map script. Replace both texture image files with your own files.
     3
     4{{{#!cpp
     5import * from "BumpMap.material"
     6// Any number of lights, diffuse
     7material Cube_Lava_Normal : BumpMap_Base
     8{
     9    technique
     10    {
     11        pass ambient
     12        {
     13        }
     14        // Now do the lighting pass
     15        // NB we don't do decal texture here because this is repeated per light
     16        pass perlight
     17        {
     18            // Base bump map
     19            texture_unit normalmap
     20            {
     21                texture Cube_Lava_NORM.jpg
     22                colour_op replace
     23            }
     24        }
     25
     26        // Decal pass
     27        pass decal
     28        {
     29            texture_unit decalmap
     30            {
     31                texture Cube_Lava_COLOR.jpg
     32            }
     33        }
     34    }
     35}
     36}}}
     37
     38The base bump map material script is located at `[media_directory]/materials/BumpMapping/BumpMap.material`
     39
     40To get an idea what bump maps are capable of, start the test level `BumpMap`
     41