- Notifications
You must be signed in to change notification settings - Fork24
A soft renderer based on Taichi (work in progress)
License
taichi-dev/taichi_three
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A real-time soft renderer based on theTaichi programming language.
Checkoutdocs/
for API demos to getting started.
Checkoutexamples/
for application examples.
NOTE: the renderer has been previously named Taichi THREE, see bottom.
End users may install Tina from PyPI:
python3 -m pip install taichi-tina
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 toopen an issue for requesting it :)
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 theend-user installation so that you could easily modify its source code tobest fit your own needs :)
Here's the suggested script for Linux users:
cdpip uninstall -y taichi-tina# uninstall end-user versionpip 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=10cd taichi_threeechoexport PYTHONPATH=`pwd`>>~/.bashrc# add path for Python to searchsource~/.bashrc# reload the configuration to take effect
Or, feel free to make use ofvirtualenv
if you're familiar with it :)
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 mayimport tina
in your project to have fun.
Message containingsite-packages
may mean something wrong with PYTHONPATH:
<module 'tina' from '/lib/python3.8/site-packages/tina/__init__.py'>
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 byopening anpull requestso 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 changegit commit -m"Hello, I fixed a bug in tina/somefile.py"git push -u origin fix-bug
Then visithttps://github.com/taichi-dev/taichi/pull/new/fix-bug and clickCreate 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!
$ lstina/# the main source code of Tinatina_blend/# the Blender addon module (WIP)assets/# binary assets (models, images) for the demosdocs/# simple demos aimed to demonstrate the usage of basic APIsexamples/# advanced demos to show what applications Tina is capable to dotests/# some work in progress (WIP) features that remain testingbenchmarks/# some benchmark scripts to test the performance of Tinasetup.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 rasterizerpath/# codebase related to the offline path tracermesh/# mesh storing and editing nodesvoxl/# volume / voxel storing nodespars/# particle set storing nodesscene/# define the tina.Scene classmatr/# material and shading nodesutil/# some useful utilities for Tina and your projectblend/# Blender addon module (WIP)cli/# command line interface (WIP)postp/# post-processing, mainly about tone mappingskybox.py# implementing cube map and spherical map for skyboxrandom.py# random number generators, e.g., Taichi built-in, Wang's hashcommon.py# some common functions that might be used by Tina or your projectadvans.py# some advanced functions that might be used by Tina or your projecthacker.py# some dirty hacks into Taichi to make Tina easier to maintainlazimp.py# lazy importing infrastructure to reduce import timeinject.py# profiling Taichi JIT compilation time (WIP)shield.py# make Taichi fields to support pickle (WIP)probe.py# inspect geometry from screen space (WIP)
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 toTina
to celebrate the huge changes in its API and important refactors and steps as an answer to issue #21, source of the name might beSeventina
, one of my favorite song of harumakigohan 😆 Another reason is that we don't need a very longimport seventina as t3
when import, we could directly use the original package name byimport tina
andtina.Scene()
, what do you think?Also thanks to the cleaned code structure, the renderer now also have a Blender integration work in progress, seeTaichi-Blend
, andvideo demo here.I won't rename the repotaichi-dev/taichi_three
very soon to prevent dead links to this project.Also note that the dependency oftaichi_glsl
is removed after the transition totina
, we invent own utility functions likebilerp
and hacks liketi.static
to prevent sync with thetaichi_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 thelegacy
branch.And here is an video introducing the usage of Tina:https://www.bilibili.com/video/BV1ft4y1r7oWFinally, 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!
About
A soft renderer based on Taichi (work in progress)