Browse Source

Move state changes to applyEffectWrapper

Popov72 5 years ago
parent
commit
81231b3d98
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/Materials/effectRenderer.ts

+ 2 - 4
src/Materials/effectRenderer.ts

@@ -82,6 +82,8 @@ export class EffectRenderer {
      * @param effectWrapper Defines the effect to draw with
      * @param effectWrapper Defines the effect to draw with
      */
      */
     public applyEffectWrapper(effectWrapper: EffectWrapper): void {
     public applyEffectWrapper(effectWrapper: EffectWrapper): void {
+        this.engine.depthCullingState.depthTest = false;
+        this.engine.stencilState.stencilTest = false;
         this.engine.enableEffect(effectWrapper.effect);
         this.engine.enableEffect(effectWrapper.effect);
         this.bindBuffers(effectWrapper.effect);
         this.bindBuffers(effectWrapper.effect);
         effectWrapper.onApplyObservable.notifyObservers({});
         effectWrapper.onApplyObservable.notifyObservers({});
@@ -109,10 +111,6 @@ export class EffectRenderer {
             return ;
             return ;
         }
         }
 
 
-        // No need here for full screen render.
-        this.engine.depthCullingState.depthTest = false;
-        this.engine.stencilState.stencilTest = false;
-
         // Reset state
         // Reset state
         this.setViewport();
         this.setViewport();