Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does or will Tina support Framewire or Transparent material? #35

Open
JerryYan97 opened this issue Dec 31, 2020 · 2 comments
Open

Does or will Tina support Framewire or Transparent material? #35

JerryYan97 opened this issue Dec 31, 2020 · 2 comments

Comments

@JerryYan97
Copy link

Hello!

I want to compare the difference between two 3D simulation (They should have subtle difference) and Framewire or Transparent materials would be two intuitive way that come to my mind to show this difference.

However, I am not able to find relevant API in Tina. Is there a way now that I can do this?

Thank you!

@archibate
Copy link
Collaborator

Hi! Thank for your suggestions! Tina didn't support it before.
I have just pushed commit e99c148 to master to support rendering framewires.

However it hasn't been released to PyPI yet. So to play with it you may clone this repo and install it locally:

pip install -y taichi-tina  # uninstall the released v0.0.1 version
git clone https://github.com/taichi-dev/taichi_three.git --depth=1
cd taichi_three
python3 -m pip install wheel  # required for generating wheels
python3 setup.py bdist_wheel  # build the latest taichi-tina
python3 -m pip install dist/*.whl  # install latest taichi-tina locally on your machine

Checkout docs/wireframe.py for usage example:

# In this episode, you'll learn how to render a wireframe model in Tina
#
# This tutorial is based on docs/monkey.py, make sure you check that first

import taichi as ti
import tina

ti.init(ti.cpu)

# you may specify the line width for rendering wireframes:
scene = tina.Scene(linewidth=2)

# load the monkey using `tina.MeshModel` node (`tina.SimpleMesh` works too):
model = tina.MeshModel('assets/monkey.obj')
# convert the mesh to its wireframe using the `tina.MeshToWire` node:
wiremodel = tina.MeshToWire(model)

# add the wireframe model into scene:
scene.add_object(wiremodel)

# add the original model, with a tiny scale:
model = tina.MeshTransform(model, tina.scale(0.9))
scene.add_object(model)

gui = ti.GUI('wireframe')

while gui.running:
    scene.input(gui)
    scene.render()
    gui.set_image(scene.img)
    gui.show()

I'll try to add another commit to support transparent materials later, write to you soon!

@JerryYan97
Copy link
Author

JerryYan97 commented Jan 1, 2021

Besides, I still have question for the design of the TriangleRaster. Why don't set 'Clipping' as a default True setting? This can make it more similar to a regular rasterizer from my point of view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants