Hey,
I’m texturing a list of meshes via DrawMeshShaded()
like this:
public override void DrawViewportMeshes(IGH_PreviewArgs args)
{
for (int i = 0; i < mesh.Count; i++)
{
mesh[i].SetTextureCoordinates(textureMapping[i], Transform.Identity, true);
args.Display.DrawMeshShaded(mesh[i], new Rhino.Display.DisplayMaterial(material[i]));
}
}
In Shaded
mode everything works well:
Switching to Rendered
makes my custom meshes transparent if they visually intersect with an existing Rhino object (white box). This only happens if shadows are on, though. While this is true for Rhino geometry, custom meshes remain opaque while visually intersecting with other custom objects (violet box). Also, custom objects don’t cast shadows, while existing Rhino geometry does.
Running the same geometry through a Custom Preview
component fixes both issues.
Any idea how to fix this? I’ve found this issue. Could these be related @jeff?