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:
parent
f10b0432c1
commit
d03d2c526f
@ -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);
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user