-
Notifications
You must be signed in to change notification settings - Fork 42
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
Strange rendering of gocesiumtiler tiles with custom Cesium JS shader #47
Comments
I am not quite sure what is causing it considering that from what you say the actual position of the points in space is correct. Would it be possible for you to share with me, even privately at my email address, the dataset you are using (or even just a small subset) for me to investigate further? It would also help if you could attach an example of a "working" tileset for reference. |
No worries, I've just email you a link with the dataset. |
Thanks a lot. I believe that the issue here is that gocesiumtiler never uses local coordinate reference systems. All coordinates are stored in the Cesium default CRS EPSG 4978 (ECEF, cartesian geocentric reference system). Apparently the shader receives the raw coordinates prior to the global transforms, hence your shader will receive EPSG 4978 coords when reading the gocesiumtiler artifact, and coordinates in a local CRS when reading Terra models, hence the math is not going to be the same. This means that you can't simply subtract the Z of a point to a baseline, as the Z axis is not "UP" relative to your model. I managed to get a better visualization (not artifact free but almost) by rotating the points so that the Z is "up":
Note that I took the transform matrix from the terra tileset.json you sent me. Unfortunately this is hard to fix on your side. You could tweak with the transform, but this also means that you need to store the transform matrix for each model somewhere or figure out a way to compute it dynamically. I think this is a good use case. I will consider changing the tiler to store the points using a local "Z-up" reference with a global transform, this should help with these kind of tasks. I'm not sure on the effort required on my side to implement this change though but I believe it might be quite a lot. |
I am planning to provide a solution for this in the next release by shifting the coordinate storage to a local CRS. I already tested the preliminary code locally with the sample data you provided and is effective at preventing this issue. |
Hey daz, I have released a new version 2.0.1 which should help you achieve what you need. Please check it out, I'll keep this issue open for a few days so you can provide feedback, then I'll eventually close it. |
Closing this, feel free to reopen if the issue persists! |
I am rendering a point cloud in Cesium JS with a custom shader, it’s displaying perfectly in the sandcastle with the demo point cloud, and with the PNTS tiles that are automatically exported out of DJI Terra, but if I generate tiles from the LAS with gocesiumtiler, it renders fine and in-position with the standard shader/style as simple RGB, but renders complete noise with the custom shader.
The end goal is to change colour based on height in Cesium JS (I had no luck styling based on POSITION_ABSOLUTE so I looked to custom shaders)
Is there something wrong with my gocesiumtiler settings, or is this a bug? Can you offer any improvements to my gocesiumtiler parameters for a 3GB LAS?
Sandcastle with custom shader: ✅
DJI Terra generated tiles: ✅
Same dataset exported as LAS from DJI Terra and tiled with gocesiumtiler: 👎
Note that the positions of both tilesets are the same, I have used this method of generating tiles for quite a while but I’ve only ran into problems now that I am using a custom shader.
The text was updated successfully, but these errors were encountered: