View Full Version : instancing in opengl 4 and scale matix

08-21-2015, 03:07 AM
Hello , i have a model with 10000 meshes or more.
All the mesh are extruded from a 2d shape , a direction and a depth.
I search to speed up the rendering.
I think to use instancing .
I have at max 10 shapes but the 10000 meshes have a depth and direction different.
If i place all the scale matrixes in a texture object or an uniform buffer and in the instancing vertex shader i pick up it and use scale matrix that change the depth essentially for your experience i can speed up the rendering?
and obtains different meshes for the lenght?
I add that there is only a camera and the meshes are static i can precalculate the world matrix and use it? and for the MVP matrix i can send only the projection matrix.
And if using a deferred render?
the meshes must be rendered clear the best ,may be a shader like the sun in skechup.
What light system is better?

08-21-2015, 06:47 AM
is possible to extrude a 2d shape on the gpu on the fly?
because i have a milion of extruded 2d shape and the family of shapes ( the shapes that are not identical) are only 10/20.
I'm thinking to use the instancing for draw the different shapes and take the points from a texture buffer and extrude all in geometry shader.
is possible?
so i would to limit the band width and the gl calls.
I ask you if the extrusion in the geometry shader takes many time and can incides on the performance.
I'm in a critical position and i must also save the geometry , in this case i save only the 2d shapes.
also i must use the scale matrix for the identical shapes with different extrusion depth .