-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Single glTF model appears different colour when tiled vs original #12491
Comments
I hope that this is not a red herring. But I noticed a strange effect that visually looks somehow similar in a very tiny test sandcastle: It creates a simple embedded glTF asset and loads it (not even with a tileset being involved - just the model). And for very specific model configurations and very specific camera orientations, there's a strange difference in the appearance: Note that in that GIF, it is literally just switching from one model to another, where the differences between the models are only one rotation in one node of the glTF. Based on the description (and given that we don't have access to the model from your screenshot), this might be unrelated to the issue here (but it looks very similar 👀 ). I hope that this sandcastle can either help to zoom into what might be wrong here, or ... it could be promoted into another issue. |
I found a model that I can share the files for: The model files are here: Note: I've copied the .glb file from the original to the content of the tiles version, so you can see that the appearance is different for the exact same model file. To reproduce it locally, unpack the .zip files and run a local server:
Use the Sandcastle example above and adjust the tileset.json filename paths accordingly. |
@javagl Can you reproduce the lighting issue using the sample tilesets uploaded above? |
Yes. A plain comparison of the models shows the difference: (and for those who are about to investigate that: The GLB files in both cases are really identical!) I then tried to do some side-by-side comparisonn, and ... I'm seeing some really strange effects there. Similar to the example with the "unit cubes" that I added above, the issue seems to be related to aspects of the model that I cannot yet put my finger on. Specifically, I noticed this: It's a bit subtle, but
This seems to be related to the environment based lighting computations. But the fact that it affects unrelated models, depending on something as subtle as a node rotation in a glTF, leaves me stumped about where this might come from... The sandcastle for the side-by-side case: const viewer = new Cesium.Viewer("cesiumContainer", {
globe: false
});
async function createTileset(name, yOffset) {
const tileset = viewer.scene.primitives.add(
await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8003/"+name, {
debugShowBoundingVolume: true,
})
);
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(
new Cesium.Cartesian3(0, yOffset, 0));
}
await createTileset("original/tileset.json", -800);
await createTileset("tiles/tileset.json", 1);
await createTileset("tiles/tileset.json", -400);
viewer.scene.camera.setView({
destination: new Cesium.Cartesian3(4494298.220637598, -499512.1207566406, -4483690.902301435),
orientation: new Cesium.HeadingPitchRoll(3.237952644473686, -0.44609341377242284, 6.283175778644352),
}); |
Do you think it could have anything to do with these recent changes? If you compare these models with the aircraft image in that article, the colour difference looks like it could be explained by "ACES tone mapping" being applied to the tiled version, but "Khronos PBR Neutral tone mapping" being applied to the original model. I don't know how this could be affected by changing the node transform however, unless there is some uninitialised state or shader constants and the node position changes mesh render order or something? |
I'm on thin ice when it comes to the actual reasons. So with a grain of salt: The difference that is caused by tone mapping is usually really subtle - subjectively, much smaller than the difference that can be seen here or in that "unit cubes" example that I posted above. My gut feeling is that the changes around https://cesium.com/blog/2025/02/20/leveling-up-lighting-in-cesiumjs-ibl-dynamic-environment-maps-ambient-occlusion/ are a more likely candidate. And the strange dependency to ~"things that the appearance should not depend on" indeed looks like some unititialized state, missing update, or maybe a special case (like ~"some computation that is not done when something has an identity transform" or so). But ... these are all guesses. Maybe someone else can confirm them. |
What happened?
Using the Cesium Sandcastle 1.126 viewer, I noticed that a single glTF model is rendered with a very different colour tint when loaded as a tileset.json containing a single model file, compared to the exact same single model file loaded as a "tiled" tileset with
implicitTiling
enabled:Here are the tileset.json files used to generate each view (the model itself is omitted as it is confidential).
tileset-single-model.json
tileset-tiled.json
For the purposes of this test, I copied
building.glb
and renamed it to replace the top-levelcontent_0__0_0_0.glb
file. I also removed all the other .glb files so we can be certain that the model file is identical in both cases.Can anyone please explain why the model should have a different colour appearance in the tiled case?
Is there a way to make the tiled case match the original non-tiled model?
Reproduction steps
implicitTiling
section (along with required.subtree
files).Sandcastle example
https://sandcastle.cesium.com/#c=hVNNb9swDP0rhLGDMySyu2LAkKbZR7thhwErlqy9+FDZZmxtsmhIcoI0yH+fZDlZlhXbJQrJ98jHDxekjIW1wA1quAaFG7hBI7qG3fe+OIuK3r4hZblQqLNoDLtMAVjU2nmmB8Iy2GylqXkgLcvBEY/GmdqPrjKVqVCImQIVskpSjqzE1tZLNPZ95cDGDiwnZsWlwaszUol5Vy1q2nzSvEFzh3qBBanS4a3usK9i9dZL9CKLvj8rJBq0DsM3XNiD4vBc3i5DuFf+XcvYEwGSJItqa9tpkkgquKzJ2OmbNL1MhnQTI1QlcdJQiZL9MKTeXrjpBPY/uccM/i3PqbvwoOK5xFvf74PQuPL9TsNQHDCzx0l8oE6VTso9ye4U4pMcQX5/qOx/sTckSYsn7GdyiLt2HGLvf/weAf5YSatFI6xYo2G8LOOht7DwI/SJqFnSMNoBMtQ9ObrPyL26O2GL+htXFQ4EgJSl48P/ScpeH40hF8uHzhZtjRqZdok6Ay/hFUsDdPRbvrtHKLirAbG7NtKjMHN/LCSRSarix48+AJJ6QYcqU3ix6xn7R59p7zJF42hm7Fbi/KDonWha0hY6d0qMJRabVnLrtp53xU+ntDAmyACYJafUWSnWIMrrZ745KCQ3xkVWnZQLt58sms8Sh/+LOij+ukYt+dbD6ov5l+BkjM0SZz7PtEQy5/os8y8
Environment
Browser: Microsoft Edge Version 133.0.3065.69
CesiumJS Version: 1.126
Operating System: Windows 11
The text was updated successfully, but these errors were encountered: