Skip to content

feat(render): UsdRender schema + computed render spec#90

Merged
mxpv merged 18 commits into
mxpv:mainfrom
bresilla:feat/render
May 31, 2026
Merged

feat(render): UsdRender schema + computed render spec#90
mxpv merged 18 commits into
mxpv:mainfrom
bresilla:feat/render

Conversation

@bresilla
Copy link
Copy Markdown
Contributor

@bresilla bresilla commented May 31, 2026

Adds UsdRender behind a render feature — the RenderSettings / RenderProduct / RenderVar / RenderPass schemas (read + author) plus the computed render spec.

The spec computation is the interesting part, built up in small commits each with its own tests: product-overrides-settings inheritance (the authored-only _Get rule), the aspect-ratio conform policy (all five modes), render-var de-duplication into a global list, and per-level namespacedSettings gathering.

No vendored UsdRender conformance assets exist, so validation is a hand-authored usdRender_scene.usda fixture plus in-memory author→read roundtrips.

Left as documented seams: node-graph-driven namespaced settings (need UsdShade value resolution), authoring the renderSettingsPrimPath stage metadata (needs a generic root-layer metadata setter — reading works), and UsdRenderDenoisePass (still a dev schema).

The RenderPass visibility/prune/matte collection memberships are gated on UsdCollectionAPI, which I've since put up in #92 — once that lands I'll wire the RenderPass collections on top in a small follow-up.

Copilot AI review requested due to automatic review settings May 31, 2026 10:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new render feature implementing the UsdRender schema reader/authoring surface plus an end-to-end computed render spec, validated against a fixture scene.

Changes:

  • Introduces UsdRender tokens, decoded types/defaults, readers, authoring helpers, and computed RenderSpec (compute_render_spec).
  • Implements aspect-ratio conform policy application and namespaced render-delegate settings gathering.
  • Adds fixture + integration/unit tests; wires up render feature flag and test target.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/render_reader.rs New integration tests validating reading + computed spec against a fixture stage.
src/schemas/render/mod.rs New render module surface and re-exports for readers/authoring/spec compute.
src/schemas/render/tokens.rs Central token/attribute/relationship constants for UsdRender.
src/schemas/render/types.rs Decoded enums + read structs with schema-faithful Default fallbacks and round-trip tests.
src/schemas/render/read.rs Reader implementations for settings/product/var/pass + camera aperture + relationship/value helpers.
src/schemas/render/spec.rs Value types for the computed flattened RenderSpec.
src/schemas/render/conform.rs Aspect-ratio conform policy implementation + unit tests.
src/schemas/render/compute.rs Spec computation logic (flattening, overrides, conform, var de-dup, namespaced settings) + unit tests.
src/schemas/render/author/* Authoring helpers for settings/product/var/pass and shared base setters + tests.
src/schemas/mod.rs Registers render schema module behind the new render feature.
fixtures/usdRender_scene.usda Hand-authored fixture scene used by integration tests.
Cargo.toml Adds render feature and render_reader integration test gated by it.
ROADMAP.md Marks UsdRender as implemented on main and documents remaining gaps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/schemas/render/conform.rs
Comment thread src/schemas/render/read.rs
Comment thread src/schemas/render/compute.rs
Comment thread src/schemas/render/compute.rs
bresilla and others added 4 commits May 31, 2026 14:56
The aspect-ratio guard only rejected a zero resolution height or
aperture height, so resolution[0] <= 0, a negative aperture, or a
non-positive pixelAspectRatio still reached the divisions and produced
an inf/NaN or negative aperture. Widen the guard to match C++
_ApplyAspectRatioPolicy (res/aperture both positive, imageAspectRatio
positive) and cover every case in the test.
read_rel_targets read the raw TargetPaths field via Stage::field and
flattened a single layer's list op, so products / orderedVars /
inputPasses / camera / renderSource dropped prepend/append/delete
edits contributed by weaker sublayers and references. The reader then
disagreed with compute_render_spec, which already resolves these
through the composing relationship-target API.

Route read_rel_targets through Stage::relationship_targets, which folds
list-op edits across every contributing layer (C++ GetTargets).
get_stage_render_settings read renderSettingsPrimPath off the absolute
root, which resolves through root-layer-only metadata and ignores
session-layer and sublayer opinions. A session layer setting the
metadata (a standard render-override workflow) was silently dropped,
diverging from C++ UsdRenderSettings::GetStageRenderSettings, which
reads it via UsdStage::GetMetadata.

Add Cache::stage_metadata / Stage::stage_metadata, which compose the
pseudo-root opinion session-over-root, and route the reader through it.
Also accept an AssetPath-typed opinion, not just String/Token.
Replace the **bold** emphasis pattern (forbidden by CLAUDE.md) with
plain text in the render reader/types/tokens/author docs. Clarify that
instantaneousShutter is deprecated in the C++ UsdRender schema and is
read only so older assets that author it round-trip.
@mxpv mxpv merged commit 7fd3f9d into mxpv:main May 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants