Bläddra i källkod

Merge pull request #9349 from CraigFeldspar/master

disableGammaTransform in prepass
David Catuhe 4 år sedan
förälder
incheckning
ef85eb243e
1 ändrade filer med 8 tillägg och 1 borttagningar
  1. 8 1
      src/Rendering/prePassRenderer.ts

+ 8 - 1
src/Rendering/prePassRenderer.ts

@@ -164,6 +164,13 @@ export class PrePassRenderer {
     }
     }
 
 
     /**
     /**
+     * Set to true to disable gamma transform in PrePass.
+     * Can be useful in case you already proceed to gamma transform on a material level
+     * and your post processes don't need to be in linear color space.
+     */
+    public disableGammaTransform = false;
+
+    /**
      * Instanciates a prepass renderer
      * Instanciates a prepass renderer
      * @param scene The scene
      * @param scene The scene
      */
      */
@@ -435,7 +442,7 @@ export class PrePassRenderer {
 
 
         }
         }
 
 
-        if (!isIPPAlreadyPresent) {
+        if (!isIPPAlreadyPresent && !this.disableGammaTransform) {
             this._postProcesses.push(this.imageProcessingPostProcess);
             this._postProcesses.push(this.imageProcessingPostProcess);
         }
         }
         this._bindPostProcessChain();
         this._bindPostProcessChain();