Skip to content

Commit

Permalink
Example tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Sep 10, 2024
1 parent 8b8f9fe commit 7878107
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/26_lighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import numpy as onp
import trimesh

import viser
import viser.transforms as tf

Expand Down Expand Up @@ -40,9 +39,9 @@ def main() -> None:
)

# adding controls to custom lights in the scene
server.scene.add_transform_controls("/control0")
server.scene.add_transform_controls("/control0", position=(0.0, 10.0, 5.0))
server.scene.add_label("/control0/label", "Directional")
server.scene.add_transform_controls("/control1")
server.scene.add_transform_controls("/control1", position=(0.0, -5.0, 5.0))
server.scene.add_label("/control1/label", "Point")

directional_light = server.scene.add_light_directional(
Expand All @@ -52,7 +51,7 @@ def main() -> None:
point_light = server.scene.add_light_point(
name="/control1/point_light",
color=(192, 255, 238),
intensity=3.0,
intensity=30.0,
)

# Create default light toggle.
Expand Down Expand Up @@ -87,7 +86,7 @@ def _(_) -> None:
gui_point_intensity = server.gui.add_slider(
"Intensity",
min=0.0,
max=20.0,
max=200.0,
step=0.01,
initial_value=point_light.intensity,
)
Expand Down Expand Up @@ -139,7 +138,7 @@ def _(_) -> None:
min=0.0,
max=1.0,
step=0.01,
initial_value=1.0,
initial_value=0.1,
)

def update_environment_map(_) -> None:
Expand All @@ -151,6 +150,7 @@ def update_environment_map(_) -> None:
environment_intensity=gui_env_intensity.value,
)

update_environment_map(None)
gui_env_preset.on_update(update_environment_map)
gui_background.on_update(update_environment_map)
gui_bg_blurriness.on_update(update_environment_map)
Expand Down

0 comments on commit 7878107

Please sign in to comment.