X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=shaderlib%2Funlit.glsl;h=a7d75c3248a59150e9cd70fa749ce05df975eb16;hb=HEAD;hp=85275558b399346b8b1a89758b80ac52ea9d3458;hpb=2bf5645d38492c5ef829478f3e04e78f31802fe6;p=libs%2Fgl.git diff --git a/shaderlib/unlit.glsl b/shaderlib/unlit.glsl index 85275558..a7d75c32 100644 --- a/shaderlib/unlit.glsl +++ b/shaderlib/unlit.glsl @@ -6,12 +6,13 @@ struct UnlitMaterialParameters vec4 color; }; -uniform UnlitMaterial +layout(set=1) uniform UnlitMaterial { UnlitMaterialParameters unlit_material; + AlphaCutoffParams alpha_cutoff; }; -uniform sampler2D color_tex; +layout(set=1) uniform sampler2D color_tex; layout(constant_id=auto) const bool use_texture = false; layout(constant_id=auto) const bool use_vertex_color = false; @@ -31,6 +32,8 @@ virtual vec4 get_color() void main() { vec4 color = get_color(); + color.a = apply_alpha_cutoff(color.a, alpha_cutoff); + if(use_fog) color.rgb = apply_fog(color.rgb); frag_color = color;