fix render advanced pipeline issues

This commit is contained in:
MihailRis
2025-07-12 17:31:55 +03:00
parent 0ab23a117d
commit ac9772cd67
12 changed files with 192 additions and 86 deletions
+8 -4
View File
@@ -24,15 +24,19 @@ uniform vec3 u_sunDir;
void main() {
float shadow = calc_shadow(a_modelpos, a_realnormal, a_distance);
vec3 fogColor = texture(u_skybox, a_dir).rgb;
vec4 tex_color = texture(u_texture0, a_texCoord);
float alpha = a_color.a * tex_color.a;
vec4 texColor = texture(u_texture0, a_texCoord);
float alpha = a_color.a * texColor.a;
// anyway it's any alpha-test alternative required
if (alpha < (u_alphaClip ? 0.5f : 0.15f)) {
discard;
}
f_color = a_color * tex_color * shadow;
f_color = a_color * texColor * shadow;
#ifndef ADVANCED_RENDER
vec3 fogColor = texture(u_skybox, a_dir).rgb;
f_color = mix(f_color, vec4(fogColor, 1.0), a_fog);
#endif
f_color.a = alpha;
f_position = vec4(a_position, 1.0);
f_normal = vec4(a_normal, 1.0);