degraded_ibl.frag 455 B

12345678910111213141516171819
  1. uniform sampler2D ntex;
  2. out vec4 Diff;
  3. out vec4 Spec;
  4. vec3 DecodeNormal(vec2 n);
  5. vec4 getPosFromUVDepth(vec3 uvDepth, mat4 InverseProjectionMatrix);
  6. vec3 DiffuseIBL(vec3 normal);
  7. vec3 SpecularIBL(vec3 normal, vec3 V, float roughness);
  8. void main(void)
  9. {
  10. vec2 uv = gl_FragCoord.xy / screen;
  11. vec3 normal = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.));
  12. Diff = vec4(0.25 * DiffuseIBL(normal), 1.);
  13. Spec = vec4(0., 0., 0., 1.);
  14. }