Tweak fogging so that it's probably more in line with the fixed functionality, and use GLSL mix function to simplify the shader code

This commit is contained in:
Kevin Anthoney 2016-02-24 18:45:28 +00:00
parent f10b0432c1
commit d03d2c526f
2 changed files with 3 additions and 3 deletions

View File

@ -321,5 +321,5 @@ void main(void)
hullHeat = Pulse(hullHeat * hullHeat, 0.1);
totalColor += TemperatureGlow(hullHeat);
gl_FragColor = uFogColor.w * vec4(uFogColor.xyz, 0.0) + (1.0 - uFogColor.w) * totalColor;
gl_FragColor = mix(totalColor, vec4(uFogColor.xyz, 1.0), uFogColor.w);
}

View File

@ -4554,7 +4554,7 @@ static const OOMatrix starboard_matrix =
OOGL(glFogfv(GL_FOG_COLOR, skyClearColor));
OOGL(glFogf(GL_FOG_START, half_scale));
OOGL(glFogf(GL_FOG_END, fog_scale));
fog_blend = OOClamp_0_1_f(([drawthing cameraRangeFront] - half_scale)/half_scale);
fog_blend = OOClamp_0_1_f((magnitude([drawthing cameraRelativePosition]) - half_scale)/half_scale);
[drawthing setAtmosphereFogging: [OOColor colorWithRed: skyClearColor[0] green: skyClearColor[1] blue: skyClearColor[2] alpha: fog_blend]];
}
@ -4606,7 +4606,7 @@ static const OOMatrix starboard_matrix =
OOGL(glFogfv(GL_FOG_COLOR, skyClearColor));
OOGL(glFogf(GL_FOG_START, half_scale));
OOGL(glFogf(GL_FOG_END, fog_scale));
fog_blend = OOClamp_0_1_f(([drawthing cameraRangeFront] - half_scale)/half_scale);
fog_blend = OOClamp_0_1_f((magnitude([drawthing cameraRelativePosition]) - half_scale)/half_scale);
[drawthing setAtmosphereFogging: [OOColor colorWithRed: skyClearColor[0] green: skyClearColor[1] blue: skyClearColor[2] alpha: fog_blend]];
}