• Stars
    star
    216
  • Rank 176,741 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 4 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A soft renderer based on Taichi (work in progress)

Tina

A real-time soft renderer based on the Taichi programming language.

Checkout docs/ for API demos to getting started.

Checkout examples/ for application examples.

NOTE: the renderer has been previously named Taichi THREE, see bottom.

Installation

End users may install Tina from PyPI:

python3 -m pip install taichi-tina

Features

Here's a list of important features currently Tina have:

  • particles - docs/particles.py
  • triangle meshes - docs/triangle.py
  • connective meshes - tests/connect.py
  • smooth shading - docs/smooth.py
  • mesh grid - examples/meshgrid_wave.py
  • mesh wireframe & anti-aliasing - docs/wireframe.py
  • construct surface from particles - examples/mciso_mpm3d.py
  • foreground & background color - examples/pars_mpm3d.py
  • lighting & materials - docs/lighting.py
  • loading GLTF scene - docs/gltf.py
  • transforming models - docs/transform.py
  • screen blooming effect - tests/blooming.py
  • temporal anti-aliasing, TAA - docs/options.py
  • fast approximate anti-aliasing, FXAA - tests/fxaa.py
  • image-based lighting, IBL - examples/ibl_matball.py
  • screen space ambient occlusion, SSAO - tests/ssao.py
  • screen space reflection, SSR - tests/ssr.py
  • real-time rendering volume - docs/volume.py
  • loading OBJ models - docs/monkey.py
  • path tracing mode - docs/pathtrace.py
  • bidir path tracing (WIP) - tests/bdpt.py
  • detect element under cursor (WIP) - tests/probe.py
  • Blender addon (WIP) - Taichi-Blend

If you didn't find your feature of interest, feel free to open an issue for requesting it :)

Developer installation

If you'd like to make use of Tina in your own project or contribute to Tina:

Thank for your support! You may like to clone it locally instead of the end-user installation so that you could easily modify its source code to best fit your own needs :)

Here's the suggested script for Linux users:

cd
pip uninstall -y taichi-tina  # uninstall end-user version
pip uninstall -y taichi-tina  # twice for sure :)
git clone https://github.com/taichi-dev/taichi_three.git --depth=10
# try the link below (a mirror site in China) if the above is too slow:
# git clone https://gitee.com/archibate/taichi_three.git --depth=10
cd taichi_three
echo export PYTHONPATH=`pwd` >> ~/.bashrc  # add path for Python to search
source ~/.bashrc  # reload the configuration to take effect

Or, feel free to make use of virtualenv if you're familiar with it :)

Verifying developer installation

After that, you may try this command to verify installation:

python -c "import tina; print(tina)"

It should shows up the path to the repository, e.g.:

<module 'tina' from '/home/bate/Develop/taichi_three/tina/__init__.py'>

Congratulations! Now you may import tina in your project to have fun.

Message containing site-packages may mean something wrong with PYTHONPATH:

<module 'tina' from '/lib/python3.8/site-packages/tina/__init__.py'>

How to contribute

If you've done with some new features, or bug fixes with developer mode:

I would appericate very much if you'd like to contribute them by opening an pull request so that people (including me) could share your works :) To do so:

vim tina/somefile.py # suppose you've now modified some file ready to share..
git checkout -b fix-bug  # switch to a new branch with name 'fix-bug'
git add .  # add and commit the file change
git commit -m "Hello, I fixed a bug in tina/somefile.py"
git push -u origin fix-bug

Then visit https://github.com/taichi-dev/taichi/pull/new/fix-bug and click Create Pull Request, so that it will open a new pull request for you. Then I'll reply to your pull request soon, thank for the contribution!

Folder structures

$ ls
tina/        # the main source code of Tina
tina_blend/  # the Blender addon module (WIP)
assets/      # binary assets (models, images) for the demos
docs/        # simple demos aimed to demonstrate the usage of basic APIs
examples/    # advanced demos to show what applications Tina is capable to do
tests/       # some work in progress (WIP) features that remain testing
benchmarks/  # some benchmark scripts to test the performance of Tina
setup.py     # the script to build the PyPI package for Tina

$ ls tina/
assimp/      # asset (model) loaders, e.g. GLTF, OBJ, INP..
core/        # codebase related to the real-time rasterizer
path/        # codebase related to the offline path tracer
mesh/        # mesh storing and editing nodes
voxl/        # volume / voxel storing nodes
pars/        # particle set storing nodes
scene/       # define the tina.Scene class
matr/        # material and shading nodes
util/        # some useful utilities for Tina and your project
blend/       # Blender addon module (WIP)
cli/         # command line interface (WIP)
postp/       # post-processing, mainly about tone mapping
skybox.py    # implementing cube map and spherical map for skybox
random.py    # random number generators, e.g., Taichi built-in, Wang's hash
common.py    # some common functions that might be used by Tina or your project
advans.py    # some advanced functions that might be used by Tina or your project
hacker.py    # some dirty hacks into Taichi to make Tina easier to maintain
lazimp.py    # lazy importing infrastructure to reduce import time
inject.py    # profiling Taichi JIT compilation time (WIP)
shield.py    # make Taichi fields to support pickle (WIP)
probe.py     # inspect geometry from screen space (WIP)

Legacy

Hello, dear Taichi THREE users:

The core is completely re-written after Taichi THREE v0.0.9 is released making the API more intuitive and much easier to maintain in hope for make it available to everyone. It now supports rendering not only triangle meshes but also particles and volumes (more to be added). Don't worry, many of the good things from legacy Taichi THREE are left, like cook-torrance, mesh editing nodes, OBJ importer, marching cube... but some of the very core parts, including the triangle rasterizer, is completely thrown away and replaced by a more efficient algorithm that is friendly to GPUs when faces are a bit large. The new rasterizer also make compilation a bit faster and no more growing compilation time when there are a lot of models (reliefs #26). Also note that the camera system is completely re-written (sorry @Zony-Zhao and @victoriacity!) and now we no longer have dead-lock (万向节死锁) at +Y and -Y. The re-written renderer is renamed to Tina to celebrate the huge changes in its API and important refactors and steps as an answer to issue #21, source of the name might be Seventina, one of my favorite song of harumakigohan 😆 Another reason is that we don't need a very long import seventina as t3 when import, we could directly use the original package name by import tina and tina.Scene(), what do you think? Also thanks to the cleaned code structure, the renderer now also have a Blender integration work in progress, see Taichi-Blend, and video demo here. I won't rename the repo taichi-dev/taichi_three very soon to prevent dead links to this project. Also note that the dependency of taichi_glsl is removed after the transition to tina, we invent own utility functions like bilerp and hacks like ti.static to prevent sync with the taichi_glsl repo (prevent issues like #32 (comment)). Thank for watching and making use of my project! Your attention is my biggest motivation. Please let me know if you have issues or fun with it. I'll keep pushing Tina and Taichi forward, I promise ❤️

The legacy version of Taichi THREE could still be found at the legacy branch. And here is an video introducing the usage of Tina: https://www.bilibili.com/video/BV1ft4y1r7oW Finally, the new renderer Tina could be installed using command: pip install taichi-tina. What do you think about the new name and these huge refactors? Inputs are welcome!

More Repositories

1

taichi

Productive, portable, and performant GPU programming in Python.
C++
24,605
star
2

difftaichi

10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020)
2,378
star
3

taichi-nerfs

Implementations of NeRF variants based on Taichi + PyTorch
Python
687
star
4

games201

Advanced Physics Engines 2020: A Hands-on Tutorial
Python
490
star
5

taichi_elements

High-performance multi-material continuum physics engine in Taichi
Python
454
star
6

awesome-taichi

A curated list of awesome Taichi applications, courses, demos and features.
322
star
7

voxel-challenge

Python
210
star
8

meshtaichi

MeshTaichi: A Compiler for Efficient Mesh-based Operations (SIGGRAPH Asia 2022)
Python
201
star
9

taichi_blend

Taichi Blender intergration for physics simulation and animation
Python
152
star
10

quantaichi

QuanTaichi evaluation suite
Python
134
star
11

taichi-docs-zh-cn

Taichi中文文档
127
star
12

taichi_houdini

Python
101
star
13

faster-python-with-taichi

Python
76
star
14

taichicon

TaichiCon: Taichi Conferences
71
star
15

taichi_glsl

A Taichi extension library providing a set of GLSL-alike helper functions
Python
68
star
16

taichi-aot-demo

A demo illustrating how to use Taichi as an AOT shader compiler
C++
67
star
17

taichi.js

Run compiled Taichi kernels in JavaScript and WASM
Python
63
star
18

image-processing-with-taichi

Python
52
star
19

soft2d-release

Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
C++
48
star
20

Taichi-UnityExample

C#
46
star
21

cpp-training-season1

C++ training, season 1
C++
45
star
22

taichi_benchmark

Python
25
star
23

cheatsheet

TeX
24
star
24

taichi_dem

A minimal DEM simulation demo written in Taichi.
Python
24
star
25

docs.taichi.graphics

Home of the Taichi documentation site.
HTML
23
star
26

taichi-unity2

C++
20
star
27

cloth-simulation-homework

Python
16
star
28

community

13
star
29

advanced_examples

More advanced Taichi examples
Python
10
star
30

soft2d-for-unity

Soft2D-for-Unity
C#
10
star
31

poisson-sampling-homework

Python
9
star
32

sourceinspect

A unified inspector for retriving source from Python objects
Python
8
star
33

mls_mpm_88_extensions

Python
6
star
34

test_actions

C++
5
star
35

taichi_elements_blender_examples

5
star
36

public_files

5
star
37

dummy-rdp-client

Keep a live session by RDP, so OpenGL can function.
Rust
4
star
38

docstring-gen

Workflow for generating the docstring website
Python
4
star
39

mpm_3d_exercise

Python
4
star
40

stock_trading_strategy

Optimal stock trading strategy using Taichi
Python
3
star
41

taitopia-status-page

Taitopia status page
Markdown
3
star
42

taichi_assets

Taichi binary assets (submodule of the main Taichi repository)
3
star
43

taichi-release-tests

Python
2
star
44

blogs

Python
2
star
45

taichi-zoo-issue-tracker

This repository is used for collecting user feedback from the community
1
star
46

hackathons

Taichi ❤️ Hackathons
1
star
47

taichi_glad_ready

Ready to use GLAD as a OpenGL API loader
C
1
star