Skip to content

Commit 8ad108b

Browse files
update
1 parent 240e00c commit 8ad108b

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,24 @@ def build_render_scope_usd(
120120
minimal_mode: RTX minimal mode. None if not requested. Valid values are 1, 2, 3.
121121
render_var_configs: Render variables to author. Uses the single render var arguments if not provided.
122122
background_color: Solid background color as normalized RGB floats ``(r, g, b)`` in ``[0, 1]``.
123-
When set, the render product uses ``"color"`` as the background source type.
124-
When ``None``, the default ``"domeLight"`` background is used.
123+
When set, the render product uses a solid color background instead of the dome light.
124+
When ``None``, the default dome-light background is used.
125125
126126
Returns:
127127
The USD string for the render scope.
128128
"""
129129
camera_rel_list = ", ".join([f"<{p}>" for p in camera_paths])
130130

131+
if background_color is None:
132+
bg_attrs = ['token omni:rtx:background:source:type = "domeLight"']
133+
else:
134+
r, g, b = background_color
135+
bg_attrs = [
136+
'token omni:rtx:background:source:type = "color"',
137+
f"float3 omni:rtx:background:source:color = ({r}, {g}, {b})",
138+
]
139+
background_lines = "\n ".join(bg_attrs)
140+
131141
if minimal_mode is None:
132142
render_mode_lines = ['token omni:rtx:rendermode = "RealTimePathTracing"']
133143
else:
@@ -148,16 +158,6 @@ def build_render_scope_usd(
148158
for _, name, source in render_var_configs
149159
)
150160

151-
if background_color is not None:
152-
r, g, b = (max(0.0, min(1.0, c)) for c in background_color)
153-
background_lines = (
154-
f'token omni:rtx:background:source:type = "color"\n'
155-
f" float3 omni:rtx:background:source:color = ({r}, {g}, {b})"
156-
)
157-
else:
158-
# Do not set background source type, so that the default dome light is used.
159-
background_lines = 'token omni:rtx:background:source:type = "domeLight"'
160-
161161
return f'''
162162
def Scope "Render"
163163
{{

0 commit comments

Comments
 (0)