Jump to content
Posted 13 September 2011 - 08:05 PM
Posted 14 September 2011 - 05:23 AM
Posted 14 September 2011 - 07:59 AM
Posted 14 September 2011 - 11:28 AM
you can stuff all objects into one buffer, with 15872 triangles. Adding per vertex an index that identifies the object (like an ID, maybe into the alpha channel of the color, if you provide this in your vertex-stream).
then you set your 128 transformations as constants and draw all if it in one go, by indexing in the vertex shader into the constants area, using the per-vertex ID.
- I think that shall be the fastest way
- make sure you can fit enough constants in your Vertexshader/vertexprogram version, otherwise you'd need to split it.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Posted 16 September 2011 - 12:24 AM
Posted 20 September 2011 - 02:11 AM
You can always discard any geometry in geometry shader, simply by not appending anything to the output stream(s). However and obviously, it's always better to avoid this at the CPU level :-)
That's a really nice technique but I can only see it working with a fixed number of objects that doesn't change.
How do you deal with objects that no longer exist (say they got blown up by the player) ?
Posted 20 September 2011 - 06:49 PM
Posted 21 September 2011 - 10:45 AM