Files
Hazel/Sandbox/assets/shaders/Texture.glsl
2025-05-16 15:55:00 +08:00

39 lines
711 B
GLSL

#type vertex
#version 460 core
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec2 a_TexCoord;
uniform mat4 u_ViewProjection;
uniform mat4 u_Transform;
out vec2 v_TexCoord;
void main() {
v_TexCoord = a_TexCoord;
gl_Position = u_ViewProjection * u_Transform * vec4(a_Position, 1.0f);
}
#type fragment
#version 460 core
layout(location = 0) out vec4 color;
in vec2 v_TexCoord;
uniform sampler2D u_Texture;
void main() {
vec4 tmpColor = texture(u_Texture, v_TexCoord);
if(gl_FragCoord.x < 635){
color = tmpColor;
}
else{
if(tmpColor.a < 0.1){
discard;
}else{
color = vec4(v_TexCoord, 0.0f, 1.0f);
}
}
}