Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jogl versus gl4java. addition



I think I know why jogl's
glutSolidSphere(glu,3,nslices,nslices);

is so slow:


public void glutSolidSphere(GLU glu, double radius, int slices, int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
glu.gluSphere(quadObj, radius, slices, stacks);
}



public void gluSphere(GLUquadric quad, double radius, int slices, int stacks) {
((GLUquadricImpl) quad).drawSphere(gl, (float) radius, slices, stacks);
}





public void drawSphere(GL gl, float radius, int slices, int stacks) {

//full port of the C glu code to Java

}

gl4java uses gluSphere from the native opengl library (via JNI)
that's why probably differences between "with list"/"without list" in gl4java are not so dramatical as in jogl
(at least for a single glut glutSolidSphere call)


jogl team made some design decision to port glu library to java instead of using native glu function from native opengl framework
(at least for functions like drawSphere)
I don't know why they decided to do that in that way
that also explain why nurbs functionality isn't ready in jogl:


it requires significant amount of work:
from Ken Russell's answer (jogl forum)
"About 5000 of the 40000 lines have been ported so far and are checked in to the source tree but they haven't been tested (and probably can't be tested until more of the code is ported)."


again why jogl team decided to port glu C library to the java instead of calling opengl framework via JNI is unclear








On Mar 22, 2005, at 8:31 AM, Dmitry Markman wrote:

        sphere = gl.glGenLists(1);
        gl.glNewList(sphere, GL.GL_COMPILE);
        glut.glutSolidSphere(glu,3,nslices,nslices);
        gl.glEndList();

using here:


for(int i = 0; i < atoms.length; i++){ TestAtom atom = atoms[i]; gl.glPushMatrix(); gl.glTranslatef(atom.x,atom.y,atom.z); //glut.glutSolidSphere(glu,3,nslices,nslices);//very slow gl.glCallList(sphere); gl.glPopMatrix(); }


On Mar 22, 2005, at 5:50 AM, Luca Lutterotti wrote:

Dear Dmitry,

what do you mean with: using lists the performance improved dramatically?
I switched also to jogl some times ago but I use my animator and I didn't check about fps performance. So I am curious.
Can you post a simple example about these "lists"?


	Thanks,
			Luca

On Mar 20, 2005, at 15:47, Dmitry Markman wrote:

after using lists jogl performance
improved dramatically and now even better than in gl4java (a little)


what is interesting that using lists didn't change fps in gl4java

I'm doing calculations for "atom" positions from different thread


On Mar 20, 2005, at 1:17 AM, Dmitry Markman wrote:


in gl4java there is a possibility to set desirable fps so I set the parameter to 100 and got ~30 so it's 15 time better than jogl is there similar functionality (setting fps) in jogl?

something definitely I'm doing wrong :-(
in jogl setup I'm doing the following:

public class GLDrawer extends Panel implements GLEventListener
....
public GLDrawer(){
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
canvas.addGLEventListener(this);
setLayout(new BorderLayout());
add(canvas,BorderLayout.CENTER);
animator = new Animator(canvas);
glut = new GLUT();


		canvas.addKeyListener(new KeyAdapter(){
		................
		});
		canvas.addMouseListener(new MouseAdapter(){
		................
		});
		canvas.addMouseMotionListener(new MouseMotionAdapter(){
        		......
		});
        		animator.start();
	}
....
}



or maybe I have to play with GLCapabilities?

I'm using jogl's Animator class to animate


thanks



On Mar 20, 2005, at 1:01 AM, Dmitry Markman wrote:

Hi,
finally I started seriously to think about moving to jogl

so I started from porting some simple example from gl4java to jogl:

1000 "atoms" set in the cube 10x10x10
are doing small random motion around fixed point

and surprisingly my gl4java running the same code (except initialization part)
5 times faster (400x400 pixel frame gl4java ~10 fps jogl ~2fps)


I'm not using swing

what I'm missing?

thanks



Dmitry Markman


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/ email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >jogl versus gl4java (From: Dmitry Markman <email@hidden>)
 >Re: jogl versus gl4java. addition (From: Dmitry Markman <email@hidden>)
 >Re: jogl versus gl4java. addition (From: Dmitry Markman <email@hidden>)
 >Re: jogl versus gl4java. addition (From: Luca Lutterotti <email@hidden>)
 >Re: jogl versus gl4java. addition (From: Dmitry Markman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.