소스 검색

Flip order of afterBind / ubo.update() in case afterBind update the ubo

Popov72 4 년 전
부모
커밋
8655ea6215
3개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      src/Materials/Background/backgroundMaterial.ts
  2. 2 2
      src/Materials/PBR/pbrBaseMaterial.ts
  3. 1 2
      src/Materials/standardMaterial.ts

+ 2 - 2
src/Materials/Background/backgroundMaterial.ts

@@ -1149,9 +1149,9 @@ export class BackgroundMaterial extends PushMaterial {
             }
         }
 
-        this._uniformBuffer.update();
-
         this._afterBind(mesh, this._activeEffect);
+
+        this._uniformBuffer.update();
     }
 
     /**

+ 2 - 2
src/Materials/PBR/pbrBaseMaterial.ts

@@ -2078,9 +2078,9 @@ export abstract class PBRBaseMaterial extends PushMaterial {
             MaterialHelper.BindLogDepth(defines, this._activeEffect, scene);
         }
 
-        ubo.update();
-
         this._afterBind(mesh, this._activeEffect);
+
+        ubo.update();
     }
 
     /**

+ 1 - 2
src/Materials/standardMaterial.ts

@@ -1377,7 +1377,6 @@ export class StandardMaterial extends PushMaterial {
         mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
         mesh.transferToEffect(world);
 
-
         // PrePass
         this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
 
@@ -1601,8 +1600,8 @@ export class StandardMaterial extends PushMaterial {
             }
         }
 
-        ubo.update();
         this._afterBind(mesh, this._activeEffect);
+        ubo.update();
     }
 
     /**