Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 430
  2.  
  3. layout(binding = 1) uniform sampler2D tex;
  4. uniform vec2 uvScaling;
  5.  
  6. in vec2 uvOffset_;
  7. flat in vec2 uvBase_;
  8.  
  9. layout(binding = 0) uniform sampler2DMS nearDepthTestTex;
  10.  
  11. flat in vec3 norm_;
  12.  
  13. layout(location = 0)out vec4 color;
  14. layout(location = 1)out vec4 normal;
  15.  
  16. void main() {
  17.     const float depth = texelFetch(nearDepthTestTex, ivec2(gl_FragCoord.xy), 0).r;
  18.     if (gl_FragCoord.z <= depth)
  19.         discard;
  20.  
  21.     color = texture(tex, uvBase_ + clamp(uvOffset_, 0, uvScaling.x));
  22.     if (color.a < 0.8)
  23.         discard;
  24.  
  25.     normal = vec4(norm_, 0);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement