-
Notifications
You must be signed in to change notification settings - Fork 473
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
Performance limitation of current styling specification #208
Comments
For the first issue you bring up we are working towards that right now, and partial support already exists. Check out CesiumGS/cesium#5153 For custom shader code, there is a bullet point |
Given the GLSL dependency, this would need to be a post 1.0 extension or something separate from the spec, e.g., Cesium can implement as many styling languages as it wants and one could be GLSL-based. |
This is handled in theory by Experimental custom shaders are now supported in CesiumJS which gives more control here. |
Currently it is hard to implement efficient styling code, because of limitation of the spec.
Example following style code:
Already here you have to multiple time same calculation (here
length(${POSITION_ABSOLUTE})
). I don't believe the glsl compiler will optimize this like a developer would be. So I miss possibility to store values into a variable before to increase performance. Another reason to do this: Sometimes it getting hard to read this code because of many calculation duplication (try to write this code in current styling language ;-) )A quick & dirty extension to solve this would be this:
A other way would be to allow free code and modify and verify it like now:
In last case verify step is more complicated, but you can do a lot more with it - especially if you allow user functions.
The text was updated successfully, but these errors were encountered: