Selaa lähdekoodia

avoid converting to linear space in shader

Trevor Baron 7 vuotta sitten
vanhempi
commit
b4e49da8e7

+ 1 - 1
src/PostProcess/babylon.extractHighlightsPostProcess.ts

@@ -17,7 +17,7 @@ module BABYLON {
                 if(this._inputPostProcess){
                     effect.setTextureFromPostProcess("textureSampler", this._inputPostProcess);
                 }
-                effect.setFloat('threshold', this.threshold);
+                effect.setFloat('threshold', Math.pow(this.threshold, BABYLON.ToGammaSpace));
             })
         }
     }

+ 1 - 1
src/Shaders/extractHighlights.fragment.fx

@@ -8,6 +8,6 @@ uniform float threshold;
 void main(void) 
 {
 	gl_FragColor = texture2D(textureSampler, vUV);
-	float luma = getLuminance(toLinearSpace(gl_FragColor.rgb));
+	float luma = getLuminance(gl_FragColor.rgb);
 	gl_FragColor.rgb = step(threshold, luma) * gl_FragColor.rgb;
 }