Sign in to follow this  

instancing with geometry shader

Recommended Posts

I reformulates a question.
hello , i have a lot of 2d shapes of 4 point , are always parallelograms
With the extrusion they have 8 points and my idea is to do the extrusion on the cpu, save all vertexes of extrusion in a texture and do a instancing drawing and in in the geometry shader I wish take the points from the texture so i can do a batch draw of many many 1 point and in the geometry shader read the points from the texture and emit the vertexes.
I try to do this because any my geometry  is similar and i have a lot of meshes.
Another approach is do an instance with a scale matrix (that is a 3d vector) then do only  a transformation on all points but i can't create a scale matrix from a base rectangle and a parallelogram that aren't similar but for rectangular shapes of different sides I think that this can be done.
Naturally i have a texture with the scale matrix or correct extruded vertexes and an instance id for take the vertex or the matrix from the texture with a sampler.
Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this