ProcSky.glsl 367 B

1234567891011121314151617181920
  1. #include "Uniforms.glsl"
  2. #include "Samplers.glsl"
  3. #include "Transform.glsl"
  4. varying vec3 EyeV;
  5. void VS()
  6. {
  7. EyeV = iNormal;
  8. gl_Position = iPos;
  9. }
  10. void PS()
  11. {
  12. vec3 V = normalize( EyeV ) + vec3(0,.2,0);
  13. vec2 lt = vec2( (1.0 + normalize( V.xz ).y) / 2.0, 1.0 - normalize( V ).y );
  14. gl_FragColor = texture2D( sDiffMap, lt );
  15. }