-
Notifications
You must be signed in to change notification settings - Fork 299
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
DebugTilesPlugin: add the displayParentBounds option (#730) #893
DebugTilesPlugin: add the displayParentBounds option (#730) #893
Conversation
@gkjohnson the default example is not ideal to test it since the child bounds tightly fit in the parent bounds. Do you have an example where there is more loose space between parent/child bounds ? |
337a79a
to
86c9b4d
Compare
Nevermind I just realized that we could pass arbitrary URLs in the example |
7819583
to
45c6181
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - a couple comments. I'm hoping this can be used to help understand what's happening in #844.
As expected it can look a bit messy but this is great progress
material.linewidth = 4; | ||
material.opacity = 0.2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to avoid using line width so we're consistent between platforms - it's not working on my machine, for eample. As you say it looks like we'll need a better treatment for these lines, though, so they're more distinguishable. The random colors for each depth tier don't really help, either. But I think we can evolve this as it's actually used for debugging stuff - the logic for toggling parents is great to have added, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the line width change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the top of my heads, here are a few ideas to help visualize the relationship between parent and child bounds:
- optionally connecting lines between the center of the parent bounds to the centers of child bounds, the result would look like some kind of "nervous system", that would help figuring the structure of the hierarchy
- using materials that support dashes and use dashed lines for intermediate bounds
- optionally, when hovering a tile (using raycasting), display only the bounds of the sub-tree that this tile belongs to, up to the root tile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optionally, when hovering a tile (using raycasting), display only the bounds of the sub-tree that this tile belongs to, up to the root tile
This one I think would probably be the most useful. I think the other visual treatments for the parent or child lines will be really noisy and a bit difficult to understand. I'll merge this for now and we can consider this in the future
// compute the vertex normals so we can get the edge normals | ||
geometry.computeVertexNormals(); | ||
if ( computeNormals ) { | ||
|
||
// compute the vertex normals so we can get the edge normals | ||
geometry.computeVertexNormals(); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When profiling a tileset with region bounds, I noticed that the biggest performance hit was computing normals for ellipsoid helpers. However, the line-based variant of the helper do not need normals AFAIK.
45c6181
to
b4bceeb
Compare
Very nice work! Thanks for the addition |
This PR fixes #730.
Adds the
.displayParentBounds
property to display the bounds of tiles between the root tile and the first visible tile.The helpers for the intermediate bounds use
a thicker line andsemi-transparent materials to help distinguishing them from the "leaf" tiles.Note: not all GPUs support thick lines (see the comment in the three.js doc), so on some platforms the line will remain 1-pixel thick. The alternative would be to use different materials, but that would increase complexity and maintenance.This uses a reference counting mechanism as suggested in #730.