fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / CSM / Shader / OldSHLSimple / scene.osg
blob7743fbd2a5c07bca6704b6a58e81a08267452fe5
1 #OSG V1.0 
3 Node
5   core MaterialGroup
6   {
7     material ChunkMaterial
8     {
9       chunks
10       [
11         SHLChunk
12         {
13           parameters
14           [
15             ShaderParameterReal
16             {
17               name "ColR"
18               value 1.0
19             }
20             ShaderParameterReal
21             {
22               name "ColG"
23               value 0.6
24             }
25             ShaderParameterReal
26             {
27               name "ColB"
28               value 0.6
29             }
30             ShaderParameterReal
31             {
32               name "ColB"
33               value 0.0
34             }
35           ]
38           vertexProgram "
40             varying float Diffuse; 
42             void main(void)
43             {
44               // calculate vertex position in eye coordinates
45               vec4 ecPosition = -normalize(gl_ModelViewMatrix * gl_Vertex);
47               // compute the transformed normal
48               vec3 tnorm      = normalize(gl_NormalMatrix * gl_Normal);
50               // Calculate a diffuse light intensity
51               Diffuse             = dot(ecPosition.xyz, 
52                                             tnorm     );
54               // output final vertex information
55               gl_Position     = gl_ModelViewProjectionMatrix * gl_Vertex;
56             }
57           "
59           fragmentProgram "
60             varying float Diffuse; 
61             uniform float ColR;
62             uniform float ColG;
63             uniform float ColB;
65             void main (void)
66             {
67               gl_FragColor = vec4(ColR * Diffuse, 
68                                   ColG * Diffuse, 
69                                   ColB * Diffuse, 
70                                   1.);
71             }
72           "
73         }
74       ]
75     }
76   }
78   children
79   [
80     Node
81     {
82       core Inline
83       {
84         url "../../SimpleTeapot/object.wrl"
85       }
86     }
87   ]