Closed haitaoli closed 6 years ago
I can see the billboard mode just fine as far as I can tell. Maybe it is an issue with the version of babylon js and the browser ?
I should have attached screenshots earlier. Here the "Old" screenshot is taken from https://andyhall.github.io/noa-testbed/ which is using the version of the engine from two years ago. When you move around the flower, you can see it's always facing the camera. "New" is from http://andyhall.github.io/noa-lt/ which is using a more recent version of the engine, you can the "edge" of the texture.
Old | New |
---|---|
Hi, if you look closely the updated version isn't a billboard mesh at all. See here (the comment is wrong!).
I replaced it when I did some optimization for static object meshes.
Thanks for the reply! Is billboard mode supposed to work, or totally removed? I tried adding this code to makeFlowerSpriteMesh
but it has no effect:
mesh.billboardMode = BABYLON.Mesh.BILLBOARDMODE_Y
Hi, I'm not sure about the state of billboard mode in Babylon generally. I assume it still works but there were some changes last year or so, so old code may need to be tweaked to work in current BJS.
However for noa specifically, in version 0.22 I changed the way terrain object meshes work. When you define a terrain block with an object mesh (like the flowers in this demo), noa assumes the mesh is static, and when it builds the chunk it merges all the object meshes (to improve performance). That is, in the demo you're looking at, all those flowers are merged into one big mesh (per-chunk), so they can't individually rotate like billboards.
If you want to have non-static meshes for your terrain, you can add them manually with block events. That is, register the "flower" terrain block with noa as having no mesh, but use the block events to create/destroy any custom mesh whenever a block with that ID is added or removed from the scene.
PS: remember to call noa.rendering.addMeshToScene
when adding your own meshes - it's annoying, but this lets noa use octrees when rendering, which generally improves performance a lot.
The old version of the engine supported billboardMode. But it's broken in recent versions, as shown in . http://andyhall.github.io/noa-lt/ demo app.