-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
3D Tiles - Support batch table binary #4228
Conversation
In the Sandcastle example with the new batched point cloud, picking works well when zoomed out, but when zoomed in, it often flickers between the back and front faces of the sphere as the mouse moves, which is expected. No action now, but when we do, for example, the edge-preserving blur, we'll need to determine how to "blur" the pick ids, e.g., think more like nearest texture filtering, not linear. |
* | ||
* @exception {DeveloperError} name is not a valid value. | ||
*/ | ||
ComponentDatatype.fromName = function(name) { |
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.
Add to CHANGES.md since this is a public class.
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.
Could also cherry-pick this into master.
Can you verify that test coverage is solid? Looks great! |
I should be able to make this better by using normals and doing back-face culling on the points. |
Ah..... I accidentally committed some large pnts tiles, I'll squash my changes with smaller versions. |
ee2dc07
to
2806d11
Compare
Very nice. |
Do you still plan to do this in this PR?
|
Should the arraybuffer/view memory concerns we discussed offline be addressed in this PR or another? |
@@ -51,7 +51,7 @@ define([ | |||
'../ThirdParty/gltfDefaults', | |||
'../ThirdParty/Uri', | |||
'../ThirdParty/when', | |||
'./getModelAccessor', | |||
'./getBinaryAccessor', |
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 cherry-pick this into master?
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.
Ah yes, thanks for reminding me.
I think I may pass on that for later. I'm a bit worried about the performance hit associated with doing all the pass/translucent checks per point. As of now supporting opaque and translucent together is only an issue for batched points, and maybe just setting the render state to translucent may be enough. |
var hasStyleableProperties = defined(styleableProperties); | ||
|
||
// Use per-point normals to hide back-facing points. | ||
var backFaceCulling = true; |
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.
Check out hidden point removal in http://www.crs4.it/vic/cgi-bin/multimedia-page.cgi?id=160
Could be a nice reading group paper when we are ready to implement it.
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.
Also add a TODO here for how to expose this, e.g., will the Cesium API have a point cloud specific style, is this a tileset property, etc.
I'll handle it here. |
Good plan. |
for (var name in styleableProperties) { | ||
if (styleableProperties.hasOwnProperty(name)) { | ||
var property = styleableProperties[name]; | ||
// TODO : this will not handle matrix types currently |
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.
Not part of this PR?
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 can probably get something working for this, but I'm not sure of the benefits. Would the styling language even support the concept of matrices?
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.
It could...and it likely will at some point...but I would rather roadmap this since it is not in the most promient use cases, update CesiumGS/3d-tiles#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.
Added to roadmap.
@@ -403,10 +562,21 @@ define([ | |||
vs += ' vec3 position = a_position; \n'; | |||
} | |||
|
|||
// TODO : only for testing |
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.
Keep this for now, right?
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'm going to remove it. This was mainly for anyone reviewing the PR to see how it works.
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.
Ah, look at the shader generation in the Batch Table, but I think we want to prefix these more specifically than style_
.
Just those comments. Really liking the direction here. |
The points batched example in Sandcastle comes up blank here: http://cesium-dev.s3-website-us-east-1.amazonaws.com/cesium/batch-table-binary/Apps/Sandcastle/index.html?src=3D%20Tiles.html&label=Showcases Does it for you? |
e2451ee
to
232234f
Compare
Updated.
This works now. The memory issues are also addressed. |
@@ -238,6 +238,8 @@ define([ | |||
if (batchTableBinaryByteLength > 0) { | |||
// Has a batch table binary | |||
batchTableBinary = new Uint8Array(arrayBuffer, byteOffset, batchTableBinaryByteLength); | |||
// Copy the batchTableBinary section and let the underlying ArrayBuffer be freed | |||
batchTableBinary = new Uint8Array(batchTableBinary); |
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.
Does any part of Model.js need to 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.
No
Part of #3241 |
|
||
// TODO : How to expose this? Will this be part of the point cloud styling or a property of the tileset? | ||
// Use per-point normals to hide back-facing points. | ||
var backFaceCulling = false; |
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 changed this to false
by default since many users will want go inside point clouds, e.g., like the church model.
For CesiumGS/3d-tiles#32
This adds support for a batch table binary section to b3dm, i3dm, and pnts.
To do:
instancedWithBatchTableBinary
tileset for testing. (This causes one test to fail)Possibly removehandleTranslucent
check for pnts, should be able to support transparent and opaque together.