refactor res/shaders

This commit is contained in:
MihailRis
2024-07-20 16:05:06 +03:00
parent 52381d5afa
commit 8e159009eb
16 changed files with 85 additions and 61 deletions
+10 -9
View File
@@ -11,13 +11,14 @@ uniform float u_fogFactor;
uniform float u_fogCurve;
void main(){
vec3 fogColor = texture(u_cubemap, a_dir).rgb;
vec4 tex_color = texture(u_texture0, a_texCoord);
float depth = (a_distance/256.0);
float alpha = a_color.a * tex_color.a;
// anyway it's any alpha-test alternative required
if (alpha < 0.3f)
discard;
f_color = mix(a_color * tex_color, vec4(fogColor,1.0), min(1.0, pow(depth*u_fogFactor, u_fogCurve)));
f_color.a = alpha;
vec3 fogColor = texture(u_cubemap, a_dir).rgb;
vec4 tex_color = texture(u_texture0, a_texCoord);
float depth = (a_distance/256.0);
float alpha = a_color.a * tex_color.a;
// anyway it's any alpha-test alternative required
if (alpha < 0.3f)
discard;
f_color = mix(a_color * tex_color, vec4(fogColor,1.0),
min(1.0, pow(depth*u_fogFactor, u_fogCurve)));
f_color.a = alpha;
}