From 070108cf09b1b561613b6eea04723afbbb464507 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sun, 3 Mar 2024 00:10:10 -0500 Subject: Initial commit (new winit) --- src/assets/shaders/test/frag.glsl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/assets/shaders/test/frag.glsl (limited to 'src/assets/shaders/test/frag.glsl') diff --git a/src/assets/shaders/test/frag.glsl b/src/assets/shaders/test/frag.glsl new file mode 100644 index 0000000..a52aa15 --- /dev/null +++ b/src/assets/shaders/test/frag.glsl @@ -0,0 +1,23 @@ +// uniform int has_normal_map; +// uniform sampler2D normal_map; + +uniform sampler2D texture_data; + +void main() +{ + vec2 inverted_texcoord = vec2(vertex_texcoord.x, 1.0 - vertex_texcoord.y); + vec4 texel = texture(texture_data, inverted_texcoord); + if (texel.a != 1.0) { + discard; + } + + // mat3 tbn = compute_tbn(); + // vec3 normal = has_normal_map != 0 + // ? normalize(tbn * (texture(normal_map, inverted_texcoord).xyz * 2.0 - 1.0)) + // : normalize(vertex_normal); + vec3 normal = normalize(vertex_normal); + + vec3 lighting = compute_lighting_noshadow(normal); + + frag_color = vec4(texel.rgb * lighting, texel.a); +} -- cgit v1.2.3