1
\$\begingroup\$

My simple opengl program is really toooo slow and not fluid. I'm rendering 30 sphere with simple illumination and simple materials. The only complex computing stuff I do is a collision detection between ray-mouse and spheres (that works ok and i do it only in mouseMoved) I'm not using any threads, just an animator to move spheres.

How can I profile my jogl project?

Or maybe (most probable...) I have some opengl instructions that I don't understand and make render particular accurate (or back face rendering that I don't need or whatever I don't know exactly I'm just entering the opengl world)

\$\endgroup\$
4
  • \$\begingroup\$ Hi nkint. How do you move your spheres? Do you move only with their centers or with every vertex? And how do you compute normals? If you have opengl auto normals computation on it is going to be super slow. \$\endgroup\$
    – Notabene
    Commented Jan 11, 2011 at 23:40
  • \$\begingroup\$ mhm.. i'm using gluSphere! \$\endgroup\$
    – nkint
    Commented Jan 12, 2011 at 11:10
  • \$\begingroup\$ ok i resolved, too many triangles! i was calling gluSphere(quadric, radius, 90, 90). how simple.. \$\endgroup\$
    – nkint
    Commented Jan 12, 2011 at 11:11
  • \$\begingroup\$ bytheway, usefull comment also for slow auto normals and also.. for move only the center! \$\endgroup\$
    – nkint
    Commented Jan 12, 2011 at 11:11

2 Answers 2

2
\$\begingroup\$

What do you mean by "too slow", as in it dropped from 5000 frames per second to 500, or it went from 100 to 2 (do note that frame rate is a logarithmic time scale).

For profiling, there are several java profilers, and some of them have plugins for eclipse. A quick google turns up several potential solutions.

As far as OpenGL goes, a couple of things: are you using matrices, or manually transforming the vertices? Do you use VBOs or Display Lists, or are you submitting each sphere using immediate mode instructions? How many triangles in each sphere?

\$\endgroup\$
1
  • \$\begingroup\$ ok i resolved it: too many trinagles! \$\endgroup\$
    – nkint
    Commented Jan 12, 2011 at 11:12
1
\$\begingroup\$

There are several Java profilers you can evaluate. That will only tell you so much, though -- basically what's going on CPU-side. If that's where your performance bottleneck is, great, but if not you may need to resort to tools like gDebugger to do analysis on your OpenGL call stream.

\$\endgroup\$
1
  • \$\begingroup\$ ohu, gDebugger is really good tools! \$\endgroup\$
    – nkint
    Commented Jan 12, 2011 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .