Hello everyone,
I was trying to understand how rendering is done in Babylon, but got a bit confused by its pipeline.
It’s how I see it working right now:
Firstly there is something like preparation stage when we create submesheshes for each mesh that should be rendered. Basically submesh stores reference to the mesh and a “rendering” mesh (which is the LOD of the parent mesh in case the “source” mesh instantiated).
Then submesh passed to the rendering manager and attached to a group.
During rendering stage, each submesh is called to be drawn and that plainly calls “rendering” mesh to be drawn.
From this point I think I am missing something because when render()
method called it renders mesh and its instances either and as far as there can be many submeshes referring to the same “rendering” mesh it would rerender meshes.
As it can’t be true my question is where I made a mistake.
Perhaps I am wrong in some other moments (or even completely wrong) so I will be very thankful for any response.