whycode

December 15, 2022 Β· View on GitHub

whycoding? It is the work of the "Colorful Black" team in the TaiChi Hackathon 2022. It mainly uses the parallel programming language Taichi to achieve some dynamic transformation visual effects and assist in music accompaniment. The project mainly describes the scene with SDF (Signed Distance Field), which is implicitly expressed. It uses Taichi's efficient parallelism to perform multiple sampling calculations on the GPU. The return value of the SDF is used for transformation processing of various shapes.

δΈ­ζ–‡οΌŒ English

Install and Use

# install ffplay [ffmpeg]
# ubuntu
sudo apt-get install ffmpeg
# mac
brew insatll ffmpeg

# clone code
git clone https://github.com/ElonKou/whycode

# install environment.
cd whycode
pip install -r requirements.txt

# run
python3 main.py

Results

gear taichi star multi-stars star2tree tree2wave drop2geart wave2folwer circle2mascot

Project introduction 🎎

Team name: colorful black project name: why coding? Entry direction: application direction Project category: interactive art

Project details

Project introduction: Interactive and cool program animation clips can be used to render animation in a similar way using shader toy. Expected effect: to achieve the effect of continuous switching of multiple shader SDF scenes over time, with music as accompaniment.

Technical solution:

overall technology: module division is realized by fragment shader rendering:

  • shader module βœ”: Use taichi to implement clip shaders
  • Scene module βœ”: Maintain the information of various scenarios, including time, and call different shaders in different time periods
  • Basic component module βœ”: The geometry of SDF is used to represent physics
  • Special effect component module βœ”: Realize different transformation functions for the control of shader special effects
  • Scene transition special effect components βœ”: Realizing scene switching special effects
  • music control component βœ”: Realize special effect music