[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 | diffuse 0 0 0 |
---|
[12117] | 12 | depth_write on |
---|
| 13 | depth_bias 0 |
---|
[12096] | 14 | |
---|
[12085] | 15 | } |
---|
| 16 | // Now do the lighting pass |
---|
| 17 | // NB we don't do decal texture here because this is repeated per light |
---|
| 18 | pass perlight |
---|
| 19 | { |
---|
[12096] | 20 | |
---|
[12085] | 21 | // do this for each light |
---|
| 22 | iteration once_per_light |
---|
| 23 | scene_blend add |
---|
[12117] | 24 | depth_write on |
---|
| 25 | depth_bias 1 |
---|
[12085] | 26 | |
---|
[12091] | 27 | // base colours, not needed for rendering, but as information |
---|
| 28 | // to lighting pass categorisation routine |
---|
| 29 | ambient 0 0 0 |
---|
| 30 | |
---|
[12085] | 31 | // Vertex program reference |
---|
[12115] | 32 | vertex_program_ref BumpMapping/BumpMapVP |
---|
[12085] | 33 | { |
---|
| 34 | param_named_auto lightPosition light_position_object_space 0 |
---|
| 35 | param_named_auto worldViewProj worldviewproj_matrix |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | // Fragment program |
---|
[12115] | 39 | fragment_program_ref BumpMapping/BumpMapFP |
---|
[12085] | 40 | { |
---|
[12096] | 41 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
[12085] | 42 | } |
---|
| 43 | |
---|
| 44 | // texture shadow receiver program |
---|
[12115] | 45 | shadow_receiver_vertex_program_ref BumpMapping/BumpMapVPShadowRcv |
---|
[12085] | 46 | { |
---|
| 47 | param_named_auto lightPosition light_position_object_space 0 |
---|
| 48 | param_named_auto worldViewProj worldviewproj_matrix |
---|
| 49 | param_named_auto worldMatrix world_matrix |
---|
| 50 | param_named_auto texViewProj texture_viewproj_matrix |
---|
| 51 | } |
---|
| 52 | // Additive texture shadow receiver program |
---|
[12115] | 53 | shadow_receiver_fragment_program_ref BumpMapping/BumpMapFPShadowRcv |
---|
[12085] | 54 | { |
---|
[12096] | 55 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
[12085] | 56 | } |
---|
[12096] | 57 | |
---|
[12115] | 58 | // Vertex program reference |
---|
| 59 | vertex_program_ref BumpMapping/BumpMapVPSpecular |
---|
| 60 | { |
---|
| 61 | param_named_auto lightPosition light_position_object_space 0 |
---|
| 62 | param_named_auto eyePosition camera_position_object_space |
---|
| 63 | param_named_auto worldViewProj worldviewproj_matrix |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | // Fragment program |
---|
| 67 | fragment_program_ref BumpMapping/BumpMapFPSpecular |
---|
| 68 | { |
---|
[12117] | 69 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
[12115] | 70 | param_named_auto lightSpecular light_specular_colour 0 |
---|
| 71 | } |
---|
| 72 | |
---|
[12117] | 73 | |
---|
[12085] | 74 | // Base bump map |
---|
| 75 | texture_unit normalmap |
---|
| 76 | { |
---|
| 77 | texture Cube_Lava_NORM.jpg |
---|
| 78 | colour_op replace |
---|
| 79 | } |
---|
| 80 | } |
---|
[12096] | 81 | |
---|
[12085] | 82 | // Decal pass |
---|
| 83 | pass decal |
---|
| 84 | { |
---|
[12096] | 85 | // base colours, not needed for rendering, but as information |
---|
| 86 | // to lighting pass categorisation routine |
---|
[12085] | 87 | lighting off |
---|
[12117] | 88 | depth_write on |
---|
| 89 | depth_bias 2 |
---|
| 90 | |
---|
[12085] | 91 | scene_blend dest_colour zero |
---|
[12092] | 92 | texture_unit decalmap |
---|
| 93 | { |
---|
[12096] | 94 | texture Cube_Lava_COLOR.jpg |
---|
[12092] | 95 | } |
---|
[12085] | 96 | } |
---|
| 97 | } |
---|
| 98 | } |
---|