Page 1 of 1

drawInstanced and setDrawRange

Posted: Sat Nov 21, 2020 12:55 pm
by grump
When having one mesh for the perinstance attributes of several other meshes that get drawn with drawInstanced, is it possible to set the start index of the vertex from which the attributes will be taken? I tried setDrawRange, but drawinstanced still starts reading the attached attributes from the first vertex.

I want to use one big streamed attribute mesh that holds the render attributes for all objects in the game, to share meshes between objects and keep a low number of draw calls. The alternative, using one attribute mesh per type of mesh would work too, but seems suboptimal.