Fast opengl

Hello
Ive got a issue to discuss with people know much bout graphics on PC.
Ive still got some problems with performance in JOGL on non NVidia cards (where now i know why are demos NVidia sponsored ;D ).
What is best engine that works well on most cards? Well i can tell that Jogl isnt. Sad but true. Running any Nehe lesson ends with 100% system usage and 2fps. Ati workaround does nothing exept showing funny lines.
Recently i opened Jausoft GL4J or something. However im not sure if there are any good libs for linux on this one (i tried it on laptop with w2000). But the framerate was supprisingly much better than on nehe lessons build for Jogl. In week im planing to forget about Jogl and rewrite my whole app under some other lib but i need to know which one is best. Is GL4J ok? Plis introduce your opinion. It will help me much.

Thanks everyone;)

/me senses lwjgl rant

You could always post some code so someone else can check to see if you are doing something wrong.

2fps? :slight_smile:

Smells like software rendering. Install the latest drivers and check if it makes a difference.

Is GL4J ok?

No, it’s outdated and discontinued. You can of course give LWJGL a try. However, LWJGL wouldn’t run at all in software mode, because it’s pointless (way too slow for anything).

Its a textured CUBE from Nehe tutorials. Should I post it in here? :):slight_smile: What can you tell me about speed if it hangs on displaying 6 quads with texture on it? Pretty silly.
Also the drivers are newest.
And Im getting from capabilities that it really really is ATI not software GDI
BTW this outdated API for now makes better than JOGL… :(:frowning:

You can’t tell from GLCapabilities whether the canvas is hardware accelerated or not. Add this to your init code and see what it says. I find it terribly hard to believe you have an accelerated canvas and are only getting 2 fps.


System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
      System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
      System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));

Hi,

I’ve read a lot of performance-related stuff about jogl and ati here lately. I get 100+ fps in 1024x768 fullscreen with a multi-pass engine rendering thousands of polygons, combining many of the techniques shown in the NeHe tutorials, and I only have a 9600 series ATI.

So you either have a driver problem or a problem with jogl defaulting to software mode. I think the second option is much more likely, I had a similar problem when I requested anything but the default canvas properties. There definitely is a problem with choosing GLCapabilities, and to my knowledge the jogl team is working on it, let’s hope the best :slight_smile:

Oh, and yes, when I had that problem and got two to four fps, my ATI also was reported as active, and only the code postet above showed software rendering had taken over.

Cheers

Wolfgang

System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));

Showes this

GL_VENDOR: ATI
GL_RENDERER: RagePRO
GL_VERSION: 1.1.3

Any idea what the hell is goin on? Im reaaally stuck and dont wanna to rewrite almost 2000 lines of code to run it on other lib (unless it will be neccessary - this means ati must work:) )
Hmm maybe OpenGl is old idonno - where can i take some newest version?:slight_smile:

Agggh! Ancient shit ATI card/driver combo! Take it out of the machine, stamp up and down on it, throw the bits out of a window, and then buy a cheapass GeForce2 or something and forget all your problems. If you’ve got a laptop, follow the same instructions except there’s no need to take it out of the machine, and replace GeForce2 with a Dell Inspiron.

Gold standard of GL issues: run Alien Flux and tell me if it runs silky smooth (or at all).

Cas :slight_smile:

Ah… what he said ;D

That is a very crappy card. I doubt you’ll find the GL4J running any faster. You’re most likely running Microsoft’s software implementation of OpenGL. From what I remember, the RagePRO has no 3D acceleration at all.

At the very least get new drivers, www.ati.com, though if you can get a newer card that would be even better. The drivers for the rage series were never very good and considering the newest drivers appear to be 3 years old I doubt they will ever get any better.

From what I remember, the RagePRO has no 3D acceleration at all.

Oh it has acceleration, but there is at least one basic blending mode missing (forgot which one, but it’s that one which Q3 used for smoke [they just disabled smoke alltogether on those cards ;)]).

Anyways the card is crap. My sister bought one of those 4 years ago for something like 10¤ (new - not used).

So either ask some friends if they have a spare card (I could get a gf1ddr, gf2mx200, gf2mx400, gf3ti400 for free) or check ebay. You can get a geforce2 for about 10¤ there.

The problem is that this and one of 9200 is only ATI cards i can test some of my progs written in Jogl.
The facts are

  • Microsoft GDI runs faster than ATI (when support is on everything goes 3x slower)
  • Im almost sure that even ATI Rage can render simple Nehe tutorials without problem.
  • I had problem running Nehe tutor on every ATI card (means 2 eg of this shitti Rage and 1 eg of 9200Radeon)
  • I suppose this cards can better than 2fps on texturized (tex size 128) box
    -GL4J runs slow but significantly faster
    -If you tell me that there is no problem i invite you to comparison topic about
    http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1096405789

So… still need advice

That topic you linked to is about a different “problem”. It’s wasting performance at high frame rates. That’s related to overhead which only gets measurable at high framerates. But y’know at frame rates that high it doesn’t matter anyways. In “real world” games/applications it’s not that extreme (it’s a per frame thingy as far as I can tell).

However, you can always give LWJGL (my favorite lib) a try if you like. But I wouldn’t bother at all with somewhat outdated like GL4J.

edit: spelling++;

Could you post a profile of any app using -Xprof? Maybe the ATI problem I am looking at where wglMakeCurrent is called every frame is really hammering your card.

Could you post a profile of any app using -Xprof

  • Stupid question but… what is Xprof and how to do it?:slight_smile:

Dont know if that be any of a help but here it is:)
[color=Blue]
c:\Program Files\Kaskada 3D>java -Xprof -jar kaskada.jar

Flat profile of 1.23 secs (114 total ticks): main

Interpreted + native Method
10.5% 0 + 11 java.awt.Component.show
3.8% 0 + 4 sun.awt.font.NativeFontWrapper.getFontMetrics
3.8% 0 + 4 sun.awt.windows.Win32SurfaceData.initDDraw
2.9% 0 + 3 java.lang.ClassLoader$NativeLibrary.find
2.9% 0 + 3 sun.awt.windows.WComponentPeer.pShow
2.9% 0 + 3 sun.awt.Win32GraphicsEnvironment.registerFontWithPlatfo
rm
1.9% 0 + 2 java.io.WinNTFileSystem.getBooleanAttributes
1.9% 0 + 2 java.lang.ClassLoader$NativeLibrary.load
1.9% 2 + 0 javax.swing.MultiUIDefaults.get
1.9% 0 + 2 kaskada.swinginterface.MainWindow.
1.9% 0 + 2 java.lang.ClassLoader.findBootstrapClass
1.9% 1 + 1 sun.nio.cs.SingleByteEncoder.encodeArrayLoop
1.0% 0 + 1 java.lang.Class.forName0
1.0% 0 + 1 java.io.WinNTFileSystem.canonicalizeWithPrefix0
1.0% 0 + 1 java.lang.CharacterDataLatin1.getProperties
1.0% 0 + 1 java.awt.AWTKeyStroke.allocateNewInstance
1.0% 0 + 1 java.lang.ClassLoader.findLoadedClass0
1.0% 1 + 0 java.lang.StringBuffer.length
1.0% 0 + 1 sun.awt.font.NativeFontWrapper.registerFonts
1.0% 1 + 0 java.lang.StringBuffer.setShared
1.0% 0 + 1 java.lang.String.intern
1.0% 0 + 1 sun.awt.font.NativeFontWrapper.getCharMetrics
1.0% 0 + 1 javax.swing.plaf.basic.BasicMenuItemUI.createMenuKeyLis
tener
1.0% 0 + 1 sun.awt.windows.WToolkit.initIDs
1.0% 0 + 1 javax.swing.JFrame.addImpl
83.8% 16 + 72 Total interpreted (including elided)

 Compiled + native   Method

1.0% 1 + 0 java.lang.String.equals
1.0% 1 + 0 Total compiled

Thread-local ticks:
7.9% 9 Blocked (of total)
14.3% 15 Class loader
1.0% 1 Compilation

c:\Program Files\Kaskada 3D\opengl.properties
Prop resolution:1
Prop hardwareaccel:true
Prop texquality:low

Flat profile of 5.62 secs (520 total ticks): Image Fetcher 0

Interpreted + native Method
22.2% 0 + 2 java.awt.MediaTracker.setDone
11.1% 0 + 1 java.io.FileInputStream.open
11.1% 0 + 1 sun.java2d.loops.GraphicsPrimitiveMgr$1.compare
11.1% 0 + 1 sun.awt.image.PNGImageDecoder.
11.1% 1 + 0 sun.awt.image.PNGImageDecoder.filterRow
11.1% 0 + 1 java.io.FileInputStream.close0
77.8% 1 + 6 Total interpreted

Thread-local ticks:
98.3% 511 Blocked (of total)
22.2% 2 Compilation

Flat profile of 5.61 secs (519 total ticks): Image Fetcher 1

Interpreted + native Method
71.4% 0 + 5 java.awt.MediaTracker.setDone
14.3% 0 + 1 sun.awt.image.ImageRepresentation.getOpaqueRGBImage
14.3% 0 + 1 java.lang.Thread.setPriority0
100.0% 0 + 7 Total interpreted

Thread-local ticks:
98.7% 512 Blocked (of total)

Flat profile of 5.60 secs (518 total ticks): Image Fetcher 3

Interpreted + native Method
16.7% 0 + 1 java.awt.MediaTracker.setDone
16.7% 0 + 1 java.awt.image.DirectColorModel.getRGB
16.7% 0 + 1 java.lang.Thread.setPriority0
50.0% 0 + 3 Total interpreted

Thread-local ticks:
98.8% 512 Blocked (of total)
50.0% 3 Unknown: no last frame

Flat profile of 5.59 secs (518 total ticks): Image Fetcher 2

Interpreted + native Method
16.7% 0 + 1 java.lang.Thread.setPriority0
16.7% 0 + 1 Total interpreted

Thread-local ticks:
98.8% 512 Blocked (of total)
83.3% 5 Unknown: no last frame

BACKWALL
GL_VENDOR: Microsoft Corporation
GL_RENDERER: GDI Generic
GL_VERSION: 1.1.0

Flat profile of 19.97 secs (1967 total ticks): Thread-2

Interpreted + native Method
85.2% 0 + 1583 net.java.games.jogl.impl.windows.WindowsGLImpl.glCallLi
st
4.5% 0 + 84 net.java.games.jogl.impl.windows.WGL.ChoosePixelFormat0

0.9% 0 + 16 net.java.games.jogl.impl.windows.WGL.SwapBuffers
0.5% 0 + 9 net.java.games.jogl.impl.windows.WindowsGLImpl.glBegin
0.1% 0 + 2 net.java.games.jogl.impl.windows.WindowsGLImpl.glTexIma
ge2D0
0.1% 0 + 2 kaskada.opengl.renderer.kaskada3d.BackWall
0.1% 2 + 0 kaskada.opengl.renderer.kaskada3d.display
0.1% 0 + 2 java.lang.ClassLoader.defineClass0
0.1% 0 + 1 net.java.games.jogl.impl.windows.WGL.GetProcAddress
0.1% 0 + 1 java.io.FileOutputStream.writeBytes
0.1% 0 + 1 net.java.games.jogl.impl.windows.WindowsGLImpl.glTransl
atef
0.1% 0 + 1 net.java.games.jogl.impl.windows.WGL.DescribePixelForma
t0
0.1% 0 + 1 net.java.games.jogl.impl.GLUImpl.dispatch_gluSphere
0.1% 0 + 1 java.lang.String.intern
0.1% 0 + 1 net.java.games.jogl.impl.GLUImpl.dispatch_gluDisk
0.1% 0 + 1 java.lang.Class.getDeclaredFields0
0.1% 0 + 1 java.lang.ClassLoader.findBootstrapClass
0.1% 1 + 0 java.lang.reflect.Field.setFieldAccessor
0.1% 1 + 0 java.lang.reflect.Field.getFieldAccessor
0.1% 0 + 1 net.java.games.jogl.impl.windows.WindowsGLContext.newPi
xelFormatDescriptor
0.1% 0 + 1 net.java.games.jogl.impl.windows.WindowsOnscreenGLConte
xt.swapBuffers
0.1% 0 + 1 java.security.AccessController.doPrivileged
0.1% 1 + 0 net.java.games.jogl.impl.windows.WindowsGLContext.dynam
icLookupFunction
0.1% 1 + 0 java.lang.ClassLoader.findNative
0.1% 1 + 0 java.lang.reflect.Field.doSecurityCheck
92.6% 8 + 1712 Total interpreted (including elided)

 Compiled + native   Method

0.1% 2 + 0 java.lang.Class.searchFields
0.1% 1 + 0 net.java.games.jogl.impl.windows.WindowsGLContext.dynam
icLookupFunction
0.1% 1 + 0 java.lang.String.startsWith
0.2% 4 + 0 Total compiled

     Stub + native   Method

0.1% 0 + 1 java.lang.String.intern
0.1% 0 + 1 net.java.games.jogl.impl.windows.WGL.wglGetProcAddress
0.1% 0 + 2 Total stub

Thread-local ticks:
5.6% 110 Blocked (of total)
0.1% 1 Interpreter
7.0% 130 Compilation

and second part…

Flat profile of 19.96 secs (1966 total ticks): Thread-3

Interpreted + native Method
0.6% 0 + 10 kaskada.opengl.renderer.FPSAnimator$RenderRunnable.next
FrameSync
0.6% 0 + 10 Total interpreted

Thread-local ticks:
19.7% 387 Blocked (of total)
99.4% 1569 Compilation

Flat profile of 0.00 secs (1 total ticks): Thread-1

Interpreted + native Method
100.0% 0 + 1 net.java.games.jogl.impl.windows.WGL.DestroyDummyWindow

100.0% 0 + 1 Total interpreted

Flat profile of 28.30 secs (2783 total ticks): AWT-Windows

Interpreted + native Method
90.6% 0 + 2521 sun.awt.windows.WToolkit.eventLoop
0.0% 1 + 0 java.awt.AWTEvent.
0.0% 1 + 0 sun.awt.AWTAutoShutdown.setToolkitBusy
0.0% 1 + 0 java.util.WeakHashMap.indexFor
90.7% 3 + 2521 Total interpreted

Thread-local ticks:
9.3% 259 Compilation

Flat profile of 0.10 secs (11 total ticks): Thread-0

Interpreted + native Method
90.9% 0 + 10 sun.awt.windows.WToolkit.shutdown
90.9% 0 + 10 Total interpreted

Thread-local ticks:
9.1% 1 Unknown: no last frame

Flat profile of 27.76 secs (2741 total ticks): DestroyJavaVM

Thread-local ticks:
100.0% 2741 Blocked (of total)

Flat profile of 28.08 secs (2768 total ticks): AWT-EventQueue-0

Interpreted + native Method
12.1% 0 + 28 net.java.games.jogl.impl.windows.WindowsOnscreenGLConte
xt.createGL
10.4% 0 + 24 java.io.RandomAccessFile.setLength
9.1% 0 + 21 java.lang.ClassLoader.defineClass0
4.3% 0 + 10 sun.awt.windows.WComponentPeer.nativeHandleEvent
2.2% 0 + 5 java.io.FileInputStream.readBytes
2.2% 0 + 5 java.util.zip.Inflater.inflateBytes
1.7% 0 + 4 sun.awt.windows.Win32OffScreenSurfaceData.initSurface
1.7% 0 + 4 java.io.RandomAccessFile.writeBytes
1.7% 0 + 4 kaskada.opengl.renderer.kaskadaframe.
1.3% 0 + 3 java.io.RandomAccessFile.length
0.9% 0 + 2 sun.awt.color.CMM.cmmLoadProfile
0.9% 0 + 2 java.lang.Throwable.fillInStackTrace
0.9% 0 + 2 java.lang.ClassLoader$NativeLibrary.load
0.9% 0 + 2 java.util.zip.ZipFile.getEntry
0.9% 2 + 0 sun.awt.image.OffScreenImageSource.sendPixels
0.9% 0 + 2 java.lang.ClassLoader.findBootstrapClass
0.9% 0 + 2 java.io.RandomAccessFile.readBytes
0.9% 0 + 2 sun.awt.windows.WGlobalCursorManager.findHeavyweightUnd
erCursor
0.4% 1 + 0 java.util.zip.Inflater.finished
0.4% 0 + 1 java.io.RandomAccessFile.read
0.4% 1 + 0 java.awt.image.ComponentColorModel.getRed
0.4% 0 + 1 sun.awt.windows.WInputMethod.setNativeLocale
0.4% 0 + 1 sun.awt.windows.WComponentPeer.hide
0.4% 1 + 0 java.util.WeakHashMap.indexFor
0.4% 0 + 1 java.util.zip.Inflater.init
71.9% 22 + 144 Total interpreted (including elided)

 Compiled + native   Method

1.7% 4 + 0 java.awt.image.ComponentColorModel.getRGB
1.3% 2 + 1 kaskada.opengl.renderer.TextureReader.readPixels
1.3% 3 + 0 sun.awt.image.ByteInterleavedRaster.getDataElements
1.3% 3 + 0 com.sun.imageio.plugins.png.PNGImageReader.decodePaethF
ilter
1.3% 3 + 0 java.awt.image.ComponentColorModel.extractComponent
0.9% 2 + 0 java.lang.String.indexOf
0.4% 1 + 0 java.lang.Math.abs
0.4% 1 + 0 java.lang.String.
0.4% 1 + 0 com.sun.imageio.plugins.png.PNGImageReader.decodeUpFilt
er
0.4% 1 + 0 java.awt.image.ColorModel.getLinearRGB16TosRGB8LUT
0.4% 1 + 0 java.lang.String.indexOf
0.4% 0 + 1 java.util.Arrays.mergeSort
0.4% 1 + 0 java.lang.Math.round
10.8% 23 + 2 Total compiled

     Stub + native   Method

3.9% 0 + 9 java.lang.StrictMath.pow
2.2% 2 + 3 java.lang.StrictMath.floor
0.9% 0 + 2 java.io.RandomAccessFile.seek
0.9% 0 + 2 java.util.zip.Inflater.inflateBytes
7.8% 2 + 16 Total stub

Runtime stub + native Method
0.4% 1 + 0 alignment_frame_return Runtime1 stub
0.4% 1 + 0 new_type_array Runtime1 stub
0.9% 2 + 0 Total runtime stubs

Thread-local ticks:
91.7% 2537 Blocked (of total)
2.6% 6 Class loader
6.1% 14 Compilation

Global summary of 29.04 seconds:
100.0% 2898 Received ticks
1.2% 36 Received GC ticks
1.0% 30 Compilation
0.0% 1 Other VM operations
0.7% 21 Class loader
0.0% 1 Interpreter
0.3% 9 Unknown code

c:\Program Files\Kaskada 3D>[/color]

Can you go to ATI and get the current drivers for your card and then get a profile, -Xprof, for the ATI driver rather than the MS software renderer. The software renderer will never be fast on any machine and there isn’t anything I can do about that.