3 little questions

  1. i know iv read it here… but i cant find it anymore… so how can i deactivate v-sync? (to get max fps… for testing purposes only)
  2. iv read something about an ogl profiler… where what how?
    or is a normal profiler good enough to detect ogl bottleholes?
  3. what does resize()? (the one from the glenvent listener)
    i read it sets the viewport…
    also i need to set the viewport by myself on some places (drawing into textures)… but i need to reset it afterwarts to its original size… is there a better way then use getHight/With from the glcanvas to do this?

thx

There are 2 ways to control vsync:

  1. on Windows, via the Display Properties,
    goto the OpenGL settings under Advanced Settings.
  2. use the wglSwapIntervalEXT(int n) function.
    if n = 0, vsync is disabled.

For OpenGL info, you can visit my webpage
at http://www.waterlogic.com.sg/opengl
for a list of useful links for beginners.

thx
swap intervall works good…
but am i right that the ‘w’ stands for ms-windows? (no portability)

so can someone answer questions 2 & 3?
especialy 2 cause i would like to see some exact profiling info about my ogl calls

A normal Java profiler should be able to give you an idea of where time is being spent in the OpenGL portions of your application. The built-in -Xprof profiler in HotSpot used to be a good low-cost way of profiling your app, but it got much more expensive in 1.5. Nowadays I would probably recommend one of the commercial profilers or JFluid.

[quote]3. what does resize()? (the one from the glenvent listener)
i read it sets the viewport…
also i need to set the viewport by myself on some places (drawing into textures)… but i need to reset it afterwarts to its original size… is there a better way then use getHight/With from the glcanvas to do this?
[/quote]
Before your resize() callback is called, JOGL makes a call to glViewport(0, 0, width, height) where width and height are the parameters supplied by the AWT (and which are equivalent to the component’s width and height). Based on this information you can reset the viewport or do any other operations you need to.

[quote] thx
swap intervall works good…
but am i right that the ‘w’ stands for ms-windows? (no portability)
[/quote]
I use glXSwapIntervalSGI on Linux. My code does:

        if (gl.isExtensionAvailable("WGL_EXT_swap_control")) {
            System.out.println("Disabling VSYNC (Win)");
            ((WGL)gl).wglSwapIntervalEXT(0);
        } else if (gl.isExtensionAvailable("GLX_SGI_swap_control")) {
            System.out.println("Disabling VSYNC (X)");
            ((GLX)gl).glXSwapIntervalSGI(0);
        } else {
            System.out.println("Could not alter VSYNC");
        }

Don’t know about Mac.

Rob

thx both of u

@ken russel
iv started a thread about java profilers here

@mac
well they have to stick with fps of monitor-refresh-rate/n :wink:

Can i ask why anyone really wants a final refresh rate of more than 24fps since this is the speed of motion video and anything more is spurious?

[quote]Can i ask why anyone really wants a final refresh rate of more than 24fps since this is the speed of motion video and anything more is spurious?
[/quote]
Well, I guess because 24fps (or there abouts) is the point at which the brain starts to be fooled that it’s seeing continuous motion rather than a sequence of individual frames. Higher frame rates do look much smoother, particularly when the viewpoint is moving fast, e.g. try rotating the camera in a scene about a vertical axis. This looks much better and smoother at high frame rates than 24fps. Try it.

I’ve never quite understood the point of wanting to exceed the monitor’s vertical refresh rate though…

Rob

Assume 100Hz refresh rate and a display mode of 1000
pixels horizontally. Moving a sprite across the screen in 1
second will mean a moving a distance of 10 pixels per frame.
Now measure how wide that 10 pixels is on your screen.
Depending on the size of your screen, it can be about
0.5cm. Certainly visible to my eyes…