[12085] | 1 | // Any number of lights, diffuse |
---|
| 2 | material Cube_Lava_Normal |
---|
| 3 | { |
---|
| 4 | technique |
---|
| 5 | { |
---|
| 6 | // Base ambient pass |
---|
| 7 | pass ambient |
---|
| 8 | { |
---|
[12096] | 9 | // base colours, not needed for rendering, but as information |
---|
| 10 | // to lighting pass categorisation routine |
---|
| 11 | ambient 1 1 1 |
---|
| 12 | diffuse 0 0 0 |
---|
| 13 | specular 0 0 0 0 |
---|
| 14 | // Really basic vertex program |
---|
| 15 | // NB we don't use fixed function here because GL does not like |
---|
| 16 | // mixing fixed function and vertex programs, depth fighting can |
---|
| 17 | // be an issue |
---|
| 18 | vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified |
---|
| 19 | { |
---|
| 20 | param_named_auto ambient ambient_light_colour |
---|
| 21 | } |
---|
| 22 | fragment_program_ref Ogre/BasicFragmentPrograms/PassthroughFP |
---|
| 23 | { |
---|
| 24 | } |
---|
| 25 | |
---|
[12085] | 26 | } |
---|
| 27 | // Now do the lighting pass |
---|
| 28 | // NB we don't do decal texture here because this is repeated per light |
---|
| 29 | pass perlight |
---|
| 30 | { |
---|
[12096] | 31 | |
---|
[12085] | 32 | // do this for each light |
---|
| 33 | iteration once_per_light |
---|
| 34 | scene_blend add |
---|
| 35 | |
---|
[12091] | 36 | // base colours, not needed for rendering, but as information |
---|
| 37 | // to lighting pass categorisation routine |
---|
| 38 | ambient 0 0 0 |
---|
| 39 | |
---|
[12085] | 40 | // Vertex program reference |
---|
[12091] | 41 | vertex_program_ref Examples/BumpMapVP |
---|
[12085] | 42 | { |
---|
| 43 | param_named_auto lightPosition light_position_object_space 0 |
---|
| 44 | param_named_auto worldViewProj worldviewproj_matrix |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | // Fragment program |
---|
[12091] | 48 | fragment_program_ref Examples/BumpMapFP |
---|
[12085] | 49 | { |
---|
[12096] | 50 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
[12085] | 51 | } |
---|
| 52 | |
---|
| 53 | // texture shadow receiver program |
---|
[12091] | 54 | shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv |
---|
[12085] | 55 | { |
---|
| 56 | param_named_auto lightPosition light_position_object_space 0 |
---|
| 57 | param_named_auto worldViewProj worldviewproj_matrix |
---|
| 58 | param_named_auto worldMatrix world_matrix |
---|
| 59 | param_named_auto texViewProj texture_viewproj_matrix |
---|
| 60 | } |
---|
| 61 | // Additive texture shadow receiver program |
---|
[12091] | 62 | shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv |
---|
[12085] | 63 | { |
---|
[12096] | 64 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
[12085] | 65 | } |
---|
[12096] | 66 | |
---|
[12085] | 67 | // Base bump map |
---|
| 68 | texture_unit normalmap |
---|
| 69 | { |
---|
| 70 | texture Cube_Lava_NORM.jpg |
---|
| 71 | colour_op replace |
---|
| 72 | } |
---|
| 73 | } |
---|
[12096] | 74 | |
---|
[12085] | 75 | // Decal pass |
---|
| 76 | pass decal |
---|
| 77 | { |
---|
[12096] | 78 | // base colours, not needed for rendering, but as information |
---|
| 79 | // to lighting pass categorisation routine |
---|
[12085] | 80 | lighting off |
---|
[12096] | 81 | // Really basic vertex program |
---|
| 82 | // NB we don't use fixed function here because GL does not like |
---|
| 83 | // mixing fixed function and vertex programs, depth fighting can |
---|
| 84 | // be an issue |
---|
| 85 | |
---|
[12085] | 86 | scene_blend dest_colour zero |
---|
[12092] | 87 | texture_unit decalmap |
---|
| 88 | { |
---|
[12096] | 89 | texture Cube_Lava_COLOR.jpg |
---|
[12092] | 90 | } |
---|
[12085] | 91 | } |
---|
| 92 | } |
---|
| 93 | } |
---|