Property table custom shader#13163
Property table custom shader#13163mzschwartz5 wants to merge 11 commits intogltf-buffers-to-texturefrom
Conversation
|
Thank you for the pull request, @mzschwartz5! ✅ We can confirm we have a CLA on file for you. |
8780a11 to
725d637
Compare
725d637 to
bcce507
Compare
bcce507 to
d541eae
Compare
| /** | ||
| * Map property tables to feature ID sets for a given primitive. In general, the mapping is not 1:1, but | ||
| * within a given primitive it is safe to treat it as such. | ||
| * |
There was a problem hiding this comment.
This isn't always the case... see this sample tileset that explicitly tests multiple feature ID sets for a single primitive.. (Which you can test via the sandcastle linked in the testing steps on the last PR)
However, if a single primitive has multiple feature ID sets, it's ambiguous which one we should use to sample the property table (indexed by (featureID, propertyID)) in the shader. Thus, we just use the first feature ID set we find and log a warning.
There may be a better way to do this in the future, like using an "active" feature ID set or a user-specified one. But this is also a really niche use-case that realistically we don't need to support.
There was a problem hiding this comment.
Following up from the internal discussion: There is https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileset.html#featureIdLabel , and one could make a strong case that this, which currently says
Label of the feature ID set to use for picking and styling.
should say
Label of the feature ID set to use for picking and styling and property table access
or something like that.
But... having no clue about how complicated this is (I haven't read the whole changes in all related PRs), this is just a hint, and may be tracked as a possible follow-up for the future.
There was a problem hiding this comment.
Yes I did see that. I would need to look into how that setting would plumb down to the metadata pipeline stage, and how it should be made available for use in a shader (uniform?).
It might be very easy. It's just that, given the scope of these changes already, I think it might be best as a follow-up. I'll add it to the follow-ups listed in the description.
There was a problem hiding this comment.
A lot of the changes in this file are just moving code from PropertyTextureProperty.js to this, lower-level class, so that it can be reused by property table properties, which are now also backed by textures.
There are some changes to the moved functions as well, though. May be handy to paste the functions into vscode and run a diff or something.
|
|
||
| it("clipping planes cull tiles completely inside clipping region for i3dm", function () { | ||
| return Cesium3DTilesTester.loadTileset( | ||
| it("clipping planes cull tiles completely inside clipping region for i3dm", async function () { |
There was a problem hiding this comment.
This test became flaky after these changes. Not entirely sure what broke the camel's back, so to speak, but this should be more robust now - waiting for tiles to load before asserting anything.
There was a problem hiding this comment.
Again, the changes here are mainly just moving tests to go along with the code that was moved.
7204e11 to
81ccfa0
Compare
81ccfa0 to
988b910
Compare
|
And I checked: This is not caused by the fact that the property is called |
|
I think that's expected until this PR is merged.
I checked both as well because I wasn't sure about the property id sanitization rules. But it seems like it should be
|
I wasn't entirely sure about that - yesterday, I looked at #10480 and wondered whehther there is anything explicit about the compatibility of "old/legacy" things (like batch tables) with "new" things (like custom shaders). Specifically: Batch tables should work for styling, but I wasn't sure about custom shaders. (I know that there are some translations between them under the hood, but don't know all details)
Right now, in the shader compliation error message, one can see that the metadata structs only contain |
|
I should add that it's not my intention to add any new features for the legacy metadata workflows. So if they didn't work with custom shaders before, they probably won't now. I only want to make sure I'm not actively breaking any workflows we still support. |


Description
**Note: depends on #13155**
This PR adds shader generation logic in the
MetadataPipelineStagefor binding and sampling property tables (represented as textures).This is the last PR in a series to support property tables in custom shaders. There are several future follow-ups:
Cesium3DTilesetconstructor options support specifying a feature ID set).Also, TODO: update documentation (here, and here). I think that may be a follow-up PR.
Issue number and link
#13124
Testing plan
Testing plan for #13155 still applies - as regression testing.
Additionally, this sandcastle tests actually using a property table in a custom shader to visualize boreholes and modulate their radii based on metadata. The example tileset used has three metadata properties accessible via the shader:
drillingDiameter,fromDepthandtoDepth(describing the start and end point of each borehole segment to which adrillingDiametermetadata sample applies).Author checklist
CONTRIBUTORS.mdCHANGES.mdwith a short summary of my change