BatchedMesh: per-geometry opacity?

Based on past conversations InstancedMesh was not ideal for having a setOpacityAt method because of lacking sorting. (I disagreed because there are still use cases that don’t require sorting)

The new BatchedMesh class does sorting!

It would be great to be able to configure certain common aspects of materials, such as .opacity, on a per-geometry basis.

I think instanced mesh supports opacity if you use 4 channel color format? I saw references to it in the shader code recently…

Oh! That would be useful! I have use cases that don’t need sorting of transparent objects. Especially great for 2D applications where there’s less need.

But still, this would be excellent for BatchedMesh somehow. I think it would require making an assumption in BatchedMesh that materials generally have opacity. Maybe it should be opt-in, so in case there’s a material without opacity, nothing breaks.

@gkjohnson wdyt?