Sfoglia il codice sorgente

fixing alpha going negative in the fireflies shader

Justin Gilman 3 settimane fa
parent
commit
835d9d6a34
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      shaders/firefly/fragment.glsl

+ 1 - 1
shaders/firefly/fragment.glsl

@@ -2,7 +2,7 @@ void main()
 {
     float distanceToCenter = distance(gl_PointCoord, vec2(0.5));
     float strength = 0.05 / distanceToCenter - 0.1;
-    gl_FragColor = vec4(1.0, 1.0, 1.0, strength);
+    gl_FragColor = vec4(1.0, 1.0, 1.0, clamp(strength, 0.0, 1.0));
 
     #include <tonemapping_fragment>
     #include <colorspace_fragment>