Skip to content

Commit 24ef07a

Browse files
committed
lower memoty usage (linux binaries to follow)
1 parent babd01c commit 24ef07a

18 files changed

+11302
-11130
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ Added
99

1010
- method to update parallelogram light using center/target 3D points and scalar lengths of u/v sides (missing in v0.8.0)
1111

12+
Changes
13+
~~~~~~~
14+
15+
- lower memory usage on both host and device
16+
1217
`v0.8.1`_ - 2020-06-14
1318
----------------------
1419

examples/1_basic_plot_making/1_scatter_plot_3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def main():
7676

7777
# camera and lighting configured by hand
7878
optix.update_camera(eye=[5, 0, -8])
79-
optix.setup_light("light1", color=15*np.array([0.99, 0.9, 0.7]), radius=2)
79+
optix.setup_light("light1", color=10*np.array([0.99, 0.9, 0.7]), radius=2)
8080

8181
print("done")
8282

examples/1_basic_plot_making/2_parametric_line_plot_3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def main():
6060
# 2 spherical light sources, warm and cool, fit positions with respect to
6161
# the current camera plane: 45 deg right/left and 25 deg up;
6262
# do not include lights in geometry, so they do not appear in the image
63-
optix.setup_light("light1", color=15*np.array([0.99, 0.9, 0.7]), radius=250, in_geometry=False)
63+
optix.setup_light("light1", color=10*np.array([0.99, 0.9, 0.7]), radius=250, in_geometry=False)
6464
optix.light_fit("light1", horizontal_rot=45, vertical_rot=25, dist_scale=1.1)
65-
optix.setup_light("light2", color=20*np.array([0.7, 0.9, 0.99]), radius=200, in_geometry=False)
65+
optix.setup_light("light2", color=15*np.array([0.7, 0.9, 0.99]), radius=200, in_geometry=False)
6666
optix.light_fit("light2", horizontal_rot=-45, vertical_rot=25, dist_scale=1.1)
6767

6868
# accumulate up to 30 frames (override default of 4 frames)

examples/1_basic_plot_making/5_create_basic_mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def main():
3737

3838
rt.set_param(min_accumulation_step=2, max_accumulation_frames=100)
3939
rt.setup_camera("cam1", cam_type="DoF", eye=[1, -6, 4], focal_scale=0.9, fov=25)
40-
rt.setup_light("light1", pos=[10, -9, -8], color=[14, 13, 12], radius=4)
40+
rt.setup_light("light1", pos=[10, -9, -8], color=[10, 9, 8], radius=4)
4141
rt.set_ambient([0.2, 0.3, 0.4])
4242

4343
# add mesh geometry to the scene
4444
rt.set_mesh("m", points, faces, c=colors)
4545

4646
rt.start()
47-
print("done")
4847

48+
print("done")
4949

5050
if __name__ == '__main__':
5151
main()

examples/1_basic_plot_making/5_generate_mesh_with_pygmsh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def main():
4848
rt.setup_camera("cam1", cam_type="DoF",
4949
eye=[0.5, -3, 2], target=[0, 0, 0.5],
5050
focal_scale=0.9, fov=25)
51-
rt.setup_light("light1", pos=[15, 0, 10], color=[14, 13, 12], radius=4)
51+
rt.setup_light("light1", pos=[15, 0, 10], color=[8, 7, 6], radius=4)
5252
rt.set_ambient([0.1, 0.15, 0.2])
5353

5454
# add mesh geometry to the scene

examples/1_basic_plot_making/5_load_mesh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main():
2727
# camera and light position auto-fit the scene geometry
2828
optix.setup_camera("cam1")
2929
d = np.linalg.norm(optix.get_camera_target() - optix.get_camera_eye())
30-
optix.setup_light("light1", color=10, radius=0.3 * d)
30+
optix.setup_light("light1", color=8, radius=0.3 * d)
3131

3232
optix.start()
3333
print("done")

examples/1_basic_plot_making/5_parametric_surface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def main():
6262

6363
rt.set_data("plane", geom="Parallelograms",
6464
pos=[[-100, -14, -100]], u=[200, 0, 0], v=[0, 0, 200],
65-
c=make_color([0.1, 0.2, 0.3], exposure=exposure, gamma=gamma))
65+
c=make_color([0.1, 0.2, 0.3], exposure=exposure, gamma=gamma)[0])
6666

6767
rt.setup_camera("cam1", cam_type="DoF",
6868
eye=[-50, -7, -15], target=[0, 0, -1], up=[0, 1, 0],
6969
aperture_radius=0.4, aperture_fract=0.2,
7070
focal_scale=0.92, fov=35)
7171

72-
rt.setup_light("light1", pos=[-15, 20, 15], color=8, radius=6)
72+
rt.setup_light("light1", pos=[-15, 20, 15], color=5, radius=6)
7373

7474
rt.start()
7575

examples/1_basic_plot_making/5_surface_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def main():
4646
optix.update_camera("cam1", eye=eye)
4747

4848
d = np.linalg.norm(optix.get_camera_target() - eye)
49-
optix.setup_light("light1", color=15, radius=0.3 * d)
49+
optix.setup_light("light1", color=10, radius=0.3 * d)
5050

5151
optix.start()
5252
print("done")

examples/1_basic_plot_making/9_1_save_scene.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def main():
3333

3434
# Setup lights and the camera:
3535

36-
rt.setup_light("light1", light_type="Parallelogram", pos=[-2.5, 2.6, 3], u=[0.8, 0, 0], v=[0, -0.8, 0], color=[6, 5.7, 5.4])
37-
rt.setup_light("light2", light_type="Parallelogram", pos=[-0.5, 3.2, 0], u=[0.8, 0, 0], v=[0, 0, 0.8], color=[8, 7.6, 7.2])
38-
rt.setup_light("light3", light_type="Parallelogram", pos=[1.5, 2.6, 3], u=[0.8, 0, 0], v=[0, -0.8, 0], color=[6, 5.7, 5.4])
36+
rt.setup_light("light1", light_type="Parallelogram", pos=[-2.5, 2.6, 3], u=[0.8, 0, 0], v=[0, -0.8, 0], color=[4, 4.7, 5])
37+
rt.setup_light("light2", light_type="Parallelogram", pos=[-0.5, 3.2, 0], u=[0.8, 0, 0], v=[0, 0, 0.8], color=[6, 5.6, 5.2])
38+
rt.setup_light("light3", light_type="Parallelogram", pos=[1.5, 2.6, 3], u=[0.8, 0, 0], v=[0, -0.8, 0], color=[4, 4.7, 5])
3939
rt.setup_camera("cam1", cam_type="DoF", eye=[0, 0.4, 6], target=[0, 1.2, 0], aperture_radius=0.025, fov=35, focal_scale=0.9)
4040

4141
# Make some data:
@@ -48,7 +48,7 @@ def main():
4848
data = np.stack((x, y, z)).T
4949

5050
# Add object to scene:
51-
rt.set_data("balls", pos=data, r=r, c=0.92)
51+
rt.set_data("balls", pos=data, r=r, c=0.93)
5252
# or use another geometry and save it in the second scene file:
5353
#rt.set_data("cubes", geom="Parallelepipeds", pos=data, r=r, c=0.92)
5454

examples/1_basic_plot_making/9_3_load_scene.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ def main():
3636
rt.load_scene("strange_object_2.json")
3737

3838
# Apply some modification:
39-
if "cubes" in rt.get_geometry_names():
40-
rt.update_data("cubes", c=[0.5, 0, 0.1])
39+
if "block2" in rt.get_geometry_names():
40+
rt.update_data("block2", c=[0.5, 0, 0.1])
4141

4242
input("Press Enter to continue...")
4343

4444
# Manipulate something in the scene saved in the dictionary,
4545
# and load it back:
4646

4747
if "light2" in d["Lights"]:
48-
d["Lights"]["light2"]["Color"] = [12, 6, 2]
48+
d["Lights"]["light2"]["Color"] = [10, 5, 1.5]
4949

5050
rt.set_scene(d)
5151

0 commit comments

Comments
 (0)