Add per-viewport cull style option

Exposes UsdImagingGLCullStyle as a Cull Style sub-menu in the gear popup
(Back Unless Double-Sided / Back / Front / Nothing / No Opinion). Defaults
to BackUnlessDoubleSided, matching usdview. Setting persists per-viewport
to viewport_settings.ini.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 08:15:20 +08:00
parent 7586d380e9
commit 781d464f47
5 changed files with 35 additions and 1 deletions
+2 -1
View File
@@ -174,6 +174,7 @@ UsdSceneRenderer::UsdSceneRenderer()
, m_aaEnabled(false)
, m_backgroundColor(0.15f, 0.15f, 0.15f)
, m_shadingMode(ShadingMode::SmoothShaded)
, m_cullStyle(CullStyle::BackUnlessDoubleSided)
, m_colorCorrectionMode(ColorCorrectionMode::sRGB)
, m_ambientLightOnly(true)
, m_domeLightEnabled(false)
@@ -728,7 +729,7 @@ void UsdSceneRenderer::Render(int width, int height)
m_renderParams.showRender = m_showRender;
m_renderParams.enableSampleAlphaToCoverage = true;
m_renderParams.gammaCorrectColors = false;
m_renderParams.cullStyle = pxr::UsdImagingGLCullStyle::CULL_STYLE_BACK_UNLESS_DOUBLE_SIDED;
m_renderParams.cullStyle = static_cast<pxr::UsdImagingGLCullStyle>(m_cullStyle);
m_renderParams.enableSceneMaterials = true;
m_renderParams.enableSceneLights = true;
m_renderParams.highlight = true;