/Resources/shaders/pointLighting.fsh

http://github.com/tartiflop/ojgl · Fragment Shader File · 19 lines · 14 code · 5 blank · 0 comment · 2 complexity · f6c2ee1fb69a1afe2b306a52f0094d16 MD5 · raw file

  1. varying vec4 v_color;
  2. varying vec4 v_specular;
  3. varying vec2 v_texCoord;
  4. uniform sampler2D s_texture;
  5. uniform bool u_useTexture;
  6. void main() {
  7. vec4 color;
  8. if (u_useTexture) {
  9. color = texture2D(s_texture, v_texCoord) * v_color;
  10. } else {
  11. color = v_color;
  12. }
  13. gl_FragColor = color + v_specular;
  14. }