Edge Rendering and Thin Instances

Dear community,

I started using thin instances and they are pretty neat (so far I am using coloring, textures and transparency).

However, when I enable edge rendering, I realized that they seem to ignore the depth order - I expected the red plane to hide the lower edge of the green plane:

Is this a general limitation of thin instances?

Furthermore, I wondered if it is possible to change the edge color and alpha for single thin instances. So far I only see a way to give all thin instances of one mesh the same edge color/alpha.

Is there a way around it, similar to using the attributes for manipulating the color?

Kind regards,

1 Like

That’s because you enabled alpha blending with plane.hasVertexAlpha = true. So, the mesh is considered to be transparent and does not write into the zbuffer, meaning the lines won’t be culled by the meshes.

You should either set the value to false or create and assign a material that forces to write to the zbuffer (material.forceDepthWrite = true).

Example using a material that forces depth write:

No, the edge renderer does not currently support a different color per instance / thin instance.


Thanks a lot for your answer! This helps a lot. I did not know forceDepthWrite so far - are there negative performance implications when this is used?

1 Like

nope all good