Skip to content

Commit

Permalink
dont suport cast shadows atm
Browse files Browse the repository at this point in the history
  • Loading branch information
beckyfeng08 committed Sep 9, 2024
1 parent 55989fe commit c046cc3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/viser/_scene_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def add_light_directional(
self,
name: str,
color: int = 0xFFFFFF,
cast_shadow: bool = False,
intensity: float = 1.0,
wxyz: tuple[float, float, float, float] | onp.ndarray = (1.0, 0.0, 0.0, 0.0),
position: tuple[float, float, float] = (0.0, 0.0, 0.0),
Expand All @@ -272,9 +271,6 @@ def add_light_directional(
name: A scene tree name. Names in the format of /parent/child can be used to
define a kinematic tree.
color: hexadecimal color of the light. Default is 0xffffff (white).
cast_shadow: If set to true light will cast dynamic shadows.
Warning: This is expensive and requires tweaking to get shadows looking right.
The default is false.
intensity: numeric value of the light's strength/intensity. Default is 1.
wxyz: Quaternion rotation to parent frame from local frame (R_pl).
position: Translation to parent frame from local frame (t_pl).
Expand All @@ -286,7 +282,7 @@ def add_light_directional(

self._websock_interface.queue_message(
_messages.DirectionalLightMessage(
name, position, intensity, color, cast_shadow
name, position, intensity, color,
)
)
return LightHandle._make(self, name, wxyz, position, visible)
Expand All @@ -301,8 +297,7 @@ def add_light_ambient(
visible: bool = True,
) -> LightHandle:
"""
Add an ambient light to the scene. This light cannot be used to cast shadows as
it does not have a direction.
Add an ambient light to the scene.
Args:
name: A scene tree name. Names in the format of /parent/child can be used to
Expand Down Expand Up @@ -362,7 +357,6 @@ def add_light_point(
self,
name: str,
color: int = 0xFFFFFF,
cast_shadow: bool = False,
intensity: float = 1.0,
distance: float = 0.0,
decay: float = 2.0,
Expand All @@ -378,9 +372,6 @@ def add_light_point(
name: A scene tree name. Names in the format of /parent/child can be used to
define a kinematic tree.
color: hexadecimal color of the light. Default is 0xffffff (white).
cast_shadow: If set to true light will cast dynamic shadows.
Warning: This is expensive and requires tweaking to get shadows looking right.
The default is false.
intensity: numeric value of the light's strength/intensity. Default is 1.
distance: When distance is zero, light will attenuate according to inverse-square law
to infinite distance. When distance is non-zero, light will attenuate according to
Expand All @@ -400,7 +391,7 @@ def add_light_point(

self._websock_interface.queue_message(
_messages.PointLightMessage(
name, position, intensity, color, cast_shadow, distance, decay, power
name, position, intensity, color, distance, decay, power
)
)
return LightHandle._make(self, name, wxyz, position, visible)
Expand Down Expand Up @@ -452,7 +443,6 @@ def add_light_spot(
angle: float = onp.pi / 3,
penumbra: float = 0.0,
decay: float = 2.0,
cast_shadow: bool = False,
intensity: float = 1.0,
wxyz: tuple[float, float, float, float] | onp.ndarray = (1.0, 0.0, 0.0, 0.0),
position: tuple[float, float, float] = (0.0, 0.0, 0.0),
Expand All @@ -475,9 +465,6 @@ def add_light_spot(
Takes values between zero and 1.
decay: The amount the light dims along the distance of the light. Default is 2.
In context of physically-correct rendering the default value should not be changed.
cast_shadow: If set to true light will cast dynamic shadows.
Warning: This is expensive and requires tweaking to get shadows looking right.
The default is false.
intensity: numeric value of the light's strength/intensity. Default is 1.
wxyz: Quaternion rotation to parent frame from local frame (R_pl).
position: Translation to parent frame from local frame (t_pl).
Expand All @@ -497,7 +484,6 @@ def add_light_spot(
angle,
penumbra,
decay,
cast_shadow,
)
)
return LightHandle._make(self, name, wxyz, position, visible)
Expand Down

0 comments on commit c046cc3

Please sign in to comment.