detailed_object_pass2.frag 781 B

123456789101112131415161718192021222324252627282930
  1. #ifdef Use_Bindless_Texture
  2. layout(bindless_sampler) uniform sampler2D Albedo;
  3. layout(bindless_sampler) uniform sampler2D Detail;
  4. layout(bindless_sampler) uniform sampler2D SpecMap;
  5. #else
  6. uniform sampler2D Albedo;
  7. uniform sampler2D Detail;
  8. uniform sampler2D SpecMap;
  9. #endif
  10. in vec2 uv;
  11. in vec2 uv_bis;
  12. out vec4 FragColor;
  13. vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapValue, float emitMapValue);
  14. void main(void)
  15. {
  16. vec4 color = texture(Albedo, uv);
  17. #ifdef Use_Bindless_Texture
  18. #ifdef SRGBBindlessFix
  19. color.xyz = pow(color.xyz, vec3(2.2));
  20. #endif
  21. #endif
  22. vec4 detail = texture(Detail, uv_bis);
  23. color *= detail;
  24. float specmap = texture(SpecMap, uv).g;
  25. FragColor = vec4(getLightFactor(color.xyz, vec3(1.), specmap, 0.), 1.);
  26. }