Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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)

share|improve this question
    
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. –  Notabene Jan 11 '11 at 23:40
    
mhm.. i'm using gluSphere! –  nkint Jan 12 '11 at 11:10
    
ok i resolved, too many triangles! i was calling gluSphere(quadric, radius, 90, 90). how simple.. –  nkint Jan 12 '11 at 11:11
    
bytheway, usefull comment also for slow auto normals and also.. for move only the center! –  nkint Jan 12 '11 at 11:11
add comment

2 Answers 2

up vote 2 down vote accepted

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?

share|improve this answer
    
ok i resolved it: too many trinagles! –  nkint Jan 12 '11 at 11:12
add comment

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.

share|improve this answer
    
ohu, gDebugger is really good tools! –  nkint Jan 12 '11 at 11:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.