Skip to content

Commit

Permalink
Make voxelization trigger after render
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Bond committed Nov 13, 2024
1 parent 2728883 commit 3df51dd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ export class _IblShadowsVoxelRenderer {
if (this._voxelDebugEnabled) {
this._addRTsForRender([this._voxelSlabDebugRT], includedMeshes, this._voxelDebugAxis, 1, true);
}
this._scene.onAfterRenderTargetsRenderObservable.addOnce(this._renderVoxelGrid.bind(this));
this._scene.onAfterRenderObservable.addOnce(this._renderVoxelGrid.bind(this));
}

private _renderVoxelGrid() {
Expand All @@ -656,7 +656,6 @@ export class _IblShadowsVoxelRenderer {
this._generateMipMaps();
this._copyMipMaps();
this._voxelizationInProgress = false;
this._scene.onAfterRenderTargetsRenderObservable.removeCallback((this as any).boundVoxelGridRenderFn);
} else if (!this._renderInFlight) {
this._renderInFlight = true;
setTimeout(() => {
Expand Down

0 comments on commit 3df51dd

Please sign in to comment.