Skip to content

Commit

Permalink
Merge branch 'fix/autoconversion' of https://github.com/simularium/si…
Browse files Browse the repository at this point in the history
…mularium-viewer into feature/isimulator
  • Loading branch information
interim17 committed Jan 8, 2025
2 parents e75a7e8 + 13555ef commit 5ca0505
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 62 deletions.
28 changes: 8 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v3.9.0](https://github.com/simularium/simularium-viewer/compare/v3.8.4...v3.9.0)
#### [v3.9.1](https://github.com/simularium/simularium-viewer/compare/v3.8.2...v3.9.1)

- Bump three to r171 [`#436`](https://github.com/simularium/simularium-viewer/pull/436)
- replace Jest with vitest and use "type":"module" [`#431`](https://github.com/simularium/simularium-viewer/pull/431)
- Bounding box toggle in tweakpane [`#434`](https://github.com/simularium/simularium-viewer/pull/434)
- test-bed fixes [`#432`](https://github.com/simularium/simularium-viewer/pull/432)
- testbed file organization [`#429`](https://github.com/simularium/simularium-viewer/pull/429)
- fix test bed download button [`#427`](https://github.com/simularium/simularium-viewer/pull/427)
- remove pauseOn property [`#425`](https://github.com/simularium/simularium-viewer/pull/425)
Expand All @@ -19,46 +22,31 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Bump express from 4.19.2 to 4.21.0 in /examples [`#414`](https://github.com/simularium/simularium-viewer/pull/414)
- remove unused references to colorchange interface [`#410`](https://github.com/simularium/simularium-viewer/pull/410)
- code cleanup: dragAndDrop and JSON caching code [`#409`](https://github.com/simularium/simularium-viewer/pull/409)
- npm won't install anything until I bump ts-jest [`19fa8f6`](https://github.com/simularium/simularium-viewer/commit/19fa8f6ffdb2ad56fbcee70649098ef54ada4476)
- more package wrangling to fix tests (where was lodash?!) [`efa53fc`](https://github.com/simularium/simularium-viewer/commit/efa53fcf64e770c38fb036b1d5561c62450c8284)
- bump rimraf too, since it was complaining [`bce9f7e`](https://github.com/simularium/simularium-viewer/commit/bce9f7edc9762c10e9c321709d1751e871bf12e7)

#### [v3.8.4](https://github.com/simularium/simularium-viewer/compare/v3.8.3...v3.8.4)

> 22 August 2024
- Feature/session colors [`#400`](https://github.com/simularium/simularium-viewer/pull/400)
- export AgentData type properly from /types and / simularium [`#401`](https://github.com/simularium/simularium-viewer/pull/401)
- Bump ws from 7.5.9 to 7.5.10 [`#399`](https://github.com/simularium/simularium-viewer/pull/399)
- Bump braces from 3.0.2 to 3.0.3 in /examples [`#398`](https://github.com/simularium/simularium-viewer/pull/398)
- Bump ws from 8.16.0 to 8.17.1 in /examples [`#397`](https://github.com/simularium/simularium-viewer/pull/397)
- convert vis-type to visType at parse time [`#393`](https://github.com/simularium/simularium-viewer/pull/393)

#### [v3.8.3](https://github.com/simularium/simularium-viewer/compare/v3.8.2...v3.8.3)

> 13 June 2024
- Fix/null agent function [`#396`](https://github.com/simularium/simularium-viewer/pull/396)
- spread null agent object when parsing frames [`#395`](https://github.com/simularium/simularium-viewer/pull/395)
- send selected agent data to front end [`#392`](https://github.com/simularium/simularium-viewer/pull/392)
- remove happy-dom [`a7ebd57`](https://github.com/simularium/simularium-viewer/commit/a7ebd57b262ad6222420a8960e169b85797a07aa)
- update package-lock [`f43acf6`](https://github.com/simularium/simularium-viewer/commit/f43acf604ea609c6b71d25ccecbad72844d6a241)
- update some test config [`7dde5d4`](https://github.com/simularium/simularium-viewer/commit/7dde5d4e209b5db30c66d7aa08de3e00bb691ba0)

#### [v3.8.2](https://github.com/simularium/simularium-viewer/compare/v3.8.1...v3.8.2)

> 10 June 2024
- Fix/remove simularium engine specific code [`#391`](https://github.com/simularium/simularium-viewer/pull/391)

#### [v3.8.1](https://github.com/simularium/simularium-viewer/compare/v3.8.0...v3.8.1)
#### [v3.8.1](https://github.com/simularium/simularium-viewer/compare/v3.7.4...v3.8.1)

> 3 June 2024
- With octopus, we can assume frame per message [`#390`](https://github.com/simularium/simularium-viewer/pull/390)
- update cache setting [`#388`](https://github.com/simularium/simularium-viewer/pull/388)

#### [v3.8.0](https://github.com/simularium/simularium-viewer/compare/v3.7.4...v3.8.0)

> 23 May 2024
- Fix/plotdata [`#386`](https://github.com/simularium/simularium-viewer/pull/386)
- Feature/trim cache head [`#381`](https://github.com/simularium/simularium-viewer/pull/381)

Expand Down
17 changes: 12 additions & 5 deletions examples/src/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,21 @@ class Viewer extends React.Component<InputParams, ViewerState> {

public receiveConvertedFile(): void {
simulariumController
.changeFile({
netConnectionSettings: this.netConnectionSettings,

}, this.state.conversionFileName)
.changeFile(
{
netConnectionSettings: this.netConnectionSettings,
},
this.state.conversionFileName
)
.then(() => {
simulariumController.gotoTime(0);
})
.then(() => this.setState({ conversionActive: false, conversionFileName: "" }))
.then(() =>
this.setState({
conversionActive: false,
conversionFileName: "",
})
)
.catch((e) => {
console.warn(e);
});
Expand Down
64 changes: 53 additions & 11 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aics/simularium-viewer",
"version": "3.9.0",
"version": "3.9.1",
"description": "An npm package to view simulations.",
"main": "es/index.js",
"type": "module",
Expand Down 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

0 comments on commit 5ca0505

Please sign in to comment.