a geometry and algebra SDK for computer Graphics Algorithms and applications with emphasis on virtual character animation, rendering, deformation
all Rights Reserved
Prof. George Papagiannakis, papagian@csd.uoc.gr
New decade, new languages, new tools: cross platform compilation (cmake), cross platform/programming language development with (VSCode) employing Python, C++ and C# for a computer graphics (CG) full-stack deployment ( GPU to CPU character rendering and animation) to realise cross-operating system, cross-game engine, cross-algebra CG character algorithm development. This a
Rosetta stone
approach based on literate programming, i.e. writing documentation that contains the same code in different systems: e.g. a jupyter notebook showing basic GPU shader-based programming in Python, C++ and C#. This is a complete re-write in python of theglGA
framework http://george.papagiannakis.org/?page_id=513 using a modernEntity - Components - Systems
in aScenegraph
approach.
A scientific development/experimentation/visualization and algorithmic design/teaching computation platform from CPU to GPU CG and XR and from euclidean, quaternion algebra to geometric algebra GA and deep learning (DL) for computer graphics (CG):
- shader based OpenGL4.4 complete pipeline support: vertex, fragment, geometry, compute, tessellation shaders
- Geometric algebra as an all-in-one framework unifying linear algebra, complex numbers, Quat, Dquat algebras
- Window toolkits across multiple operating systems
- 2D GUIs easy to setup and parameterize
- Common 3D file formats such as .dae and .fbx
- GLSL style mathematics library for shader-based math
- Python2GPU avenues
- Convert Python to C++ or Cuda
- Embed the python interpreter in C++
- Vulkan support for low level GPU
- GPGPU programming support for:
- OpenCL
- CUDA
- AMD ROCm
- OpenVR access to steamVR library for basic VR cross VR-HMD support
- Jupyter notebooks for literate programming, CG algorithmic exploration and teaching
- CG Character Rendering
- Path tracing (Shirley's "Ray tracing in a Weekend" and SmallPT)
- Phong Lighting and Shading with point lights
- Camera and Object linear transformations
- Image Based Lighting
- SH area lights with rotation
- Precomputed Radiance Transfer
- CG Character animation
- keyframe animation & blending
- Linear blend skinning
- Dual quaternion skinning
- Geometric Algebra (GA) for Computer Graphics (CG)
- GA motors (EGA, CGA and rotation, translation, dilation)
- GA quaternion blending
- GA skinning
- GA PRT
- GA Cutting
- GA Tearing
- GA drilling
- CG Character Rendering
Full-stack CG development
: same code-base across languages and platforms: from python to C++ and from C# and Unity to C++ and Unreal with same basic CG examples from CPU rendering to GPU shader languages.Entity - Components - Systems in a Scenegraph (ECSS)
using modern software engineering principles and s/w design patterns.Basic glGA examples for introductory CG
programming in:- C++, OpenGL in glGA 5.0
- Python, OpenGL in glGA SDK 2020
- C#, OpenGL/Dx in Unity
- C++, OpenGL in Unreal
Path tracing
with smallPT/ray tracing in a weekend- C++ smallPT
- Python smallPT
- C# smallPT
- python RayTracing from P. Shirley
Support for source control & elegant code
documentation- Github flow
- Github submodules
- Python intro to scientific computing
- Readthedocs Sphinx project
Support shader-based CG examples
in glGA- BasicWindow
- BasicCubeGUI
- BasicPhong
- OpenGL Orange book GLSL chapters
- glGACharacterApp
- Vertex specification
- Mesh loading
- Texturing
- Character Animation
- Skinning
- GA interpolation, animation, skinning
- VR simulation
- All OpengL GPU shader pipeline:
- Vertex
- Fragment
- Geometry
- Compute
- Tesselation
Support geometric algebra for CG character simulation
in glGA- Gaigen GA on shaders
- glGAMesh
- glGAMath
Support shader-based Unity CG examples
- Same glGA basic shader examples in C# and Cg (similar to glGA but for Unity)
- Monte Carlo Path Tracing using compute shaders in Unity (BSc thesis)
- Support for
python - GPU
pathways- Python2cpp via pybind (module) - and then via C# wrapper to Unity -
- Embed the python interpreter
- https://pybind11.readthedocs.io/en/stable/advanced/embedding.html
- https://docs.python.org/3.5/extending/embedding.html#pure-embedding
- Python->Cmake embedded python in Cpp->wrapper C# for Unity!
- Use pybind11 C++ API to call python
- Cpp2python
- pybind11 to call C++ from python (e.g. glGAMath, glGAMesh classes)
- Insight: Python is great for pedagogical experimentation.
- However, once the algorithm is identified, C++ has to be employed, as it is far more efficient and GPU/VR friendly
- https://stackoverflow.com/questions/45054860/extending-c-to-python-using-pybind11
- https://stackoverflow.com/questions/11866288/importing-a-pyd-created-with-swig-in-python-2-7-3-on-mac
- pybind11 to call C++ from python (e.g. glGAMath, glGAMesh classes)
- Python2cuda via numba (module)
- Use Cython to create a C dynamic libray that contains the python modules
- http://docs.cython.org/en/latest/src/tutorial/external.html
- Python2compute shader via gaigen (module)
- Using the unity/unreal python embedded console (2.7) (jupyter instructions)
- Using Unity’s ML agents external communicator module (jupyter instructions)
- Rebuild unreal engine with Python 3.7 support (instead of 2.7)
Third party lib support python for data science, CG, GPU and GA
development:- Jupyter (anaconda, visual studio code)
- numba (pip)
- Clifford (pip)
- galgebra (pip)
- Numpy (conda)
- Matplotlib (conda)
- Scipy (conda)
- Scikit-learn (pip)
- Tensorflow (conda)
- Keras (conda)
- Pybind11 (pip)
- Cython (pip)
- Scientific-python-lectures (submodule, github)
- Python CG libraries:
- pySDL2 (pip)
- pyImGUI (pip)
- pyGLM (pip)
- pyAssimp (pip) (first assimp via macports)
- Libigl (conda)
- Pyigl (pip)
- vulkan (pip)
- Pyopencl (pip) 1. Example in Lecture_6b_hpc from python scientific computing notebook
- pyopenvr (github and pip)
- Has been updated to latest steamvr 1.11.11
- Imageio (conda)
- Pybullet(pip)
- Tqdm progress bar (pip)
- Third party C++/CUDA physics libraries:
- PositionBAsedDyanmics
- VIPER
- SphereTree
- Bullet (pybullet) conda
- Third party open source CG frameworks for multiOS support
- Magnum (magnum.graphics)
- To get pyassimp to work:
- Install first latest assimp via macports: sudo port install assimp (version 5.0)
- Add opt/local/lib on helper.py (where the assimp library is)
- assimp/port/PyAssimp/pyassimp/structs.py
- Line 1088 in 0adc032
- ("mPrivate", c_char_p),
- Deleting that line resolves the error.
- Previous glGA cpp framework 5.0 is a submodule
- It can be build as cpp inside visual studio code: https://medium.com/audelabs/ c-development-using-visual-studio-code-cmake-and-lldb-d0f13d38c563>
- Readthedocs project:
- https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html
- Python/Cpp/C# development:
- visual studio code with python, cpp, c#, cmake, gitlens, github plugins
- Kite and kite copilot for python docs and intellisense (www.kite.com)
- Papaefthymiou M. et al. (2017) Gamified AR/VR Character Rendering and Animation Enabling Technologies. In: Ioannides M., Magnenat-Thalmann N., Papagiannakis G. (eds) Mixed Reality and Gamification for Cultural Heritage. Springer, Cham.
- Papaefthymiou, M., Hildenbrand, D., & Papagiannakis, G. (2016). An inclusive Conformal Geometric Algebra GPU animation interpolation and deformation algorithm. Visual Computer, 32(6-8), 1–9. http://doi.org/10.1007/s00371-016-1270-8
- Papaefthymiou, M., Feng, A., Shapiro, A., Papagiannakis, G., “A fast and robust pipeline for populating mobile AR scenes with gamified virtual characters”. ACM SIGGRAPH-ASIA 2015, Symposium On Mobile Graphics and Interactive Applications, Kobe, ACM Press, November 2015
- Papagiannakis, G., Papanikolaou, P., Greassidou, E., & Trahanias, P. E. (2014). glGA: an OpenGL Geometric Application Framework for a Modern, Shader-based Computer Graphics Curriculum. (pp. 9–16), Eurographics 2014, http://doi.org/10.2312/eged.20141026
- Papagiannakis, G. (2013). Geometric algebra rotors for skinned character animation blending. Technical Brief, ACM SIGGRAPH ASIA 2013, Hong Kong, November 2013, 1–6.
- Prof. George Papagiannakis
- Kamarianakis Manos
- Papanikolaou Petros
- Greassidou Elisavet
- Georgiou Stylianos
- Kateros Stavros
- Zikas Pavlos
- Lydatakis Nikolaos
- Papaefthymiou Margarita
- Kanakis Marios
- Kentros Michalis
- Geronikolakis Stratos
- Evangellou Yannis
- Kartsonaki Ioanna
Our objective in this SDK is two-fold:
- a) we want to teach, learn and expriment with key CG and underlying algebraic concepts as efficiently as possible, more than achieving absolute highest framerates. C/C++ are powerful but cluttered, error-prone low-level languages, that get in the way of this learning efficiency.
- b) we want to provide rapid prototyping, algorithmic understanding, experimentation and code equivalence between Python, C++ and C# across CPU and GPU frameworks and the two most prevailing, modern game engines (Unity and Unreal).
- c) we want to emphasize on "literate programming" and Python-Jupyter notebooks are the best current vehicle for that IMHO: "In literate programming the emphasis is reversed. Instead of writing code containing documentation, the literate programmer writes documentation containing code. No longer does the English commentary injected into a program have to be hidden in comment delimiters at the top of the file, or under procedure headings, or at the end of lines. Instead, it is wrenched into the daylight and made the main focus. The "program" then becomes primarily a document directed at humans, with the code being herded between "code delimiters" from where it can be extracted and shuffled out sideways to the language system by literate programming tools." http://www.literateprogramming.com/index.html
e.g. OpenGL is primarily a C API which for most CG applications today is actually used with C++ (or C#) in the industry. There are many good reasons for that: often the goal is to have the fastest possible code on the CPU side, since rendering for real-time visualization means that a frame needs to be produced onscreen every 10, 16 or 33 milliseconds (for 100Hz, 60Hz, 30Hz refresh rates) and no time can be wasted.
- Python code is more straightforward, easier to read, write, and debug
- It is less verbose (typically by a factor of 5-10 on the code size), and benefits from an extensive and intuitive set of built-ins (tuples, lists, dictionaries, arrays…)
- In particular Python constructs, like generators, list and dictionary comprehensions are a great way to reduce simple object construction loops to one readable line of code, or create iterators that unclutter the code. Keep those in mind when you write your application.
- Well written Python code can be quite fast already, and most inner loop tasks of interest to these practicals happen on the GPU anyway, once properly initialized.
- What’s more, Python has excellent wrappers to OpenGL and window libraries whose interface closely match their C counterpart. Which means anything you learn about writing code in Python directly maps to the C APIs.
- Python is already the programming language of choice for deep learning algortihms and data science in general, with numerous libraries and frameworks.
- Python is already being adopted by latest versions of 3D game engines, such as Unity and Unreal.
- extern/
- python/
- computing
- Submodule: pybind11
- Submodule: scientific-python-lectures
- Submodule: numerical computing with python
- Submodule: pyopencl
- GA
- Submodule: clifford
- Submodule: galgebra
- Submodule: ganja.js
- CG
- Submodule: pyopengl
- Submodule: pyimgui
- Submodule: pysdl2
- Submodule: tqdm
- Submodule: pyGLM
- deepLearning
- Submodule: glassner deep learning1
- Submodule: glassner deep learning2
- GI
- Submodule:numpy-smallpt
- Submodule:raytracing-in-one-weekend-python
- computing
- Cpp/
- computing
- Submodule:modern-cpp-features
- Submodule:learning-cMake
- Submodule:GLM
- GI
- Submodule:rayTracing
- Submodule:cpp-smallpt
- Submodule:spherical-harmonics
- physics
- Submodule:Spheretree
- Submodule:Pbd
- Submodule:Bullet3
- computing
- cSharp/
- GI
- Submodule:cs-smallpt
- Submodule:cs-raytracing
- GI
- python/