mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add 'u_alphaClip' to the blocks shader
This commit is contained in:
parent
71788e4eb9
commit
608eb60514
2 changed files with 4 additions and 2 deletions
|
|
@ -9,14 +9,14 @@ uniform samplerCube u_cubemap;
|
|||
uniform vec3 u_fogColor;
|
||||
uniform float u_fogFactor;
|
||||
uniform float u_fogCurve;
|
||||
uniform bool u_alphaClip;
|
||||
|
||||
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)
|
||||
if (u_alphaClip && alpha < 0.9f)
|
||||
discard;
|
||||
f_color = mix(a_color * tex_color, vec4(fogColor,1.0),
|
||||
min(1.0, pow(depth*u_fogFactor, u_fogCurve)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue