Skip to content

Commit 26d6266

Browse files
authored
Added an additional check in the "check scene for ray tracing" (case 1314963). (#3616)
1 parent 57b3f7d commit 26d6266

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1919
- Added browsing of the documentation of Compositor Window
2020
- Added a complete solution for volumetric clouds for HDRP including a cloud map generation tool.
2121
- Added a Force Forward Emissive option for Lit Material that forces the Emissive contribution to render in a separate forward pass when the Lit Material is in Deferred Lit shader Mode.
22+
- Added an additional check in the "check scene for ray tracing" (case 1314963).
2223

2324
### Fixed
2425
- Fixed an exception when opening the color picker in the material UI (case 1307143).

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ static void CheckSceneContentForRayTracing(MenuCommand menuCommand)
528528

529529
bool materialIsOnlyTransparent = true;
530530
bool hasTransparentSubMaterial = false;
531+
bool singleSided = true;
532+
bool hasSingleSided = false;
531533

532534
for (int meshIdx = 0; meshIdx < numSubMeshes; ++meshIdx)
533535
{
@@ -547,6 +549,13 @@ static void CheckSceneContentForRayTracing(MenuCommand menuCommand)
547549
// aggregate the transparency info
548550
materialIsOnlyTransparent &= materialIsTransparent;
549551
hasTransparentSubMaterial |= materialIsTransparent;
552+
553+
// Evaluate if it is single sided
554+
bool doubleSided = currentMaterial.doubleSidedGI || currentMaterial.IsKeywordEnabled("_DOUBLESIDED_ON");
555+
556+
// Aggregate the double sided information
557+
hasSingleSided |= !doubleSided;
558+
singleSided &= !doubleSided;
550559
}
551560
else
552561
{
@@ -561,6 +570,12 @@ static void CheckSceneContentForRayTracing(MenuCommand menuCommand)
561570
Debug.LogWarning("The object " + currentRenderer.name + " has both transparent and opaque sub-meshes. This may cause performance issues");
562571
generalErrorFlag = true;
563572
}
573+
574+
if (!singleSided && hasSingleSided)
575+
{
576+
Debug.LogWarning("The object " + currentRenderer.name + " has both double sided and single sided sub-meshes. The double sided flag will be ignored.");
577+
generalErrorFlag = true;
578+
}
564579
}
565580

566581
if (!generalErrorFlag)

0 commit comments

Comments
 (0)