[Bf-committers] Improving dupli instance drawing in OpenGL viewport

Lukas Tönne lukas.toenne at gmail.com
Wed Jan 8 16:56:59 CET 2014

I've been preparing a few improvements to the dupli system, as part of the
ongoing particle work [1]. However To make large scale object instancing
really feasible in the 3D viewport i think we need to consider a few
changes to the way mesh data is displayed using OpenGL. The current way of
drawing objects leads to a lot of intermediate state changes in OpenGL,
which significantly reduces performance.

Since OpenGL 3.1 (2009, [2]) there are dedicated instance drawing methods
[3], which could be a great help in bringing the 3D viewport performance to
acceptable levels with thousands of instances of even pretty complex
objects (i have no real tests yet, obviously this also depends on available
hardware and drivers).

My Question is: Would it be acceptable to use such a OpenGL 3.1 feature in
Blender that might not work on older hardware? The current unoptimized
methods for drawing instances work ok as a fallback, so it's not like we're
locking anyone out. Do we have any precedence for this kind of issue? We
already have VBOs disabled by default too, would it be possible to enable
by default and check the GL_VERSION to ensure compatibility?

There is a bunch of other things that need to be done to make this work,
notably dupli objects need to be sorted so all instances can be drawn in a
single call (taking into account selection state, outline etc). I would
just like to clarify this question of GL version compatibility upfront.


[1] https://developer.blender.org/D189
[2] http://en.wikipedia.org/wiki/OpenGL#OpenGL_3.1
[3] http://www.opengl.org/wiki/Vertex_Specification#Instancing

More information about the Bf-committers mailing list