2
0

Ambient.frag 598 B

1234567891011121314151617181920212223242526
  1. #include "Uniforms.frag"
  2. #include "Samplers.frag"
  3. #include "Fog.frag"
  4. #include "Lighting.frag"
  5. varying vec2 vTexCoord;
  6. #ifdef VERTEXCOLOR
  7. varying vec4 vColor;
  8. #endif
  9. varying vec4 vVertexLighting;
  10. void main()
  11. {
  12. #ifdef DIFFMAP
  13. vec4 diffColor = cMatDiffColor * texture2D(sDiffMap, vTexCoord);
  14. #else
  15. vec4 diffColor = cMatDiffColor;
  16. #endif
  17. #ifdef VERTEXCOLOR
  18. diffColor *= vColor;
  19. #endif
  20. vec3 finalColor = vVertexLighting.rgb * diffColor.rgb;
  21. gl_FragColor = vec4(GetFog(finalColor, vVertexLighting.a), diffColor.a);
  22. }