1
0
Fork 0

Fix a problem with cockpit shadows added in previous commit

This commit is contained in:
Frederic Bouvier 2012-04-18 08:37:14 +02:00
parent e4b856805e
commit 9807be4f0d

View file

@ -20,10 +20,11 @@ vec4 DynamicShadow( in vec4 ecPosition, out vec4 tint )
vec4 coords; vec4 coords;
vec2 shift = vec2( 0.0 ); vec2 shift = vec2( 0.0 );
int index = 4; int index = 4;
float factor = 0.5; float factor = 0.5;
if (ecPosition.z > -fg_ShadowDistances.x) { if (ecPosition.z > -fg_ShadowDistances.x) {
index = 1; index = 1;
factor = 1.0; if (fg_ShadowNumber == 1)
factor = 1.0;
tint = vec4(0.0,1.0,0.0,1.0); tint = vec4(0.0,1.0,0.0,1.0);
} else if (ecPosition.z > -fg_ShadowDistances.y && fg_ShadowNumber > 1) { } else if (ecPosition.z > -fg_ShadowDistances.y && fg_ShadowNumber > 1) {
index = 2; index = 2;
@ -64,7 +65,7 @@ void main() {
#elif 1 #elif 1
float shadow = shadow2DProj( shadow_tex, DynamicShadow( vec4( pos, 1.0 ), tint ) ).r; float shadow = shadow2DProj( shadow_tex, DynamicShadow( vec4( pos, 1.0 ), tint ) ).r;
#elif 0 #elif 0
float shadow = 0.0; float shadow = 0.0;
shadow += 0.333 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos, 1.0), tint ) ).r; shadow += 0.333 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos, 1.0), tint ) ).r;
shadow += 0.166 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos + vec3(-0.003 * pos.z, -0.003 * pos.z, 0), 1.0), tint ) ).r; shadow += 0.166 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos + vec3(-0.003 * pos.z, -0.003 * pos.z, 0), 1.0), tint ) ).r;
shadow += 0.166 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos + vec3( 0.003 * pos.z, 0.003 * pos.z, 0), 1.0), tint ) ).r; shadow += 0.166 * shadow2DProj( shadow_tex, DynamicShadow( vec4(pos + vec3( 0.003 * pos.z, 0.003 * pos.z, 0), 1.0), tint ) ).r;