Aeva / m.grl

Midnight Graphics & Recreation Library
http://mgrl.midnightsisters.org
GNU Lesser General Public License v3.0
44 stars 3 forks source link

automatic instanced rendering heuristic #246

Closed Aeva closed 7 years ago

Aeva commented 7 years ago

This builds off the work done on #232, as this solves many of the problems originally encountered in #195. See also: #197.

The criteria for automatic instancing might be this:

  1. A large number of consecutive drawing calls without rebinding buffers or textures etc.
  2. The only uniform properties that change in that time support instancing (#197).
  3. The objects are all static: no visibility changing, dynamic sorting, or dynamic uniform values.

This could be further limited to only objects drawn via stamping, which ensures that we never need to de-instance anything.

Some tasks:

Fuzzy bits:

It looks like please.gl.vbo already has scaffolding for instancing and static code generation from an earlier effort, and can be used to track multiple arrays at once. Soooo, all that is really needed is to populate the arrays from static objects, and split matrices apart.

Aeva commented 7 years ago

This is complete enough to merge into fast_graph. Closing this ticket, will open a new one for making a more robust demo.