Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  3 little questions  (Read 1200 times)
0 Members and 1 Guest are viewing this topic.
Offline SDV

JGO n00b
*

Posts: 25



« on: 2005-04-02 10:07:44 »

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
Offline rexguo

Full Member
**

Posts: 139


Real-Time Java


« Reply #1 on: 2005-04-03 05:20:39 »

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.

http://www.rexguo.com - Technologist + Designer
Offline SDV

JGO n00b
*

Posts: 25



« Reply #2 on: 2005-04-04 08:11:31 »

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
Games published by our own members! Go get 'em!
Offline Ken Russell

JGO Kernel
*****

Posts: 3446
Medals: 3


Java games rock!


« Reply #3 on: 2005-04-04 12:56:39 »

Quote

2. iv read something about an ogl profiler.... where what how?
or is a normal profiler good enough to detect ogl bottleholes?


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?


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.
Offline Rob Nugent

Full Member
**

Posts: 109


May contain nuts


« Reply #4 on: 2005-04-05 02:29:24 »

Quote
thx
swap intervall works good...
but am i right that the 'w' stands for ms-windows? (no portability)


I use glXSwapIntervalSGI on Linux. My code does:

1  
2  
3  
4  
5  
6  
7  
8  
9  
        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
Offline SDV

JGO n00b
*

Posts: 25



« Reply #5 on: 2005-04-05 06:42:14 »

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
Offline girvine

Jr. Member
**

Posts: 65


Java games rock!


« Reply #6 on: 2005-04-07 03:03:55 »

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?
Offline Rob Nugent

Full Member
**

Posts: 109


May contain nuts


« Reply #7 on: 2005-04-07 03:14:03 »

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?


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
Offline rexguo

Full Member
**

Posts: 139


Real-Time Java


« Reply #8 on: 2005-04-07 05:33:10 »

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...

http://www.rexguo.com - Technologist + Designer
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.138 seconds with 21 queries.