增加窗口自由缩放
This commit is contained in:
38
Sandbox/assets/shaders/Texture.glsl
Normal file
38
Sandbox/assets/shaders/Texture.glsl
Normal file
@ -0,0 +1,38 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user