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 | 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 | |
---|
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 | { |
---|
31 | |
---|
32 | // do this for each light |
---|
33 | iteration once_per_light |
---|
34 | scene_blend add |
---|
35 | |
---|
36 | // base colours, not needed for rendering, but as information |
---|
37 | // to lighting pass categorisation routine |
---|
38 | ambient 0 0 0 |
---|
39 | |
---|
40 | // Vertex program reference |
---|
41 | vertex_program_ref Examples/BumpMapVP |
---|
42 | { |
---|
43 | param_named_auto lightPosition light_position_object_space 0 |
---|
44 | param_named_auto worldViewProj worldviewproj_matrix |
---|
45 | } |
---|
46 | |
---|
47 | // Fragment program |
---|
48 | fragment_program_ref Examples/BumpMapFP |
---|
49 | { |
---|
50 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
51 | } |
---|
52 | |
---|
53 | // texture shadow receiver program |
---|
54 | shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv |
---|
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 |
---|
62 | shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv |
---|
63 | { |
---|
64 | param_named_auto lightDiffuse light_diffuse_colour 0 |
---|
65 | } |
---|
66 | |
---|
67 | // Base bump map |
---|
68 | texture_unit normalmap |
---|
69 | { |
---|
70 | texture Cube_Lava_NORM.jpg |
---|
71 | colour_op replace |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | // Decal pass |
---|
76 | pass decal |
---|
77 | { |
---|
78 | // base colours, not needed for rendering, but as information |
---|
79 | // to lighting pass categorisation routine |
---|
80 | lighting off |
---|
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 | |
---|
86 | scene_blend dest_colour zero |
---|
87 | texture_unit decalmap |
---|
88 | { |
---|
89 | texture Cube_Lava_COLOR.jpg |
---|
90 | } |
---|
91 | } |
---|
92 | } |
---|
93 | } |
---|