PDA

View Full Version : How to draw Nurbs Surface real-time?



v770729
03-26-2015, 10:09 PM
I use gluNurbsSurface with 33 x 33 control points to draw Nurbs Surface
but it's too slow to run every frame, I test about 117 ms per frame
so, Can opengl be used another method draw Nurbs Surface real-time?

__bob__
03-27-2015, 03:32 AM
Take look at gluNurbsProperty and use good flags!!!!

GClements
03-27-2015, 05:29 AM
I use gluNurbsSurface with 33 x 33 control points to draw Nurbs Surface
but it's too slow to run every frame, I test about 117 ms per frame
so, Can opengl be used another method draw Nurbs Surface real-time?

If you don't need dynamic subdivision, store the resulting mesh. Either use display lists, or use GLU_NURBS_TESSELLATOR mode with callbacks which store the data, or write your own NURBS tessellator.

If you need dynamic subdivision or compatibility with modern OpenGL (3.x/4.x core profile), the modern approach is to use a tessellation shader. But a 33x33 patch is likely to be beyond the implementation limits (the value of GL_MAX_PATCH_VERTICES isn't required to be any higher than 32), so you'd need to subdivide it (assuming that the curve has a reasonable degree).

v770729
03-27-2015, 10:33 AM
thanks reply, I don't need dynamic subdivision.
I think I can try to store mesh data or GLU_NURBS_TESSELLATOR callbacks data, but how to draw this data next time?