Skip to content

Commit

Permalink
Merge branch 'development' of github.com:owl-project/ViSII into devel…
Browse files Browse the repository at this point in the history
…opment
  • Loading branch information
Jonathan Tremblay committed Aug 3, 2020
2 parents 1ec574e + 64eff8e commit c258cb9
Show file tree
Hide file tree
Showing 11 changed files with 1,105 additions and 896 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Download Dependencies
run: |
# Add directory containing cmake
export PATH=$PATH:/opt/_internal/cpython-3.8.4/bin/
export PATH=$PATH:/opt/_internal/cpython-3.8.5/bin/
# list contents of python folder
#ls -R /opt/python/${{ matrix.python-version }}
Expand All @@ -52,7 +52,7 @@ jobs:
/opt/python/cp38-cp38/bin/pip install cmake
find / -iname "cmake"
/opt/_internal/cpython-3.8.4/bin/cmake --version
/opt/_internal/cpython-3.8.5/bin/cmake --version
# Setuptools scm
/opt/python/${{ matrix.python-version }}/bin/pip install setuptools_scm
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

- name: Configure and install cmake project
run: |
export PATH=$PATH:/opt/_internal/cpython-3.8.4/bin/
export PATH=$PATH:/opt/_internal/cpython-3.8.5/bin/
source /opt/rh/devtoolset-8/enable
PY=${{ matrix.python-version }}
Expand Down
47 changes: 25 additions & 22 deletions examples/13.reprojection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import math
import visii
import noise
import random
Expand Down Expand Up @@ -38,7 +39,6 @@
print(f'created folder {opt.outf}/')

# # # # # # # # # # # # # # # # # # # # # # # # #

visii.initialize_headless()

camera = visii.entity.create(
Expand All @@ -51,11 +51,22 @@
)
)

angle = 0
camera.get_transform().look_at(
visii.vec3(0,0,.1), # look at (world coordinate)
visii.vec3(0,0,1), # up vector
visii.vec3(math.sin(angle), math.cos(angle),.2),
previous = True
)

angle = -visii.pi() * .05
camera.get_transform().look_at(
visii.vec3(0,0,0), # look at (world coordinate)
visii.vec3(0,0,.1), # look at (world coordinate)
visii.vec3(0,0,1), # up vector
visii.vec3(0,1,1)
visii.vec3(math.sin(angle), math.cos(angle),.2),
previous = False
)

visii.set_camera_entity(camera)

# # # # # # # # # # # # # # # # # # # # # # # # #
Expand All @@ -67,20 +78,8 @@
material = visii.material.create("floor")
)

floor.get_transform().set_scale(visii.vec3(100))
floor.get_material().set_roughness(1.0)

areaLight1 = visii.entity.create(
name="areaLight1",
light = visii.light.create("areaLight1"),
transform = visii.transform.create("areaLight1"),
mesh = visii.mesh.create_teapotahedron("areaLight1"),
)
areaLight1.get_light().set_intensity(10000.)
areaLight1.get_light().set_temperature(8000)
areaLight1.get_transform().set_position(
visii.vec3(0, 0, 5))

mesh1 = visii.entity.create(
name="mesh1",
mesh = visii.mesh.create_teapotahedron("mesh1"),
Expand All @@ -92,17 +91,21 @@
mesh1.get_material().set_base_color(
visii.vec3(1.0, 0.0, 0.0))

mesh1.get_transform().set_position(visii.vec3(-0.05, 0.0, 0))
mesh1.get_transform().set_scale(visii.vec3(0.1))
mesh1.get_transform().set_linear_velocity(visii.vec3(0.1, 0.0, 0.0))
mesh1.get_transform().set_position(visii.vec3(-0.05, 0.0, 0), previous=True)
mesh1.get_transform().set_scale(visii.vec3(0.1), previous = False)
mesh1.get_transform().set_scale(visii.vec3(0.1), previous = True)
mesh1.get_transform().set_position(visii.vec3(0.05, 0.0, 0), previous=False)

tex = visii.texture.create_from_image("dome", "../data/dome.hdr")
visii.set_dome_light_texture(tex)
visii.set_dome_light_intensity(2)

visii.set_dome_light_intensity(1)
visii.set_direct_lighting_clamp(10.0)
visii.set_indirect_lighting_clamp(10.0)
visii.set_max_bounce_depth(0)
visii.sample_pixel_area(visii.vec2(.5), visii.vec2(.5))
# # # # # # # # # # # # # # # # # # # # # # # # #

# # # # # # # # # # # # # # # # # # # # # # # # #
# First, let's render out the scene with motion blur to understand
# how the object is moving
visii.sample_time_interval(visii.vec2(0.0, 1.0))
Expand All @@ -129,7 +132,7 @@ def save_image(data, name):
t1_array = visii.render(
width=opt.width,
height=opt.height,
samples_per_pixel=1,
samples_per_pixel=8,
seed = 1
)
t1_array = np.array(t1_array).reshape(opt.height,opt.width,4)
Expand Down Expand Up @@ -205,4 +208,4 @@ def save_image(data, name):
save_image(mixed_img, f"{opt.outf}/mixed_img.png")

# let's clean up the GPU
visii.deinitialize()
visii.deinitialize()
4 changes: 2 additions & 2 deletions examples/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ for disocclusions.
A simple script that loads a texture, normal and roughness map and apply them to a flat surface.

## 15.camera_control.py
An interactive demo for controlling the camera similar to to a first person shooter control using `w,a,s,d` and `q` and `e` for up and down. Using the left click on the mouse you can rotate the camera.
An interactive demo for controlling the camera similar to to a first person shooter control using `w,a,s,d` and `q` and `e` for up and down. Using the left click on the mouse you can rotate the camera. Here is an [example](https://imgur.com/VYda2UF) of the sort of motion you can generate.

## Notes
All these examples were developed and tested on Ubuntu 18.04 with cuda 11.0, NVIDIA drivers
450.36.06 and using a NVIDIA TITAN RTX .


<!-- ## TODO
- exporting data is missing segmentation id for objects -->
- exporting data is missing segmentation id for objects -->
Loading

0 comments on commit c258cb9

Please sign in to comment.