Skip to content

Commit b350500

Browse files
committed
添加Transform 测试Shader
1 parent 52b9356 commit b350500

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#version 330 core
2+
out vec4 FragColor;
3+
4+
in vec2 TexCoord;
5+
6+
// texture samplers
7+
uniform sampler2D texture1;
8+
uniform sampler2D texture2;
9+
10+
void main()
11+
{
12+
// linearly interpolate between both textures (80% container, 20% awesomeface)
13+
FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2);
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#version 330 core
2+
layout (location = 0) in vec3 aPos;
3+
layout (location = 1) in vec2 aTexCoord;
4+
5+
out vec2 TexCoord;
6+
7+
uniform mat4 transform;
8+
9+
void main()
10+
{
11+
gl_Position = transform * vec4(aPos, 1.0);
12+
TexCoord = vec2(aTexCoord.x, aTexCoord.y);
13+
}

0 commit comments

Comments
 (0)