Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump three to r171 #436

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 51 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/lodash": "^4.14.175",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@types/three": "^0.144.0",
"@types/three": "^0.170.0",
"@typescript-eslint/eslint-plugin": "~8.15.0",
"@typescript-eslint/parser": "~8.15.0",
"@vitest/coverage-v8": "^2.1.5",
Expand Down Expand Up @@ -105,7 +105,7 @@
"mp4-muxer": "^2.2.2",
"parse-pdb": "^1.0.0",
"si-prefix": "^0.2.0",
"three": "^0.144.0",
"three": "^0.171.0",
"tweakpane": "^3.0.7"
}
}
2 changes: 1 addition & 1 deletion src/viewport/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Viewport extends React.Component<
this.lastRenderTime = Date.now();
this.startTime = Date.now();
this.onPickObject = this.onPickObject.bind(this);
this.stats = Stats();
this.stats = new Stats();
this.stats.showPanel(1);

this.handlers = {
Expand Down
4 changes: 2 additions & 2 deletions src/visGeometry/rendering/GBufferPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Points,
Scene,
WebGLRenderer,
WebGLMultipleRenderTargets,
WebGLRenderTarget,
} from "three";

// strategy:
Expand Down Expand Up @@ -72,7 +72,7 @@ class GBufferPass {
renderer: WebGLRenderer,
scene: Scene,
camera: PerspectiveCamera | OrthographicCamera,
gbuffer: WebGLMultipleRenderTargets
gbuffer: WebGLRenderTarget
): void {
const c = renderer.getClearColor(new Color()).clone();
const a = renderer.getClearAlpha();
Expand Down
39 changes: 19 additions & 20 deletions src/visGeometry/rendering/SimulariumRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
PerspectiveCamera,
RGBAFormat,
Scene,
WebGLMultipleRenderTargets,
WebGLRenderer,
WebGLRenderTarget,
} from "three";
Expand Down Expand Up @@ -60,7 +59,7 @@ class SimulariumRenderer {
public compositePass: CompositePass;
public contourPass: ContourPass;
public drawBufferPass: DrawBufferPass;
public gbuffer: WebGLMultipleRenderTargets;
public gbuffer: WebGLRenderTarget;
private hitTestHelper: HitTestHelper;
public blurIntermediateBuffer: WebGLRenderTarget;
public ssaoBuffer: WebGLRenderTarget;
Expand Down Expand Up @@ -120,18 +119,18 @@ class SimulariumRenderer {
this.drawBufferPass = new DrawBufferPass();

// buffers:
this.gbuffer = new WebGLMultipleRenderTargets(2, 2, 3);
for (let i = 0, il = this.gbuffer.texture.length; i < il; i++) {
this.gbuffer.texture[i].minFilter = NearestFilter;
this.gbuffer.texture[i].magFilter = NearestFilter;
this.gbuffer.texture[i].format = RGBAFormat;
this.gbuffer.texture[i].type = FloatType;
this.gbuffer.texture[i].generateMipmaps = false;
}
this.gbuffer = new WebGLRenderTarget(2, 2, {
count: 3,
minFilter: NearestFilter,
magFilter: NearestFilter,
format: RGBAFormat,
type: FloatType,
generateMipmaps: false,
});
// Name our G-Buffer attachments for debugging
this.gbuffer.texture[AGENTBUFFER].name = "agentinfo";
this.gbuffer.texture[NORMALBUFFER].name = "normal";
this.gbuffer.texture[POSITIONBUFFER].name = "position";
this.gbuffer.textures[AGENTBUFFER].name = "agentinfo";
this.gbuffer.textures[NORMALBUFFER].name = "normal";
this.gbuffer.textures[POSITIONBUFFER].name = "position";

this.hitTestHelper = new HitTestHelper();

Expand Down Expand Up @@ -276,7 +275,7 @@ class SimulariumRenderer {
}

public hitTest(renderer: WebGLRenderer, x: number, y: number): number {
const tex = this.gbuffer.texture[AGENTBUFFER];
const tex = this.gbuffer.textures[AGENTBUFFER];
const pixel = this.hitTestHelper.hitTest(
renderer,
tex,
Expand Down Expand Up @@ -411,14 +410,14 @@ class SimulariumRenderer {
renderer,
camera,
this.ssaoBuffer,
this.gbuffer.texture[NORMALBUFFER],
this.gbuffer.texture[POSITIONBUFFER]
this.gbuffer.textures[NORMALBUFFER],
this.gbuffer.textures[POSITIONBUFFER]
);
this.blur1Pass.render(
renderer,
this.ssaoBufferBlurred,
this.ssaoBuffer,
this.gbuffer.texture[POSITIONBUFFER],
this.gbuffer.textures[POSITIONBUFFER],
this.blurIntermediateBuffer
);

Expand All @@ -433,16 +432,16 @@ class SimulariumRenderer {
compositeTarget,
this.ssaoBufferBlurred,
this.ssaoBufferBlurred2,
this.gbuffer.texture[AGENTBUFFER]
this.gbuffer.textures[AGENTBUFFER]
);

this.contourPass.render(
renderer,
target,
compositeTarget,
// this is the buffer with the instance ids and fragdepth!
this.gbuffer.texture[AGENTBUFFER],
this.gbuffer.texture[NORMALBUFFER]
this.gbuffer.textures[AGENTBUFFER],
this.gbuffer.textures[NORMALBUFFER]
);

// DEBUGGING some of the intermediate buffers:
Expand Down
Loading