Skip to content

Commit 25d2b94

Browse files
YvainRaeymaekersEvergreen
authored andcommitted
Fix UUM-74749: APV Rendering Layers error when using mesh with multiple submeshes
JIRA: https://jira.unity3d.com/browse/UUM-74749
1 parent 8c11291 commit 25d2b94

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.RenderingLayers.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,11 @@ static AccelStructAdapter BuildAccelerationStructure()
117117
continue;
118118

119119
int subMeshCount = mesh.subMeshCount;
120-
for (int i = 0; i < subMeshCount; ++i)
121-
{
122-
var matIndices = new uint[subMeshCount];
123-
Array.Fill(matIndices, renderer.component.renderingLayerMask); // repurpose the material id as we don't need it here
124-
var perSubMeshMask = new uint[subMeshCount];
125-
126-
Array.Fill(perSubMeshMask, GetInstanceMask(renderer.component.shadowCastingMode));
127-
accelStruct.AddInstance(renderer.component.GetInstanceID(), renderer.component, perSubMeshMask, matIndices);
128-
}
120+
var matIndices = new uint[subMeshCount];
121+
Array.Fill(matIndices, renderer.component.renderingLayerMask); // repurpose the material id as we don't need it here
122+
var perSubMeshMask = new uint[subMeshCount];
123+
Array.Fill(perSubMeshMask, GetInstanceMask(renderer.component.shadowCastingMode));
124+
accelStruct.AddInstance(renderer.component.GetInstanceID(), renderer.component, perSubMeshMask, matIndices);
129125
}
130126

131127
foreach (var terrain in contributors.terrains)

0 commit comments

Comments
 (0)