Group { UniqueID Group_0 DataVariance DYNAMIC nodeMask 0xffffffff cullingActive TRUE num_children 2 PositionAttitudeTransform { DataVariance DYNAMIC nodeMask 0xffffffff cullingActive TRUE StateSet { DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Program { UniqueID Program_0 DataVariance STATIC num_shaders 2 Shader { DataVariance DYNAMIC type VERTEX code { "varying vec4 vsPosition;" "varying vec3 vsNormal;" "varying vec3 vsEyeVec;" "varying vec3 light0Vec;" "varying vec3 light1Vec;" "void main(void){" " vsNormal = gl_NormalMatrix * gl_Normal;" " vsPosition = gl_ModelViewMatrix * gl_Vertex;" " vsEyeVec = -vsPosition.xyz;" " light0Vec = gl_NormalMatrix * vec3(1.0, -1.0, 1.0); " light1Vec = gl_NormalMatrix * vec3(-1.0, 0.0, -1.0); " gl_Position = ftransform();" "}" "" } } Shader { DataVariance DYNAMIC type FRAGMENT code { "varying vec4 vsPosition;" "varying vec3 vsNormal;" "varying vec3 light0Vec;" "varying vec3 light1Vec;" "varying vec3 vsEyeVec;" "vec4 diffuse;" "vec3 specular;" "void directionalLight(in vec3 lightvec, in vec3 normal, in vec3 eyevec, in vec3 color){" " // diffuse" " float norm_dot_dir = max(0.0, dot(normal, lightvec));" " diffuse.rgb += color * norm_dot_dir;" " if(norm_dot_dir > 0.0){" " // phong specular" " vec3 reflectvec = reflect(-lightvec, normal);" " specular += color * pow(max(dot(eyevec, reflectvec), 0.0), 10.0);" " }" "}" "void main(void){" " diffuse = vec4(0.1, 0.1, 0.1, 1.0);" " specular = vec3(0.0, 0.0, 0.0);" " vec3 vsNormalNormalized = normalize(vsNormal);" " vec3 vsEyeVecNormalized = normalize(vsEyeVec);" " directionalLight(normalize(light0Vec), vsNormalNormalized, vsEyeVecNormalized, vec3(0.9, 0.9, 0.9));" " directionalLight(normalize(light1Vec), vsNormalNormalized, vsEyeVecNormalized, vec3(0.3, 0.3, 0.6));" " // material color " diffuse *= vec4(1.0, 0.5, 0.3, 1.0); " // regular specular addition" " diffuse.rgb += specular;" " gl_FragColor = diffuse;" "}" "" } } } } referenceFrame RELATIVE position -1.2 0 0 attitude 0 0 0 1 scale 1 1 1 pivotPoint 0 0 0 num_children 1 Geode { UniqueID Geode_0 DataVariance DYNAMIC nodeMask 0xffffffff cullingActive TRUE num_drawables 1 ShapeDrawable { DataVariance DYNAMIC StateSet { DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Uniform { DataVariance DYNAMIC name "Color1" vec3 0.2 0.8 1.0 } } Sphere { DataVariance DYNAMIC Center 0 0 0 Radius 1 } useDisplayList TRUE useVertexBufferObjects FALSE color 1 1 1 1 } } } PositionAttitudeTransform { DataVariance DYNAMIC nodeMask 0xffffffff cullingActive TRUE StateSet { DataVariance STATIC rendering_hint DEFAULT_BIN renderBinMode INHERIT Program { UniqueID Program_1 DataVariance STATIC num_shaders 2 Shader { DataVariance DYNAMIC type VERTEX code { "varying vec4 vsPosition;" "varying vec3 vsNormal;" "varying vec3 vsEyeVec;" "varying vec3 light0Vec;" "varying vec3 light1Vec;" "void main(void){" " vsNormal = gl_NormalMatrix * gl_Normal;" " vsPosition = gl_ModelViewMatrix * gl_Vertex;" " vsEyeVec = -vsPosition.xyz;" " light0Vec = gl_NormalMatrix * vec3(1.0, -1.0, 1.0); " light1Vec = gl_NormalMatrix * vec3(-1.0, 0.0, -1.0); " gl_Position = ftransform();" "}" "" } } Shader { DataVariance DYNAMIC type FRAGMENT code { "varying vec4 vsPosition;" "varying vec3 vsNormal;" "varying vec3 light0Vec;" "varying vec3 light1Vec;" "varying vec3 vsEyeVec;" "vec4 diffuse;" "vec3 specular;" "void directionalLight(in vec3 lightvec, in vec3 normal, in vec3 eyevec, in vec3 color){" " // diffuse" " float norm_dot_dir = max(0.0, dot(normal, lightvec));" " diffuse.rgb += color * norm_dot_dir;" " if(norm_dot_dir > 0.0){" " // phong specular" " vec3 reflectvec = reflect(-lightvec, normal);" " specular += color * pow(max(dot(eyevec, reflectvec), 0.0), 10.0);" " }" "}" "void main(void){" " diffuse = vec4(0.1, 0.1, 0.1, 1.0);" " specular = vec3(0.0, 0.0, 0.0);" " vec3 vsNormalNormalized = normalize(vsNormal);" " vec3 vsEyeVecNormalized = normalize(vsEyeVec);" " // This shader uses the same color for diffuse and specular light. You can use separate specular" " // values greater than 1.0 if you want a saturated spot in the center of your specular highlights." " directionalLight(normalize(light0Vec), vsNormalNormalized, vsEyeVecNormalized, vec3(0.9, 0.9, 0.9));" " directionalLight(normalize(light1Vec), vsNormalNormalized, vsEyeVecNormalized, vec3(0.3, 0.3, 0.6));" " // material color " diffuse *= vec4(1.0, 0.5, 0.3, 1.0); " // smart specular addition" " diffuse.rgb += specular * (vec3(1.0, 1.0, 1.0) - diffuse.rgb);" " gl_FragColor = diffuse;" "}" "" } } } } referenceFrame RELATIVE position 1.2 0 0 attitude 0 0 0 1 scale 1 1 1 pivotPoint 0 0 0 num_children 1 Use Geode_0 } }