m-agour's Blog

Week 9: Animating primitives of the same actor

m-agour
Published: 08/25/2022

What did you do this week?

  • Made two tutorials that show two approaches on how to animate primitives of the same FURY actor using the Timeline.
     

  • Tried sending all keyframes at once as uniforms, but I faced a performance issue doing this.

  • Set uniforms that are not being sent by VTK for the billboard actor.

 

What is coming up next week?

  • Alter the Timeline to use matrices instead of setting values directly to allow hierarchical transformation.

  • Improve the API of the PartialActor to act almost like a normal actor.

Did you get stuck anywhere?

I had some issues but didn’t get stuck.

View Blog Post

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.

View Blog Post

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.

  • Add tests to the functions inside fury/animation/helpers.py.

  • Make changes to the geometry-shader-based billboard to make it more like the quad-based billboard actor while maintaining the new features.

  • Integrate the already-implemented shader functionality to the new Timeline in a separate draft or PR.

Did you get stuck anywhere?

I got stuck trying to get and modify the vertices (centers) of the billboard actor.

View Blog Post

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 PlaybackPanel by 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 PlaybackPanel and the newly added color converters in colormap.py.

  • Added more hooks to the 2D sliders to cover two more states:

    1. on_value_changed, which gets called whenever the value of the slider is changed without interacting with the slider.

    2. 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_change hook, 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.

Did you get stuck anywhere?

I didn’t get stuck this week.

View Blog Post

Week 5: Slerp implementation, documenting the Timeline, and adding unit tests

m-agour
Published: 07/20/2022

What did you do this week?

  • Implemented Slerp (spherical linear interpolation) for rotation keyframes.

  • Controlling the speed of the animation is now an option.

  • Added the tests and documented the Timeline.

  • Used the geometry shader to generate billboard actors using minimal set of calculations #631.


     

What is coming up next week?

This week I will do the following:

  • Focus on finalizing the PR #626 to be merged.

  • Make some upgrades to the playback panel to make it more functional and responsive.
     

Did you get stuck anywhere?

I didn’t get stuck this week.

View Blog Post