Skip to content

Commit

Permalink
fix(GlobalUniformGroup):GlobalUniformGroup bound to the wrong property
Browse files Browse the repository at this point in the history
  • Loading branch information
OriIIusion committed May 16, 2024
1 parent 1ab8718 commit e4f8c8c
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class GlobalUniformGroup {
public pointShadowEnd = 0;

/**
*
* @param matrixBindGroup global matrix bindgroup
*
* @param matrixBindGroup global matrix bindgroup
*/
constructor(matrixBindGroup: MatrixBindGroup) {
this.uuid = UUID();
Expand Down Expand Up @@ -65,23 +65,21 @@ export class GlobalUniformGroup {
resource: {
buffer: this.uniformGPUBuffer.buffer,
offset: 0, // this.uniformGPUBuffer.memory.shareDataBuffer.byteOffset,
size: this.uniformByteLength,
},
size: this.uniformByteLength
}
},
{
binding: 1,
resource: {
buffer: this.matrixBindGroup.matrixBufferDst.buffer,
offset: 0,
size: this.matrixesByteLength,
},
},
],
size: this.matrixesByteLength
}
}
]
});
}



public setCamera(camera: Camera3D) {
this.uniformGPUBuffer.setMatrix(`_projectionMatrix`, camera.projectionMatrix);
this.uniformGPUBuffer.setMatrix(`_viewMatrix`, camera.viewMatrix);
Expand Down Expand Up @@ -117,7 +115,7 @@ export class GlobalUniformGroup {

this.uniformGPUBuffer.setVector3(`CameraPos`, camera.transform.worldPosition);
this.uniformGPUBuffer.setFloat(`frame`, Time.frame);
this.uniformGPUBuffer.setFloat(`time`, Time.frame);
this.uniformGPUBuffer.setFloat(`time`, Time.time);
this.uniformGPUBuffer.setFloat(`delta`, Time.delta);
// this.uniformGPUBuffer.setFloat(`shadowBias`, Engine3D.setting.shadow.shadowBias);
this.uniformGPUBuffer.setFloat(`shadowBias`, camera.getShadowBias(shadowMapSize));
Expand Down Expand Up @@ -214,7 +212,5 @@ export class GlobalUniformGroup {
this.uniformGPUBuffer.apply();
}

public setShadowLight() { }


public setShadowLight() {}
}

0 comments on commit e4f8c8c

Please sign in to comment.