Skip to content

Commit

Permalink
fix(GlobalUniformGroup):GlobalUniformGroup bound to the wrong property (
Browse files Browse the repository at this point in the history
Orillusion#399)

* fix(GlobalUniformGroup):GlobalUniformGroup bound to the wrong property

* fix this error in another method

---------

Co-authored-by: ShuangLiu <[email protected]>
  • Loading branch information
OriIIusion and lslzl3000 authored Jul 10, 2024
1 parent b3e9194 commit 3a2c72b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/gfx/graphics/webGpu/core/bindGroups/GlobalUniformGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
}
}
]
});
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -230,4 +229,6 @@ export class GlobalUniformGroup {

this.uniformGPUBuffer.apply();
}

public setShadowLight() {}
}

0 comments on commit 3a2c72b

Please sign in to comment.