Week 8: Back to the shader-based version of the Timeline
m-agour
Published: 08/15/2022
What did you do this week?
First, I made some modifications to the main animation PR. Then as Filipi requested, I integrated the vertex shader That I was implementing a few weeks ago to work with the new improved version of the Timeline.
As for how keyframes are sent to the GPU, the method being used is to send the needed keyframes for each draw. This is heavy because we only roll out the interpolation part, which with linear or step interpolation won’t make any difference! Instead, I tested hard-setting all the keyframes as a constant variable by manipulating the shader program’s string. This also was slow to initialize, and the shader was getting bigger and slower to bind and unbind. to solve this problem, I made a uniform that holds all the keyframes of the animation and sent data as vectors with was faster than string manipulation, also it was faster to render since data are now stored directly in memory and the shader program was a lot more compact. But this method had an issue; uniforms do not keep data stored as expected! If two or more actors have the same uniform name in their shader program. And only one of them was set, the other actor will get this value as well. A way around this is to change the names of the uniforms so that they maintain their data.
Tested animating 200K billboard spheres animation but this time using translation as well. And they performed very well.
What is coming up next week?
Fix issues I encountered this week working with GLSL shades.
Implement slerp in GLSL as well as figure out a way to optimize sending keyframes to the shader program.
Figure a way to animate primitives of the same actor by different timelines.
Did you get stuck anywhere?
I had two issues, one mentioned above which was uniforms not being abler to hold data. The second one is that VTK does not send specular-related uniforms and lightColor0 to the dot primitive, which are needed for light calculations.
Week 7: Billboard spheres and implementing interpolators using closures
m-agour
Published: 08/04/2022
What did you do this week?
Restructured the keyframe animation interpolators using closures to be functions instead of classes #647. Now it is easier to implement new interpolators with the help of the functions existing in fury/animation/helpers.py. Also, now unit tests can be added for the latter functions.
Added two examples explaining how to implement a custom interpolator that can be used by the Timeline, one using classes and the other using closures.
Fixed rotation issue that Shivam discovered while using the Timeline to animate glTF models. So, rotation in VTK is done by rotating first around Z-axis, then X-axis, then finally around Y-axis, which was not the order I was using to convert from quaternions to Euler degrees.
Made changes requested by Javier and Filibi on the billboards using geometry shader PR, and made an example of how to use this billboard to show an impostor sphere which looks almost like a real high poly sphere. Also benchmarked using this version of billboard vs using a quad-based billboard, and how they both affect the FPS of the animation.
What is coming up next week?
Document the new closure-based interpolators. And make some slight renaming changes that we discussed in today’s meeting.
Week 6: Fixing the Timeline issues and equipping it with more features
m-agour
Published: 07/30/2022
What did you do this week?
Improved the PlaybackPanelby adding speed control and the ability to loop the animation. Also, fixed the lagging issue of play and pause buttons and composed them into a single play/pause button.
Updated the old tutorials’ syntax to match the other tutorials and added a new tutorial on position animation using spline interpolation. Added unit tests for the PlaybackPaneland the newly added color converters incolormap.py.
Added more hooks to the 2D sliders to cover two more states:
on_value_changed, which gets called whenever the value of the slider is changed without interacting with the slider.
on_moving_slider, which gets called when the position of the slider is changed by user interaction. #634.
The reason for adding these two hooks is that there was only the on_changehook, which always gets called when the value of the slider is changed without considering how the value is changed, hence, the functionality of the slider was limited.
Provided the ability to add static actors to the Timeline, which might be needed in the animation part of Shivam’s glTF project #643.
If an actor is added to the Timeline as a static actor, it won’t be animated by the Timeline, but it will get added to the scene along with the Timeline.
Implemented a custom evaluator for the Timeline’s properties.
A custom evaluator uses a user-provided function that takes time as input and evaluates the property at that time. This feature is yet to be discussed more in today’s meeting.
Fixed camera rotation and the view-up issue when interacting with the scene.
What is coming up next week?
Make a tutorial on how to implement a new custom Interpolator to work with the Timeline.
Add motion path visualization feature for both position and color properties.
Add custom evaluation functions directly, without using the CustomInterpolator.
Implement an already existing complex interpolator using closures instead of classes.