mip-mapping related fixes

This commit is contained in:
MihailRis
2024-11-25 15:39:34 +03:00
parent 7ddf3f7537
commit d9277e1b31
4 changed files with 34 additions and 15 deletions
+5 -2
View File
@@ -16,8 +16,11 @@ void main() {
vec4 tex_color = texture(u_texture0, a_texCoord);
float depth = (a_distance/256.0);
float alpha = a_color.a * tex_color.a;
if (u_alphaClip && alpha < 0.9f)
discard;
if (u_alphaClip) {
if (alpha < 0.2f)
discard;
alpha = 1.0;
}
f_color = mix(a_color * tex_color, vec4(fogColor,1.0),
min(1.0, pow(depth*u_fogFactor, u_fogCurve)));
f_color.a = alpha;