Should tile geometricError take tile transform scaling into account?
Question
Should the geometricError of a tile take into account the scaling component of the tile's transform?
When testing with this example tileset, it seems the rendering result is more reasonable if the geometricError is affected by the transform's scaling.
I am unsure if this is expected behavior and would like clarification from the maintainers.
Example tileset: https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/main/1.0/TilesetWithDiscreteLOD/tileset.json
Library Version v0.4.10
Three.js Version v0.170.0
It should not - you can see the explanation of geometric error in the spec here. I recommend reading through the 3d tiles specification if you'd like to become more familiar with the format. If you have questions about that tile set specifically you'll have to ask those who created it.
@gkjohnson Sorry to bother you again, but I have indeed read this part of the documentation. I’m not sure if I misunderstood, but I feel that the documentation does not clearly specify whether the tile’s geometricError should be multiplied by the tile’s transform scaling for rendering.
To clarify, I looked into Cesium’s implementation and found the following code in @CesiumGS/cesium/files/packages/engine/Source/Scene/Cesium3DTile.js:
It appears that Cesium applies the scaling from the tile’s transform to geometricError before calculating the screen space error (SSE), rather than using the geometricError from the tile definition directly.
I have indeed read this part of the documentation. I’m not sure if I misunderstood, but I feel that the documentation does not clearly specify whether the tile’s geometricError should be multiplied by the tile’s transform scaling for rendering.
To me it reads clearly - the "geometricError" value should be specified in meters. If that value is scaled by the tiles transform value it is no longer in meters and potentially in an inconsistent scale across the tile set.
I do see that it is in conflict with the Cesium source and this single line in the spec:
The transform property scales the geometricError by the largest scaling factor from the matrix.
Do you mind making an issue at the 3d tiles specification repository to clarify? One of these locations in the spec should change so the description is consistent.
Thanks for bringing this up!
Yes, I have already raised this question in the CesiumGS/3d-tiles repository: https://github.com/CesiumGS/3d-tiles/issues/813
Assuming the answer is to align the description with existing 3d tiles implementations and yes the geometric error is supposed to scaled by the transform - it would be great if you'd like to open a PR to fix the issue. The easiest way to fix this is probably to precalculate the largest scale value here after the multiplied transform is computed and scale the geometric error in the calculateTileViewError.
Though as alluded to on Twitter, these are possibly some good places to discuss removing the three.js dependencies from.
In both versions 0.0 and 1.0 the spec specifically states that transform should not scale the geometric error:
The transform property does not apply to geometricError—i.e., the scale defined by transform does not scale the geometric error—the geometric error is always defined in meters.
It's also not listed in the changes list for spec 1.1 and is technically a breaking change. No wonder I thought this wasn't correct. 🤔
Oh! This is quite a discovery (haha)! This means we should distinguish between the 3D Tiles 1.0 and 1.1 implementations in the code?
Hopefully not 🤞 I just made a comment in your other issue. We'll see what the feedback is.