shadowref.frag 322 B

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