Cause and mechanism
sRGB is one way image color values correspond to displayed brightness. If a RenderTexture differs from the original view, trace its format and sRGB conversions, exposure and tonemapping, and the display Shader. Compare the image before and after RawImage; RawImage does not universally interpret every input as sRGB.
Check and correct the setup
- Disable preview and display post-processing initially and compare identical colors.
Schematic: also inspect neutral white and gray - Choose a suitable sRGB LDR format or linear floating-point HDR intermediate. Setting sRGB=true is not a universal fix.
Schematic: also inspect neutral white and gray - Compare with the standard UI shader; remove duplicate manual conversions and avoid tonemapping an already-finished preview twice.
Schematic: also inspect neutral white and gray
Limits and verification
Volume Mask selects Volume layers, not UI pixels to exempt from a fullscreen effect. Separate composition paths where appropriate and compare neutral gray and primary colors.
A focused diagnostic setup
Map input colors, texture format, compositing shader and final output. For an HDR camera preview, explicitly choose where exposure and tone mapping occur.
Test in this order
- Compare known gray and primary-color patches with post-processing disabled.
Schematic: also inspect neutral white and gray - Distinguish LDR color, HDR color and non-color data before choosing formats and conversion.
Schematic: also inspect neutral white and gray - Inspect HDR and final LDR stages separately for duplicate transfer functions or tone mapping.
Schematic: also inspect neutral white and gray
Interpret the result
Uniform darkening and dark transparent edges need different checks: conversion/exposure versus alpha and transparent RGB. One sRGB toggle is not a universal remedy.
Related explanations
- Diagnose dark or overbright RenderTexture previews
- Diagnose dark transparent edges in RenderTexture UI