I’m trying to find a way to draw a certain part of a mesh without actually creating / uploading a new mesh.
Basically I would love to be able to specify an index offset and length (and change them at any time) while having the same vertex and index buffers.
I guess it’s possible to achieve using this as the example shows
but in my case it seems sort of ‘hacky’ since I don’t need it to be neither instanced nor indirect.
I think you could use a compute shader and use some logic there to decide what is going to be rendered and then use that DrawProcedural to output your data to a structured buffer. And then render the buffer contents.
That way it would be at least rendered with lighting etc. so intergration with rest of the scene isn’t that big issues like earlier when you had to pretty much (afaik) reconstruct the lighting functions etc. yourself.
Keijiro has a good example that shows you pretty much every step you need (at least if your case happens to be similar.) https://github.com/keijiro/NoiseBall3