sebavan 6 éve
szülő
commit
a61a5df596

+ 2 - 2
src/Engines/engine.ts

@@ -1081,8 +1081,6 @@ export class Engine {
             }
 
             canvas = <HTMLCanvasElement>canvasOrContext;
-            this._sharedInit(canvas, !!options.doNotHandleTouchAction, options.audioEngine);
-
             // GL
             if (!options.disableWebGL2Support) {
                 try {
@@ -1117,6 +1115,8 @@ export class Engine {
                 throw new Error("WebGL not supported");
             }
 
+            this._sharedInit(canvas, !!options.doNotHandleTouchAction, options.audioEngine);
+
             // Ensures a consistent color space unpacking of textures cross browser.
             this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE);
 

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

@@ -1657,7 +1657,9 @@ export abstract class PBRBaseMaterial extends PushMaterial {
         this._activeEffect = effect;
 
         // Matrices
+        // TODO WEBGPU. Find a better approach.
         mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
+        mesh.transferToEffect(world);
 
         // Matrices
         if (!defines.INSTANCES) {

+ 2 - 2
src/Meshes/abstractMesh.ts

@@ -683,7 +683,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     protected _buildUniformLayout(): void {
         this._uniformBuffer.addUniform("world", 16);
         this._uniformBuffer.addUniform("visibility", 1);
-        // TODO. Bones
+        // TODO WEBGPU. Bones.
         this._uniformBuffer.create();
     }
 
@@ -697,7 +697,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         ubo.updateMatrix("world", world);
         ubo.updateFloat("visibility", this._internalAbstractMeshDataInfo._visibility);
 
-        // TODO. Bones.
+        // TODO WEBGPU. Bones.
 
         ubo.update();
     }

+ 0 - 4
src/Meshes/mesh.ts

@@ -1694,10 +1694,6 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         }
 
         var world = effectiveMesh.getWorldMatrix();
-
-        // TODO WEBGPU. Find a better approach.
-        this.transferToEffect(world);
-
         if (this._effectiveMaterial._storeEffectOnSubMeshes) {
             this._effectiveMaterial.bindForSubMesh(world, this, subMesh);
         } else {