Billboard Mode ALL Not Working As LOD

Yo @Deltakosh and @sebavan

Hey guys… I got a bug with LOD and billboard mode.

Bill board mode all is working fine… if i pan the camera around the billboard mesh is always facing the camera. Works great… But as soon as i use mesh.addLODLevel(100, billboardMesh) to add it as LOD3… Its stop working as billboard mode and if you pan the camera around it NO LONGER faces the camera and you can get BEHIND the billboard.

Everything is great UNTIL i do addLODLevel using a billboard mesh as one the LOD levels…

Is hard to make a playground… i will try… But i thought i would put this out there in case anyone has ran into this issue and can tell me how to fix it… Any help is always appreciated :slight_smile:

Well it should not be that hard to setup a quick PG starting from one of our LOD PG from the doc

Yo @Deltakosh … Here is a playground : Babylon.js Playground

is has a Sphere, Box and Plane (Billboard)

the Box and Billboard Plane are added as LOD levels to sphere… But if you back the camera out past 50 units to activate the billboard plane… and rotate… the billboard NO LONGER faces the camera so you can rotate around and see behind the billboard which eventually goes invisible (backFaceCulling i imagine)

But if i don’t use the billboard as a LOD level… it DOES always face the camera.

So something in addLODLevel is killing billboardMode :frowning:

Ok gotcha! I’ll fix that asap

Ok fixed!! It will be in next commit :slight_smile:
Just one warning, you should not change the position of any LOD with billboard as this will apply an offset (you should just leave plane1.position to 0)

In general… Should i always set the mesh.position = Vector3.zero for the mesh i pass into addLODLevel… What about rotation ???

Rotation and everything is ignored. Every lod mesh will have the same transform as the master mesh.

It was the bug you hit for billboard. So I changed it so that billboard is now calculated

Yo @Deltakosh … Just got the fix… The billboard works now but it RE-PARENTS the billboard to the LOD0… All the other LODX dont get reparented (which i prefer)… But the fix now moves the billboard transform under LOD0:

If you can fix that too… that would be be awesome :slight_smile:

That is the fix :slight_smile:
I’ll see later if I can improve it

Wait I may have an idea…stay tuned

Sweet :slight_smile:

Ok I managed to fix the parent issue :slight_smile:
Will be in next commit (in a few minutes)

1 Like