It was very tricky to get the drawing working in Blender.
Because if you make an fault the Blender UI can be overdrawn or Blender will crash instantly.
The last two examples can be used to rebuild an existing mesh.
22.12.2015 Added mesh optimisation and texturing example.
Wow, this is really nice! I tested on my Intel HD Graphics and I got 80 fps on the high-poly mesh.
I had to modify the shaders a little bit, my graphics card only supports OpenGL 1.2
Basically yes. But you don’t get any collision from the generated mesh because the mesh will not be transferred to Bullet engine this way.
If you need collision you need the add a plan (subdivided Blender plane), under the player, that will be moved and distorted the same way as your environment is.
I updated my examples.
I implemented a mesh optimizing code which will reduce the amount mesh vertices.
I also added an example with texturing. There is a little known bug. The texture will not correctly freed.
When you press ESC the textureID will not be freed. Every start of the BGE it will count up.
It will be only freed if you close Blender.
I actually don’t found a good way to free it. Maybe I can fix this in the future.
The framerate that is displayed should be the correct one.
On my old GTX 460 it runs with between 970 and 1070 Fps. But actually there is no lighting and shadowing.
With one light and no shadows it will run approximate with 860Fps.
So this is a true path to fast instancing of geometry in the bge?
Can we batch ourselves? How hard would that be to impliment static mesh batching with a atlas?
Yes. You can do this this way.
I don’t know how long it will take to get it working. But if you also want that LOD working too, it will get much more complicated.
Let me know if you want a kit to test it with,
(wrectified level assembly kit)
This makes me so happy!
All that is left for wrectified is to be able to generate a unique compound object shape per instance that is a root or a compound…
Can you save a matrix of static instances as a pickle file? I have a system that I can use to build levels in game, and I pickle the data, but I doubt this is a format that GLSL can grab…