@@ -128,14 +128,18 @@ def _launch_app():
128
128
og_log .set_channel_enabled (channel , False , lazy .omni .log .SettingBehavior .OVERRIDE )
129
129
130
130
# Possibly hide windows if in debug mode
131
+ hide_window_names = []
132
+ if not gm .RENDER_VIEWER_CAMERA :
133
+ hide_window_names .append ("Viewport" )
131
134
if gm .GUI_VIEWPORT_ONLY :
132
- hide_window_names = ["Console" , "Main ToolBar" , "Stage" , "Layer" , "Property" , "Render Settings" , "Content" ,
133
- "Flow" , "Semantics Schema Editor" ]
134
- for name in hide_window_names :
135
- window = lazy .omni .ui .Workspace .get_window (name )
136
- if window is not None :
137
- window .visible = False
138
- app .update ()
135
+ hide_window_names .extend (["Console" , "Main ToolBar" , "Stage" , "Layer" , "Property" , "Render Settings" , "Content" ,
136
+ "Flow" , "Semantics Schema Editor" ])
137
+
138
+ for name in hide_window_names :
139
+ window = lazy .omni .ui .Workspace .get_window (name )
140
+ if window is not None :
141
+ window .visible = False
142
+ app .update ()
139
143
140
144
lazy .omni .kit .widget .stage .context_menu .ContextMenu .save_prim = print_save_usd_warning
141
145
@@ -235,9 +239,9 @@ def __init__(
235
239
self .clear ()
236
240
237
241
# Set the viewer dimensions
238
- # TODO: Make this toggleable so we don't always have a viewer if we don't want to
239
- self .viewer_width = viewer_width
240
- self .viewer_height = viewer_height
242
+ if gm . RENDER_VIEWER_CAMERA :
243
+ self .viewer_width = viewer_width
244
+ self .viewer_height = viewer_height
241
245
242
246
# Toggle simulator state once so that downstream omni features can be used without bugs
243
247
# e.g.: particle sampling, which for some reason requires sim.play() to be called at least once
@@ -331,14 +335,20 @@ def _set_physics_engine_settings(self):
331
335
self ._physics_context .set_gpu_max_particle_contacts (gm .GPU_MAX_PARTICLE_CONTACTS )
332
336
333
337
def _set_renderer_settings (self ):
334
- # TODO: For now we are setting these to some reasonable high-performance values but these can be made configurable.
335
- lazy .carb .settings .get_settings ().set_bool ("/rtx/reflections/enabled" , False ) # Can be True with a 10fps penalty
336
- lazy .carb .settings .get_settings ().set_bool ("/rtx/indirectDiffuse/enabled" , True ) # Can be False with a 5fps gain
337
- lazy .carb .settings .get_settings ().set_bool ("/rtx/directLighting/sampledLighting/enabled" , True )
338
+ if gm .ENABLE_HQ_RENDERING :
339
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/reflections/enabled" , True )
340
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/indirectDiffuse/enabled" , True )
341
+ lazy .carb .settings .get_settings ().set_int ("/rtx/post/dlss/execMode" , 3 ) # "Auto"
342
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/ambientOcclusion/enabled" , True )
343
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/directLighting/sampledLighting/enabled" , False )
344
+ else :
345
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/reflections/enabled" , False )
346
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/indirectDiffuse/enabled" , False )
347
+ lazy .carb .settings .get_settings ().set_int ("/rtx/post/dlss/execMode" , 0 ) # "Performance"
348
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/ambientOcclusion/enabled" , False )
349
+ lazy .carb .settings .get_settings ().set_bool ("/rtx/directLighting/sampledLighting/enabled" , True )
338
350
lazy .carb .settings .get_settings ().set_int ("/rtx/raytracing/showLights" , 1 )
339
351
lazy .carb .settings .get_settings ().set_float ("/rtx/sceneDb/ambientLightIntensity" , 0.1 )
340
- # TODO: Think of better setting defaults. Below works well for indoor-only scenes, but if skybox is the only light source then this looks very bad
341
- # carb.settings.get_settings().set_int("/rtx/domeLight/upperLowerStrategy", 3) # "Limited image-based"
342
352
343
353
@property
344
354
def viewer_visibility (self ):
@@ -409,6 +419,7 @@ def enable_viewer_camera_teleoperation(self):
409
419
"""
410
420
Enables keyboard control of the active viewer camera for this simulation
411
421
"""
422
+ assert gm .RENDER_VIEWER_CAMERA , "Viewer camera must be enabled to enable teleoperation!"
412
423
self ._camera_mover = CameraMover (cam = self ._viewer_camera )
413
424
self ._camera_mover .print_info ()
414
425
return self ._camera_mover
@@ -1288,12 +1299,12 @@ def _init_stage(
1288
1299
self .set_lighting_mode (mode = LightingMode .STAGE )
1289
1300
1290
1301
# Set the viewer camera, and then set its default pose
1291
- self . _set_viewer_camera ()
1292
- self .viewer_camera . set_position_orientation (
1293
- position = np . array ( m . DEFAULT_VIEWER_CAMERA_POS ),
1294
- orientation = np .array (m .DEFAULT_VIEWER_CAMERA_QUAT ),
1295
- )
1296
- self . viewer_visibility = gm . RENDER_VIEWER_CAMERA
1302
+ if gm . RENDER_VIEWER_CAMERA :
1303
+ self ._set_viewer_camera ()
1304
+ self . viewer_camera . set_position_orientation (
1305
+ position = np .array (m .DEFAULT_VIEWER_CAMERA_POS ),
1306
+ orientation = np . array ( m . DEFAULT_VIEWER_CAMERA_QUAT ),
1307
+ )
1297
1308
1298
1309
def close (self ):
1299
1310
"""
0 commit comments