Animation support in Cesium3DTileStyle
See original GitHub issueCurrently you can implement animations in Cesium3DTileStyle only by modifying style in each frame, which causes a recompilation of shader. To prevent this we need a uniform containing the current time.
I see two possible implementation strategies we could use:
- Add a variable
${TIME}which is a core variable like${POSITION}. - Add interface to Cesium3DTileStyle to user defined uniforms.
Option 1: Implementing ${TIME} should be easy - but there are some difficult questions: Which is the start time of ${TIME}? Is 0 start of UNIX time or is 0 time of first frame of this shader? If you want be sure animation starts by 0 you need time of first frame. But if you store time of first frame and you have multiple styles it is hard to synchronize animations. So we could in my opinion we don’t should provide this option, if we implement option 2.
Option 2: With adding support of user defined uniforms implementation of animations needs some more lines to user, but you can implement all variables like you want and you have a little better performance (e.g. you can process ${TIME} % 100 once on CPU side instead on GPU side for each vertex). And of course you can use this uniforms for other variables, too 😉.
What do you think about it? It could be we need this in near future, so maybe (if I have time and it has enough priority for us) I will implement it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
Looking into it unfortunately might not be my decision if the code is public in the end
@katSchmid Some initial work was done in https://github.com/CesiumGS/cesium/pull/5380, but more work would need to be done to get this feature in. Let us know if you have interest in contributing. Thanks!