-
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
Lookup table to increase styling performance #4662
Comments
It could be that the shader backend is not suitable for this use case. Have you checked out the However this also means that all points batched together share the same metadata. This could be a problem depending on your use case. Basically the main reservation I have about the look up table approach is the complexity it adds to the spec. Switch-case is definitely better for some cases, but I would still be worried about storing all those values in the shader text itself rather than the texture approach you suggested. |
@SunBlack you may also want to consider just storing unique per-point colors instead of mapping the id to color at runtime. Also, when you have suggestions for changing the spec, please submit an issue to the https://github.com/AnalyticalGraphicsInc/3d-tiles repo so we can keep an archive of spec decisions in that repo. Thanks! |
@SunBlack please see my above comment:
And open a new issue in https://github.com/AnalyticalGraphicsInc/3d-tiles if there is a spec update you want to discuss. |
If you want to match a id from batch table to a fixed color you have to write something like this:
The result of this condition is currently
I don't believe this has still a good performance in case you have thousands of ids, so it would be nice if cesium does support lookup tables or has a way to integrate something like this without need to touch core of Cesium.
So maybe a syntax like this would be nice:
The lookup table can be implement with a 1D-texture (maybe we can extend the lookuptable to a 2D-texture, too). Another way is maybe to use a switch-statement, which are supported by glsl, too. We should do a performance comparison to check which way is best to handle large condition tables.
The text was updated successfully, but these errors were encountered: