instanced_object_unlit.frag 476 B

123456789101112131415161718192021222324252627
  1. #ifndef Use_Bindless_Texture
  2. uniform sampler2D tex;
  3. #endif
  4. #ifdef Use_Bindless_Texture
  5. flat in sampler2D 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(handle, uv);
  14. #ifdef SRGBBindlessFix
  15. col.xyz = pow(col.xyz, vec3(2.2));
  16. #endif
  17. #else
  18. vec4 col = texture(tex, uv);
  19. #endif
  20. col.xyz *= pow(color.xyz, vec3(2.2));
  21. if (col.a < 0.5) discard;
  22. FragColor = vec4(col.xyz, 1.);
  23. }