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

feat(graphene): multiscale meshes #460

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

akhileshh
Copy link
Contributor

No description provided.

@@ -3,272 +3,67 @@ name: Build
on: [push, pull_request]

jobs:
client:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you intended to include the changes in this file.

@@ -0,0 +1,32 @@
runtime: python27
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not intended to be included in this PR.

@@ -0,0 +1,6 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intended for this PR.

@@ -68,7 +68,7 @@ export async function decodeDracoPartitioned(
heap.set(buffer, offset);
numPartitions = partition ? 8 : 1;
const code = (m.instance.exports.neuroglancer_draco_decode as Function)(
offset, buffer.byteLength, partition, vertexQuantizationBits, true);
offset, buffer.byteLength, partition, vertexQuantizationBits, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be an option, since we don't want to change this option for the neuroglancer precomputed datasource.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I will do that when the PR is ready to merge. This was just to get the meshes to appear during development.

@@ -44,14 +44,15 @@ import { SharedWatchableValue } from 'neuroglancer/shared_watchable_value';
import { DisplayDimensionRenderInfo } from 'neuroglancer/navigation_state';
import { forEachVisibleSegment } from 'neuroglancer/segmentation_display_state/base';
import { computeChunkBounds } from 'neuroglancer/sliceview/volume/backend';
import { verifyObject } from 'src/neuroglancer/util/json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 'neuroglancer/util/json' -- no 'src/' prefix.

lodScales: new Float32Array(response.lodScales),
octree: new Uint32Array(response.octree),
vertexOffsets: new Float32Array(response.lodScales.length * 3),
clipLowerBound: vec3.create(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why the meshes aren't displaying properly --- the mesh rendering code calculates bounds for each octree node by calculating the bounds of the node according to the grid, and then restricting them by these overall clip bounds. If the resultant bounding box does not intersect the view frustum, then the octree node won't be rendered. With these values for the clip bounds, all of the calculated bounds end up being (0, 0, 0)---(0,0,0), which both defeats the normal logic of selectively rendering only visible chunks, and also means if the view frustum does not contain (0, 0, 0) then nothing will be rendered.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't have the real bounds available, but you can just calculate the bounds that include all of the fragments present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have pushed changes and updated the chunkedgraph deployment to return clip bounds.

Realized that zoom-out disappearance is being caused by resolution, changing it fixes that. But this means higher resolution meshes are loaded earlier than expected.

Currently chunkedgraph is passing bounding box of the dataset for clip lower and upper bounds. Should that fix the above issue? It doesn't look like it does though, I'm not familiar with webGL.

@akhileshh akhileshh force-pushed the graphene-multiscale-meshes branch from 23a25a6 to be12f35 Compare May 4, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants