instanced_shadowref.frag 414 B

12345678910111213141516171819202122
  1. #ifndef Use_Bindless_Texture
  2. uniform sampler2D tex;
  3. #endif
  4. #ifdef Use_Bindless_Texture
  5. flat in uvec2 handle;
  6. #endif
  7. in vec2 uv;
  8. in vec4 color;
  9. out vec4 FragColor;
  10. void main(void)
  11. {
  12. #ifdef Use_Bindless_Texture
  13. vec4 col = texture(sampler2D(handle), uv);
  14. #else
  15. vec4 col = texture(tex, uv);
  16. #endif
  17. if (col.a < 0.5) discard;
  18. FragColor = vec4(exp(32. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
  19. }