From 3a2c72bacdd9bd0320e90f2d6c15a2640a4ebaf3 Mon Sep 17 00:00:00 2001 From: OriIIusion <39576034+OriIIusion@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:12:17 +0800 Subject: [PATCH] fix(GlobalUniformGroup):GlobalUniformGroup bound to the wrong property (#399) * fix(GlobalUniformGroup):GlobalUniformGroup bound to the wrong property * fix this error in another method --------- Co-authored-by: ShuangLiu --- .../core/bindGroups/GlobalUniformGroup.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts b/src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts index faaaaaa4..311d4360 100644 --- a/src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts +++ b/src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts @@ -38,8 +38,8 @@ export class GlobalUniformGroup { public pointShadowEnd = 0; /** - * - * @param matrixBindGroup global matrix bindgroup + * + * @param matrixBindGroup global matrix bindgroup */ constructor(matrixBindGroup: MatrixBindGroup) { this.uuid = UUID(); @@ -67,18 +67,18 @@ 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 + } + } + ] }); } @@ -131,8 +131,7 @@ export class GlobalUniformGroup { this.uniformGPUBuffer.setVector3(`CameraPos`, camera.transform.worldPosition); this.uniformGPUBuffer.setFloat(`frame`, Time.frame); this.uniformGPUBuffer.setFloat32Array(`SH`, camera.sh); - - this.uniformGPUBuffer.setFloat(`time`, Time.frame); + this.uniformGPUBuffer.setFloat(`time`, Time.time); this.uniformGPUBuffer.setFloat(`delta`, Time.delta); this.uniformGPUBuffer.setFloat(`shadowBias`, camera.getShadowBias(shadowMapSize)); this.uniformGPUBuffer.setFloat(`skyExposure`, Engine3D.setting.sky.skyExposure); @@ -196,7 +195,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(`skyExposure`, Engine3D.setting.sky.skyExposure); @@ -230,4 +229,6 @@ export class GlobalUniformGroup { this.uniformGPUBuffer.apply(); } + + public setShadowLight() {} }