Skip to content

Add background_color to CameraCfg for cross-backend solid color camera backgrounds#6594

Open
mataylor-nvidia wants to merge 7 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/camera-background-color
Open

Add background_color to CameraCfg for cross-backend solid color camera backgrounds#6594
mataylor-nvidia wants to merge 7 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/camera-background-color

Conversation

@mataylor-nvidia

@mataylor-nvidia mataylor-nvidia commented Jul 17, 2026

Copy link
Copy Markdown

Description

  • Adds CameraCfg.background_color: tuple[float, float, float] | None — normalized RGB floats in [0, 1], defaulting to None (preserves existing per-backend defaults).

  • Wires the setting through all three renderer backends:

    • Newton (NewtonWarpRenderer): converts to ARGB uint32 and passes as SensorTiledCamera.ClearData.clear_color.
    • OV RTX (OVRTXRenderer / build_render_scope_usd): authors omni:rtx:background:source:type = "color" and omni:rtx:background:source:color on the USD render product; leaves the default "domeLight" background unchanged when None.
    • PhysX RTX (IsaacRtxRenderer): applies /rtx/background/source/type = 2 (Color mode) and /rtx/background/source/color via 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_light passes

  • ./isaaclab.sh -p -m pytest source/isaaclab_ov/test/test_ovrtx_usd.py::test_build_render_scope_usd_solid_background_color passes

  • Newton renderer renders with correct solid color when background_color=(r, g, b) is set

  • OV 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=None

Fixes # (OMPE-85828)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

IsaacRTX
shadow_hand_isaac_rtx_yellow_bg

OVRTX
TODO

Newton
shadow_hand_newton_yellow_bg

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a background_color: tuple[float, float, float] | None field to CameraCfg and wires it through all three renderer backends (Newton, OV RTX, PhysX RTX) so users can set a solid camera background in a unified, cross-backend way.

  • Newton: converts to ARGB uint32 with proper [0, 255] clamping and passes it as SensorTiledCamera.ClearData.clear_color.
  • OV RTX: clamps to [0.0, 1.0] and inlines the USD attributes into the generated render scope string; new unit tests cover both the dome-light default and the solid-color branch.
  • PhysX RTX: sets the same attributes as per-render-product USD properties on the replicator render product prim, providing per-camera isolation; however, raw float values are forwarded without clamping (unlike the other two backends), and the changelog entry still describes an older carb-settings-manager implementation that no longer matches the code.

Confidence Score: 5/5

Safe 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

Filename Overview
source/isaaclab/isaaclab/sensors/camera/camera_cfg.py Adds `background_color: tuple[float, float, float]
source/isaaclab_newton/isaaclab_newton/renderers/newton_warp_renderer.py Reads background_color from config, converts to ARGB uint32 with proper clamping, and falls back to the existing 0xFFEEEEEE gray default. Change is clean and consistent.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py Adds background_color parameter to build_render_scope_usd / build_render_product_as_string; channels are clamped to [0,1] before interpolation. Minor: the else branch comment contradicts what the code does.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py Forwards background_color from spec.cfg to build_render_product_as_string via getattr; minimal and correct change.
source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py Uses per-render-product USD attributes (not carb settings), which is the right isolation approach. However, raw float values are passed without the [0,1] clamping that the Newton and OV RTX paths apply, and the changelog entry describes a superseded implementation.
source/isaaclab_ov/test/test_ovrtx_usd.py Two new unit tests cover the dome-light default and the solid-color path; both assertions correctly reflect the current implementation output.
source/isaaclab_physx/changelog.d/mataylor-camera-background-color.rst Changelog text describes a carb-settings-manager implementation that was superseded by per-render-product USD attributes in the actual code; the description is inaccurate.

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)"]
Loading
%%{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)"]
Loading

Reviews (2): Last reviewed commit: "update" | Re-trigger Greptile

Comment thread source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py Outdated
Comment thread source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py Outdated
Comment thread source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py Outdated
…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.
@mataylor-nvidia
mataylor-nvidia force-pushed the mataylor/camera-background-color branch from 1a86447 to 2a17d48 Compare July 17, 2026 20:44
@mataylor-nvidia
mataylor-nvidia requested a review from a team July 17, 2026 21:17
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants