Hair system, pick random from dupligroup leads to a huge viewport performance drop
Open, ConfirmedPublic

Description

System Information
CentOS, Nvidia GTX Titan

Blender Version
Broken: 2.78a official

Short description of error
Pick random from dupligroup leads to a huge viewport performance drop

Exact steps for others to reproduce the error
Create two or more objects with a subsurf mod on them
Add them to a group
Create a hair host object (plane)
Make a hair system
Use that group as a dupligroup
Check "pick random" -> huge performance drop

File attached

Details

Type
Bug
Bastien Montagne (mont29) triaged this task as "Confirmed" priority.Feb 4 2017, 10:50 AM

Ok, sooooo… This is OpenGL drawing issue.

in draw_dupli_objects_color(), line 2145 and following, code decides whether it generates a displist or not for the current dupliobject, among other things based on the fact that next dupliobject to be drawn is the same as current one or not.

In our case, this is catastrophic, because random picking among a group of few objects will often gives sequences of two or three times the same object. So the displist will be generated, but not used that much - and clearly, generating a displist is not a small process! Without random picking, since each object is picked on its turn, you never have two in a row, so displist never gets generated.

(the part of dupli object drawing involved goes from 43us to 480us average per dupli, here on a debug build.)

@Sergey Sharybin (sergey), @Dalai Felinto (dfelinto), @Mike Erwin (merwin), not sure we consider this a bug worth fixing right now? Drawing code is being fully rewritten for 2.8 anyway…

Assigning to Clement since he is the one that handled the new version of the "code". So at least he should be aware of this problem for the new viewport.