1
0
Fork 0

Merge commit 'refs/merge-requests/42' of git://gitorious.org/fg/fgdata into integration

This commit is contained in:
Vivian Meazza 2010-09-03 09:35:20 +01:00
commit cf23ab2734
2 changed files with 9 additions and 2 deletions

View file

@ -9,6 +9,8 @@ uniform sampler3D NoiseTex;
uniform sampler2D SampleTex;
uniform sampler1D ColorsTex;
varying vec4 constantColor;
uniform float snowlevel; // From /sim/rendering/snow-level-m
const float scale = 1.0;
@ -57,7 +59,7 @@ void main (void)
c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
vec3 diffuse = gl_Color.rgb * max(0.0, dot(VNormal, gl_LightSource[0].position.xyz));
vec4 ambient_light = gl_LightSource[0].diffuse * vec4(diffuse, 1.0);
vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);
c1 *= ambient_light;
vec4 finalColor = c1;

View file

@ -4,6 +4,7 @@ varying vec4 rawpos;
varying vec4 ecPosition;
varying vec3 VNormal;
varying vec3 Normal;
varying vec4 constantColor;
void main(void)
{
@ -14,6 +15,10 @@ void main(void)
VNormal = normalize(gl_NormalMatrix * gl_Normal);
Normal = normalize(gl_Normal);
gl_FrontColor = gl_Color;
gl_FrontColor = gl_Color;
constantColor = gl_FrontMaterial.emission
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
gl_Position = ftransform();
}