Skip to content

Commit

Permalink
tmp save
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Oct 11, 2020
1 parent 28890b2 commit 369760e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Notable changes:
* Framebuffered texcoor - get model surface coordinate by mouse, see `examples/screen_to_texcoor.py`.
* Separate camera control logic from `t3.Camera` to `t3.CameraCtl`.
* Support `t3.AmbientLight` and ambient occulsion.
* Set up the path tracing scheme.

Minor fixes:
* Fix an artifect in perspective mode due to texture coordinate interpolation.
Expand Down
1 change: 1 addition & 0 deletions examples/path_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
light.add_uniform('emission', 64.0)
scene.add_model(light)
camera = t3.RTCamera(res=res)
camera.ctl = t3.CameraCtl(pos=[1, 0, -1])
scene.add_camera(camera)
accumator = t3.Accumator(camera.res)

Expand Down
4 changes: 2 additions & 2 deletions examples/shadow_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
camera.ctl = t3.CameraCtl(pos=[1, 1, -1])
scene.add_camera(camera)
light = t3.Light([0.4, -1.5, 1.8])
#scene.add_shadow_camera(light.make_shadow_camera())
scene.add_shadow_camera(light.make_shadow_camera())
scene.add_light(light)

gui = ti.GUI('Model', camera.res)
Expand All @@ -26,7 +26,7 @@
gui.running = not gui.is_pressed(ti.GUI.ESCAPE)
camera.from_mouse(gui)
model2.L2W[None] = t3.translate(0, 0.16 * ti.sin(gui.frame * 0.03), 0)
#scene.render_shadows()
scene.render_shadows()
scene.render()
gui.set_image(camera.img)
#gui2.set_image(light.shadow.fb['idepth'])
Expand Down
2 changes: 1 addition & 1 deletion taichi_three/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Taichi THREE is an extension library of the `Taichi Programming Language <https://github.com/taichi-dev/taichi>`_, that helps rendering your 3D scenes into nice-looking 2D images to display in GUI.
'''

__version__ = (0, 0, 6)
__version__ = (0, 0, 7)
__author__ = '彭于斌 <1931127624@qq.com>'

import taichi as ti
Expand Down
2 changes: 1 addition & 1 deletion taichi_three/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, res=None):
self.res = res or (512, 512)
self.buffers = {}
self.add_buffer('img', 3)
self.add_buffer('idepth', 0, int)
self.add_buffer('idepth', 0)

@ti.func
def idepth_fixp(self, z):
Expand Down
6 changes: 0 additions & 6 deletions taichi_three/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ def add_light(self, light):
light.scene = self
self.lights.append(light)

<<<<<<< HEAD
def render_shadows(self):
self._render_shadows()

=======
>>>>>>> 5d1d8b3b4bbe2f9ff3d7c15e6d15ec768669e79b
@ti.kernel
def render_shadows(self):
if ti.static(len(self.shadows)):
Expand Down

0 comments on commit 369760e

Please sign in to comment.