Add custom viewport color correction (sRGB/OCIO), bypassing HdxColorCorrectionTask

Hydra's HdxColorCorrectionTask rendered prims black in OCIO mode and could
corrupt the GlfDrawTarget bind stack on failure (skipping Unbind), blacking
out every later frame including sRGB. Replace it with our own GL post-process:
the scene renders linear (RGBA16F) and is corrected by a fullscreen shader --
linear->sRGB encode, or OCIO via the OCIO 2.1 GPU API (GpuShaderDesc plus
uploaded 1D/3D LUT textures). OCIO build failures fall back to sRGB (never
black) and USD diagnostics are routed to the app log.

- core: ViewportColorCorrector + ApplyViewportColorCorrection in UsdSceneRenderer
- utils: OcioConfigParser enumerates displays/views/colorspaces/looks from $OCIO
- ui: gear-menu OCIO controls (ViewportTile) + per-viewport persistence (ViewportPanel)
- Application: point $OCIO at the bundled ACES 1.2 config
- CMake: link/copy OpenColorIO, download ACES 1.2 config; plus hdCycles build
  config (disable OpenVDB/Embree, fix TBB/OpenSubdiv/Imath dirs, exclude CRT DLLs)
- main: pre-flight plugin DLL load check to skip plugins with missing deps

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-27 17:10:44 +08:00
parent 8316e419ba
commit fb1ae9d3a6
12 changed files with 872 additions and 23 deletions
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
namespace UsdLayerManager {
struct OcioConfig {
std::vector<std::string> displays;
std::unordered_map<std::string, std::vector<std::string>> views; // display → views
std::vector<std::string> colorSpaces;
std::vector<std::string> looks;
std::string defaultDisplay;
std::string defaultView; // default view for defaultDisplay
bool valid = false; // false if $OCIO unavailable
};
/// Returns the OCIO config loaded from the $OCIO env var via the OCIO C++ API.
/// Result is cached — parsed once per process lifetime.
const OcioConfig& GetCurrentOcioConfig();
} // namespace UsdLayerManager