opengl_vertex.glsl 474 B

1234567891011121314151617181920212223242526
  1. #ifdef ENABLE_AUTO_EXPOSURE
  2. #define exposureMap texture1
  3. uniform sampler2D exposureMap;
  4. varying float exposure;
  5. #endif
  6. #ifdef GL_ES
  7. varying mediump vec2 varTexCoord;
  8. #else
  9. centroid varying vec2 varTexCoord;
  10. #endif
  11. void main(void)
  12. {
  13. #ifdef ENABLE_AUTO_EXPOSURE
  14. // value in the texture is on a logarithtmic scale
  15. exposure = texture2D(exposureMap, vec2(0.5)).r;
  16. exposure = pow(2., exposure);
  17. #endif
  18. varTexCoord.st = inTexCoord0.st;
  19. gl_Position = inVertexPosition;
  20. }