Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // vertex shader
  2.  
  3. #version 330 core
  4. layout (location = 0) in vec3 aPos;
  5. layout (location = 1) in vec3 aColor;
  6. layout (location = 2) in vec2 aTexCoord;
  7.  
  8. out vec2 TexCoord;
  9.  
  10. uniform mat4 transform;
  11.  
  12. void main()
  13. {  
  14.     gl_Position = transform * vec4(aPos, 1.0f); // тута убираю/оставляю трансформации
  15.     TexCoord = aTexCoord;
  16. }
  17.  
  18. // fragment shader
  19.  
  20. #version 330 core
  21. out vec4 FragColor;
  22.  
  23. in vec3 ourColor;
  24. in vec2 TexCoord;
  25.  
  26. uniform sampler2D ourTexture;
  27. uniform sampler2D ourTexture2;
  28.  
  29. void main()
  30. {
  31.     vec4 tmp = mix(texture(ourTexture, TexCoord), texture(ourTexture2, TexCoord), TexCoord.x * 0.5);
  32.     FragColor = mix(texture(ourTexture, TexCoord), tmp, 0.5);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement