Add background_color to CameraCfg for cross-backend solid color camera backgrounds#6594
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge; all three backends implement the feature correctly and the default None path is fully backward-compatible. The change is additive and non-breaking. The Newton and OV RTX implementations include proper clamping and the new tests verify the OV RTX USD output. The PhysX RTX path omits clamping and its changelog entry describes a superseded implementation, but neither issue can cause a crash or data corruption at runtime. isaac_rtx_renderer.py (missing value clamp) and isaaclab_physx/changelog.d/mataylor-camera-background-color.rst (description does not match implementation). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CameraCfg\nbackground_color: tuple | None"] --> B{Which backend?}
B --> C["Newton\n(NewtonWarpRenderer)"]
B --> D["OV RTX\n(OVRTXRenderer)"]
B --> E["PhysX RTX\n(IsaacRtxRenderer)"]
C --> C1{background_color set?}
C1 -- Yes --> C2["Clamp to [0,255]\nPack ARGB uint32\nSet ClearData.clear_color"]
C1 -- No --> C3["Default 0xFFEEEEEE (93% gray)"]
D --> D1["build_render_scope_usd(background_color=...)"]
D1 --> D3{background_color set?}
D3 -- Yes --> D4["Clamp to [0.0,1.0]\nomni:rtx:background:source:type = 'color'\nfloat3 omni:rtx:background:source:color"]
D3 -- No --> D5["omni:rtx:background:source:type = 'domeLight'"]
E --> E1{background_color set?}
E1 -- Yes --> E2["Raw values (no clamp)\nrp_prim.CreateAttribute(type='color')\nrp_prim.CreateAttribute(color=(r,g,b))"]
E1 -- No --> E3["No USD attr written\n(backend default)"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["CameraCfg\nbackground_color: tuple | None"] --> B{Which backend?}
B --> C["Newton\n(NewtonWarpRenderer)"]
B --> D["OV RTX\n(OVRTXRenderer)"]
B --> E["PhysX RTX\n(IsaacRtxRenderer)"]
C --> C1{background_color set?}
C1 -- Yes --> C2["Clamp to [0,255]\nPack ARGB uint32\nSet ClearData.clear_color"]
C1 -- No --> C3["Default 0xFFEEEEEE (93% gray)"]
D --> D1["build_render_scope_usd(background_color=...)"]
D1 --> D3{background_color set?}
D3 -- Yes --> D4["Clamp to [0.0,1.0]\nomni:rtx:background:source:type = 'color'\nfloat3 omni:rtx:background:source:color"]
D3 -- No --> D5["omni:rtx:background:source:type = 'domeLight'"]
E --> E1{background_color set?}
E1 -- Yes --> E2["Raw values (no clamp)\nrp_prim.CreateAttribute(type='color')\nrp_prim.CreateAttribute(color=(r,g,b))"]
E1 -- No --> E3["No USD attr written\n(backend default)"]
Reviews (2): Last reviewed commit: "update" | Re-trigger Greptile |
…rounds Adds a new optional `background_color` attribute to `CameraCfg` that accepts normalized RGB floats and wires through to all three renderer backends: - Newton: converts to ARGB uint32 and passes as `SensorTiledCamera.ClearData.clear_color` - OV RTX: authors `omni:rtx:background:source:type = "color"` and the corresponding color attribute on the USD render product - PhysX RTX (IsaacRtx): applies `/rtx/background/source/type = 2` and color via the settings manager Defaults to `None` so existing behavior is preserved for all backends.
1a86447 to
2a17d48
Compare
Description
Adds
CameraCfg.background_color: tuple[float, float, float] | None— normalized RGB floats in[0, 1], defaulting toNone(preserves existing per-backend defaults).Wires the setting through all three renderer backends:
NewtonWarpRenderer): converts to ARGBuint32and passes asSensorTiledCamera.ClearData.clear_color.OVRTXRenderer/build_render_scope_usd): authorsomni:rtx:background:source:type = "color"andomni:rtx:background:source:coloron the USD render product; leaves the default"domeLight"background unchanged whenNone.IsaacRtxRenderer): applies/rtx/background/source/type = 2(Color mode) and/rtx/background/source/colorvia the settings manager during camera setup.Adds unit tests for the OV RTX USD path (
test_ovrtx_usd.py) covering the dome-light default and the solid-color branch.Adds changelog fragments for all four touched packages.
./isaaclab.sh -p -m pytest source/isaaclab_ov/test/test_ovrtx_usd.py::test_build_render_scope_usd_default_background_is_dome_lightpasses./isaaclab.sh -p -m pytest source/isaaclab_ov/test/test_ovrtx_usd.py::test_build_render_scope_usd_solid_background_colorpassesNewton renderer renders with correct solid color when
background_color=(r, g, b)is setOV RTX renderer renders with correct solid color background (no dome light bleed)
PhysX RTX renderer renders with correct solid color background
All three backends behave unchanged when
background_color=NoneFixes # (OMPE-85828)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
IsaacRTX

OVRTX
TODO
Newton

Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there