Skip to content

Commit

Permalink
Merge branch 'feature/openxr-support' into integration/openxr-and-icosa
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Dec 9, 2024
2 parents dea8e6f + c70231c commit 95c28ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Assets/Scripts/tools/utils/HighlightStyles/MeshCycler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static Mesh GetTempMeshForMeshMatId(int meshId, int materialId, out bool
mesh = new Mesh();
}

matDict[meshId] = mesh;
matDict[materialId] = mesh;
return mesh;
}

Expand Down
13 changes: 8 additions & 5 deletions Assets/Scripts/tools/utils/HighlightStyles/MeshDeleteStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,19 @@ public static void RenderMeshes(Model model,
int matId = pair.Key;
MeshGenContext meshGenContext = pair.Value;

Mesh curMesh = new Mesh();
Mesh curMesh = MeshCycler.GetTempMeshForMeshMatId(key, matId, out bool needToPopulateMesh);
Material curMaterial = animPct >= .99f ? matDict[MaterialRegistry.GetMaterialType(matId)].GetFixedMaterial() :
matDict[MaterialRegistry.GetMaterialType(matId)].GetInstanceOfMaterial();
curMaterial.SetFloat("_OverrideAmount", emissiveAmount);
curMaterial.SetColor("_OverrideColor", ERASE_COLOR);
curMaterial.renderQueue = 3000;
curMesh.SetVertices(meshGenContext.verts);
curMesh.SetColors(meshGenContext.colors);
curMesh.SetTriangles(meshGenContext.triangles, /* subMesh */ 0);
curMesh.RecalculateNormals();
if (needToPopulateMesh)
{
curMesh.SetVertices(meshGenContext.verts);
curMesh.SetColors(meshGenContext.colors);
curMesh.SetTriangles(meshGenContext.triangles, /* subMesh */ 0);
curMesh.RecalculateNormals();
}

Graphics.DrawMesh(curMesh, worldSpace.modelToWorld, curMaterial, 0);
}
Expand Down

0 comments on commit 95c28ca

Please sign in to comment.