Graphics performance port from V5 OpenGL Display Lists to V6 ExecConduit/CRhinoDisplayPipeline


#1

We have a Rhino plugin displaying large amounts of facets/vertices/lines etc.
In V5 we could use OpenGL display lists, update them only when needed and call them
in drawmiddleground() drawforeground(). Worked perfectly.
In V6 using ExecConduit/CRhinoDisplayPipeline I can not achieve the same graphics performance, e.g. too many primitive operations like DrawShadedMesh, DrawPolygin DrawNurbsCurve etc are called over and over again.

Can someone shed some light on how we can get the performance back?
KR
Steafn


(Dale Fugier) #2

Hi @StephanSchmaelzle,

Can you provide a screen capture of your OpenGL page (Tools -> Options > View > OpenGL)?

– Dale


#3

image
here is the info
I could Install a NVidia Quadro 6000 on the same machine but I doubt it will help.

Maybe this information helps:
generally we have a selection of Faces e.g. 1000 of them,
during mouse interaction maybe 5 of them need update of their graphics representation.

In V5 we solved this by keeping an OpenGL display list for each of the faces, ‘calling’ the lists in the render routines. And if some faces need graphics update their display list is 'recomputed’
I simply can not see how I can get the same efficiency in V6.


#4

Or simply another question:
In channel POSTDRAWOBJECTS:
and status of OpenGLEngine is 2 (available and activated)

Can I use glBegin(GL_QUADS) glEnd() to ‘draw’ something?
can I use glCallList() ?

Do I have to manager the Current OpenGL Rendering context myself? wgl… functions?


(Jeff Lasor) #6

You cannot use any Fixed Function OpenGL pipeline calls in Rhino V6 (and you really shouldn’t have been using them in V5)… those are very old routines and only work for 2.0 and lower versions of OpenGL (where there’s an actual state machine). OpenGL 3.0 was/is supposed to have legacy support, but after 3.1, all fixed functions were deprecated. Things like matrix operations, rendering states, and primitive states simply do not work in a Programmable Pipeline. Chances are most configurations today will be using OpenGL 4.x, because Rhino uses and takes full advantage of whatever the latest version of OpenGL it finds.

With that said, many drivers support “compatibility profiles”, so it’s possible that things like primitive states (i.e. glBegin, glEnd) may work. However, things like the model view matrix and projection matrix do not exist, so things like glLoadMatrix, glMultMatrix, glPushMatrix, glPopMatrix, etc… simply will not work). Call lists are just compilations of OpenGL calls and functions, and should work as long as they do not include or expect to use any of the fixed function pipeline routines.

Everything done in a programmable pipeline architecture (OpenGL 3.0 and up) must be done through a shader. I’m not saying that you have to now write you’re own shaders, but what it does mean is that in order to draw something in Rhino now, you must use the provided “draw” routines in Rhino’s SDK (since they’re the only things that know how to interface with our internal shaders and programmable pipeline architecture), and not through using direct calls into OpenGL.

If you can provide me with your plugin source, I would be glad to go through it for you and determine what the best way(s) is to approach what it is you’re doing. If you’re not comfortable posting the source here, then email it to me directly…and if that still makes you nervous, then provide some kind of source code example that clearly demonstrates what it is you’re wanting to draw, when you want it to draw, and how you want it to draw, along with any kind of state changes that may impact any of the latter.

If you want more details about these differences and why they were done, then please consult the OpenGL pages… Here’s a place to start: https://www.khronos.org/opengl/wiki/Fixed_Function_Pipeline

Again, I will be more than glad to look at your plugin to see what can be done…but more importantly, it will provide me (us) with things we’ve missed and may/will need to add to Rhino’s SDK for plugin developers wanting to do similar things.

Thanks,
-Jeff


#7

Thank you very much for the clarifications.

I’ll try to make it work using 4 approaches:
1.) convert all the plugins elements to rhino data add them to the model let rhino display them
2.) convert to draw() routines of diplayconduit
3.) have a look at the remaining OpenGL calls http://docs.gl in gl3/gl4
4.) implement my own shaders.

Hopefully some of those will bring it back to live in RH6.