1 | // Any number of lights, diffuse |
---|
2 | material Cube_Lava_Normal |
---|
3 | { |
---|
4 | technique |
---|
5 | { |
---|
6 | // Base ambient pass |
---|
7 | pass ambient |
---|
8 | { |
---|
9 | // base colours, not needed for rendering, but as information |
---|
10 | // to lighting pass categorisation routine |
---|
11 | diffuse 0 0 0 |
---|
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 | |
---|
19 | // do this for each light |
---|
20 | iteration once_per_light |
---|
21 | scene_blend add |
---|
22 | |
---|
23 | // base colours, not needed for rendering, but as information |
---|
24 | // to lighting pass categorisation routine |
---|
25 | ambient 0 0 0 |
---|
26 | |
---|
27 | // Vertex program reference |
---|
28 | vertex_program_ref BumpMapping/BumpMapVP |
---|
29 | { |
---|
30 | param_named_auto lightPosition light_position_object_space 0 |
---|
31 | param_named_auto worldViewProj worldviewproj_matrix |
---|
32 | } |
---|
33 | |
---|
34 | // Fragment program |
---|
35 | fragment_program_ref BumpMapping/BumpMapFP |
---|
36 | { |
---|
37 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
38 | } |
---|
39 | |
---|
40 | // texture shadow receiver program |
---|
41 | shadow_receiver_vertex_program_ref BumpMapping/BumpMapVPShadowRcv |
---|
42 | { |
---|
43 | param_named_auto lightPosition light_position_object_space 0 |
---|
44 | param_named_auto worldViewProj worldviewproj_matrix |
---|
45 | param_named_auto worldMatrix world_matrix |
---|
46 | param_named_auto texViewProj texture_viewproj_matrix |
---|
47 | } |
---|
48 | // Additive texture shadow receiver program |
---|
49 | shadow_receiver_fragment_program_ref BumpMapping/BumpMapFPShadowRcv |
---|
50 | { |
---|
51 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
52 | } |
---|
53 | |
---|
54 | // Vertex program reference |
---|
55 | vertex_program_ref BumpMapping/BumpMapVPSpecular |
---|
56 | { |
---|
57 | param_named_auto lightPosition light_position_object_space 0 |
---|
58 | param_named_auto eyePosition camera_position_object_space |
---|
59 | param_named_auto worldViewProj worldviewproj_matrix |
---|
60 | } |
---|
61 | |
---|
62 | // Fragment program |
---|
63 | fragment_program_ref BumpMapping/BumpMapFPSpecular |
---|
64 | { |
---|
65 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
66 | param_named_auto lightSpecular light_specular_colour 0 |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | // Base bump map |
---|
71 | texture_unit normalmap |
---|
72 | { |
---|
73 | texture Cube_Lava_NORM.jpg |
---|
74 | colour_op replace |
---|
75 | } |
---|
76 | } |
---|
77 | |
---|
78 | // Decal pass |
---|
79 | pass decal |
---|
80 | { |
---|
81 | // base colours, not needed for rendering, but as information |
---|
82 | // to lighting pass categorisation routine |
---|
83 | lighting off |
---|
84 | |
---|
85 | scene_blend dest_colour zero |
---|
86 | texture_unit decalmap |
---|
87 | { |
---|
88 | texture Cube_Lava_COLOR.jpg |
---|
89 | } |
---|
90 | } |
---|
91 | } |
---|
92 | } |
---|