Material with #PB_Material_AlphaBlend flag will render incorrectly when many billboards are rendered on top of each other towards the back of the scene.
Tested on 5.20b9 and 5.11 using OpenGL and DirectX9 using a PNG texture and billboards.
Fred wrote:We need a small snippet to reproduce the bug.
No need. Just run the BillboardGrass.pb demo.
Move camera to ground level, so the grass becomes big.
Then move left and right (or simply pan around) to see the bug.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
I did some research and I'm pretty sure this isn't a bug. It's a billboard/alphablending limitation and it's for all 3D engines not just Ogre.
The reason is alphablending is not commutative. So, depth buffers can't tell which pixels need to be drawn in front of each other without extra work.
The only way around this is to create each plane individually which voids the whole purpose of using billboards.
My advice is whenever possible don't use alphablending with billboards.
When you have use it. Make sure it's something not very obvious or limit the camera movement so it will never get at an angle to notice the issue.