Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // vertex shader
- #version 330 core
- layout (location = 0) in vec3 aPos;
- layout (location = 1) in vec3 aColor;
- layout (location = 2) in vec2 aTexCoord;
- out vec2 TexCoord;
- uniform mat4 transform;
- void main()
- {
- gl_Position = transform * vec4(aPos, 1.0f); // тута убираю/оставляю трансформации
- TexCoord = aTexCoord;
- }
- // fragment shader
- #version 330 core
- out vec4 FragColor;
- in vec3 ourColor;
- in vec2 TexCoord;
- uniform sampler2D ourTexture;
- uniform sampler2D ourTexture2;
- void main()
- {
- vec4 tmp = mix(texture(ourTexture, TexCoord), texture(ourTexture2, TexCoord), TexCoord.x * 0.5);
- FragColor = mix(texture(ourTexture, TexCoord), tmp, 0.5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement