Hi Everyone,
I have a dynamic lidar point cloud implementation(WebGL) where point counts change per frame.
For this implementation:
- Point cloud is a simple custom mesh(using BABYLON.Mesh and BABYLON.VertexData). My geometry comprises vertex, color, and index buffers.
- I allocated N vertices and initialized them with a linear arrangement.
- I update N number of vertices per frame
- For drawing dynamic point cloud, I use Submesh’s indexCount and set N vertices to control draw count dynamically.
This point cloud custom shape implementation has standard and shader materials.
- Standard material uses BABYLON.StandardMaterial’s
fillMode = BABYLON.Material.PointListDrawMode
- Point cloud material uses BABYLON.ShaderMaterial
pointsCloud
set astrue
The standard material point cloud shader works:-
But the shader material is not working at all. This is a BLOCKER for us.
Here is a playground example: Babylon.js Playground
- You can use
useShader
variables to switch between two material types and observe the difference. - For controlling dynamic draw count, use
dynamicCount
variable.
How can I update the index count dynamically on the shader material-based mesh? Kindly assist.