Skip to content

Commit

Permalink
camera zoom affects ao but not depth cueing
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed Oct 23, 2023
1 parent 2bdec9d commit e196dd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/visGeometry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,8 @@ class VisGeometry {
this.renderer.setNearFar(
this.boxNearZ,
this.boxFarZ,
maxDim * this.camera.zoom
maxDim,
this.camera.zoom
);
this.boundingBoxMesh.visible = false;
this.tickMarksMesh.visible = false;
Expand Down
12 changes: 10 additions & 2 deletions src/visGeometry/rendering/SimulariumRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SimulariumRenderer {
private boundsNear: number;
private boundsFar: number;
private boundsMaxDim: number;
private cameraZoom: number;

public constructor() {
this.parameters = {
Expand Down Expand Up @@ -99,6 +100,7 @@ class SimulariumRenderer {
this.boundsNear = 0.0;
this.boundsFar = 100.0;
this.boundsMaxDim = 100.0;
this.cameraZoom = 1.0;

this.gbufferPass = new GBufferPass();

Expand Down Expand Up @@ -322,10 +324,16 @@ class SimulariumRenderer {
this.drawBufferPass.resize(x, y);
}

public setNearFar(n: number, f: number, boxMaxDim: number): void {
public setNearFar(
n: number,
f: number,
boxMaxDim: number,
cameraZoom: number
): void {
this.boundsNear = n;
this.boundsFar = f;
this.boundsMaxDim = boxMaxDim;
this.cameraZoom = cameraZoom;
}

public render(
Expand All @@ -343,7 +351,7 @@ class SimulariumRenderer {
this.ssao1Pass.pass.material.uniforms.intensity.value =
this.parameters.ao1.intensity;
this.ssao1Pass.pass.material.uniforms.scale.value =
(this.parameters.ao1.scale * sceneSize) / 100.0;
(this.parameters.ao1.scale * sceneSize * this.cameraZoom) / 100.0;
this.ssao1Pass.pass.material.uniforms.kernelRadius.value =
this.parameters.ao1.kernelRadius;
this.ssao1Pass.pass.material.uniforms.minResolution.value =
Expand Down

0 comments on commit e196dd5

Please sign in to comment.