Skip to content

Align imported ARENA renderer color space defaults with Linear - #165

Merged
mwfarb merged 3 commits into
mainfrom
copilot/adjust-gamma-color-space
Jul 31, 2026
Merged

Align imported ARENA renderer color space defaults with Linear#165
mwfarb merged 3 commits into
mainfrom
copilot/adjust-gamma-color-space

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ARENA web scenes commonly assume Linear color space, while some Unity projects are configured for Gamma. That mismatch can make imported scenes render darker or with different light falloff than intended.

  • Renderer default alignment

    • Change the imported renderer-settings.outputColorSpace default from SRGBColorSpace to LinearSRGBColorSpace
    • This makes scene-option imports better match ARENA’s typical web rendering baseline when the field is omitted
  • Mismatch diagnostics

    • Tighten the existing runtime warning for renderer-settings
    • The warning now calls out the visible symptom (darker colors / different light falloff) and points directly to the Unity Player setting to update
  • Schema metadata

    • Update the outputColorSpace tooltip text to reflect the ARENA-side expectation instead of the previous sRGB wording

Example:

private static OutputColorSpaceType defOutputColorSpace =
    OutputColorSpaceType.LinearSRGBColorSpace;

Copilot AI linked an issue Jul 18, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Adjust gamma color space for better rendering Align imported ARENA renderer color space defaults with Linear Jul 18, 2026
Copilot AI requested a review from mwfarb July 18, 2026 16:19
@mwfarb

mwfarb commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Architectural Code Review — PR #165

Linked Issue

Issue #150"Adjust Gamma Color Space"

"Some projects use Gamma Color Space [...] ARENA scenes on the web often have closer to the default using Linear Color Space [...] We should work on importing color space settings defaults from ARENA."

Summary

Changes the default outputColorSpace in ArenaRendererSettingsJson.cs from SRGBColorSpace to LinearSRGBColorSpace, updates the tooltip to reflect ARENA expectations, and improves the runtime mismatch warning message. Two files changed: Runtime/Schemas/Attribute/ArenaRendererSettingsJson.cs (+2/-2), Runtime/Components/ArenaSceneRendererSettings.cs (+1/-1).

Issue → Implementation Gap Analysis

Issue Requirement Implemented? Notes
Align color space defaults with ARENA web ⚠️ See blocking finding below
Inform users of color space mismatch Improved warning with symptom + fix instructions
Import color space settings from ARENA Default change ensures omitted fields default correctly

CONTRIBUTING.md Compliance

Rule Status
1. MQTT Topics — Use TOPICS constructor ✅ N/A
2. Dependencies — Pin versions ✅ N/A
3. Component instantiation pattern ✅ N/A
4. Coordinate systems — Use ArenaUnity.cs ✅ N/A

Architecture Assessment

✅ Warning message improvement is excellent. The new message includes:

  • The visible symptom ("darker colors or different light falloff")
  • The exact Unity menu path to fix it ("Edit > Project Settings > Player > Rendering > Color Space")
    This is a significant usability improvement.

✅ Tooltip update is appropriate. Changing from "three.js default is SRGBColorSpace" to "ARENA web scenes commonly use LinearSRGBColorSpace" better reflects the actual ARENA ecosystem expectation.

❌ Blocking Finding: Default Change Contradicts arena-schemas

The arena-schemas canonical source defines the default as SRGBColorSpace:

"outputColorSpace": { "default": "SRGBColorSpace" }

This PR changes the arena-unity default to LinearSRGBColorSpace. This means:

  1. When a scene does not specify outputColorSpace (field omitted): arena-web-core will use SRGBColorSpace (per schema), but arena-unity will use LinearSRGBColorSpacecolor mismatch between clients.

  2. ShouldSerializeOutputColorSpace() returns true unconditionally (it is required in the schema). So the default value will be serialized into outgoing messages, potentially overwriting the scene's intended color space on the server.

Recommendation: Either:

  • (a) Update the arena-schemas default to LinearSRGBColorSpace first, then align this PR
  • (b) Keep the arena-unity default matching arena-schemas (SRGBColorSpace) and only keep the improved warning message + tooltip

Verdict: ❌ BLOCKED — default conflicts with arena-schemas

The warning message improvement is great and should be merged. But the default change needs to be reconciled with arena-schemas first to avoid cross-client color space disagreement.

arena-schemas defines SRGBColorSpace as the default outputColorSpace.
Keep the improved warning message and tooltip but align the default
with the canonical schema source to avoid cross-client mismatch.
@mwfarb
mwfarb marked this pull request as ready for review July 31, 2026 20:58
@mwfarb
mwfarb merged commit b04c7c4 into main Jul 31, 2026
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.

Adjust Gamma Color Space

2 participants