FXAA.glsl 603 B

123456789101112131415161718192021
  1. varying vec2 v_textureCoordinates;
  2. uniform sampler2D colorTexture;
  3. const float fxaaQualitySubpix = 0.5;
  4. const float fxaaQualityEdgeThreshold = 0.125;
  5. const float fxaaQualityEdgeThresholdMin = 0.0833;
  6. void main()
  7. {
  8. vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
  9. vec4 color = FxaaPixelShader(
  10. v_textureCoordinates,
  11. colorTexture,
  12. fxaaQualityRcpFrame,
  13. fxaaQualitySubpix,
  14. fxaaQualityEdgeThreshold,
  15. fxaaQualityEdgeThresholdMin);
  16. float alpha = texture2D(colorTexture, v_textureCoordinates).a;
  17. gl_FragColor = vec4(color.rgb, alpha);
  18. }