Benjamin Guignabert 5 anni fa
parent
commit
d4e97cde07

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

@@ -1758,7 +1758,6 @@ export abstract class PBRBaseMaterial extends PushMaterial {
         }
 
         this._activeEffect = effect;
-        let ubo = this._uniformBuffer;
 
         // Matrices
         if (!defines.INSTANCES || defines.THIN_INSTANCES) {
@@ -1778,6 +1777,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
         MaterialHelper.BindBonesParameters(mesh, this._activeEffect, this.prePassConfiguration);
 
         let reflectionTexture: Nullable<BaseTexture> = null;
+        let ubo = this._uniformBuffer;
         if (mustRebind) {
             var engine = scene.getEngine();
             ubo.bindToEffect(effect, "Material");

+ 3 - 0
src/PostProcesses/motionBlurPostProcess.ts

@@ -153,6 +153,9 @@ export class MotionBlurPostProcess extends PostProcess {
      * @param camera The camera to dispose the post process on.
      */
     public dispose(camera?: Camera): void {
+        // TODO clear for motion blur configuration
+        // Mark prepass as dirty too
+
         if (this._geometryBufferRenderer) {
             // Clear previous transformation matrices dictionary used to compute objects velocities
             this._geometryBufferRenderer._previousTransformationMatrices = {};

+ 5 - 0
src/Shaders/geometry.vertex.fx

@@ -58,6 +58,11 @@ varying vec3 vPositionW;
 #ifdef VELOCITY
 uniform mat4 previousWorld;
 uniform mat4 previousViewProjection;
+#ifdef BONES_VELOCITY_ENABLED
+#if NUM_BONE_INFLUENCERS > 0
+uniform mat4 mPreviousBones[BonesPerMesh];
+#endif
+#endif
 
 varying vec4 vCurrentPosition;
 varying vec4 vPreviousPosition;