Replace custom ViewportColorCorrector with stageView.py color correction

Remove the custom GL post-process (ViewportColorCorrector) that bypassed
HdxColorCorrectionTask. Instead pass colorCorrectionMode, ocioDisplay,
ocioView, ocioColorSpace, and ocioLook directly to UsdImagingGLRenderParams
and SetColorCorrectionSettings(), delegating correction to Hydra —
the same approach used in usdview's stageView.renderSinglePass().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 01:35:06 +08:00
parent 45d1cc4391
commit a59b3a5405
3 changed files with 36 additions and 361 deletions
-15
View File
@@ -25,10 +25,6 @@
namespace UsdLayerManager {
/// Custom viewport color-correction post-process (sRGB / OCIO) implemented in
/// our own GL shader instead of HdxColorCorrectionTask. Defined in the .cpp.
class ViewportColorCorrector;
/// Bounding box display mode for selected prims.
enum class BBoxMode {
None, ///< No bounding boxes drawn
@@ -392,17 +388,6 @@ private:
pxr::SdfPathVector m_cachedCameraPaths;
bool m_cameraCacheDirty = true;
// --- Custom color-correction post-process ---------------------------------
// The scene is rendered linear (Hydra correction "disabled") and corrected
// by our own GL shader, bypassing HdxColorCorrectionTask. ApplyViewport-
// ColorCorrection() resolves the linear result into m_ccLinearTex, then
// draws a corrected fullscreen quad back into the draw-target FBO.
void ApplyViewportColorCorrection(int width, int height);
std::unique_ptr<ViewportColorCorrector> m_colorCorrector;
GLuint m_ccLinearFBO = 0; ///< FBO wrapping m_ccLinearTex (correction input)
GLuint m_ccLinearTex = 0; ///< single-sample linear copy of the Hydra output
int m_ccLinearW = 0;
int m_ccLinearH = 0;
};
} // namespace UsdLayerManager