Show Posts
|
|
Pages: [1] 2
|
|
11
|
Java Game APIs & Engines / JOGL Development / Applet
|
on: 2008-04-02 18:17:50
|
|
Trying to run a JOGL applet from IntelliJ IDEA I get this error from the AppletViewer
Exception in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:186) at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:49) at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeLibLoader.java:80) at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:103) at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:49) at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111) at java.security.AccessController.doPrivileged(Native Method) at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109) at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(WindowsGLDrawableFactory.java:60) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106) at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:520) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:83) at minigneis.MiniGneis.init(MiniGneis.java:21) at org.jdesktop.applet.util.JNLPAppletLauncher.startSubApplet(JNLPAppletLauncher.java:1904) at org.jdesktop.applet.util.JNLPAppletLauncher.access$200(JNLPAppletLauncher.java:658) at org.jdesktop.applet.util.JNLPAppletLauncher$5.run(JNLPAppletLauncher.java:1269) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) Caused by: java.lang.ClassNotFoundException: org.jdesktop.applet.util.JNLPAppletLauncher at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:171) ... 27 more
|
|
|
|
|
15
|
Java Game APIs & Engines / JOGL Development / Re: TextRenderer speed
|
on: 2008-03-27 18:23:46
|
|
I reworked the algorithm to only call begin3DRendering() and end3DRendering() once for all labels, but there is no improvement on speed.
I profiled the application using JProfiler and it seems more than half of the slow rendering time is spent in flush()
|
|
|
|
|
16
|
Java Game APIs & Engines / JOGL Development / Re: TextRenderer speed
|
on: 2008-03-26 21:16:43
|
I do this for each label: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| private void renderLabel(GL gl, TextRenderer textRenderer, String label, float[] color) { gl.glPushMatrix(); textRenderer.setColor(color[0], color[1], color[2], color[3]); textRenderer.begin3DRendering();
float maxW = 0.0f; float span = 0; for (int i = 0; i < label.length(); i++) { float w = textRenderer.getCharWidth(label.charAt(i)); if (w > maxW) { maxW = w; } span += w; }
float angle = span * 180.0f / 2500.0f; float step = angle / span; float rotate = 0.0f; gl.glRotatef(-(180.0f - angle) / 2.0f, 0, 0, 1);
for (int i = 0; i < label.length(); i++) {
char c = label.charAt(i); float w = textRenderer.getCharWidth(c);
gl.glPushMatrix();
gl.glRotatef(-rotate, 0, 0, 1); gl.glTranslatef(-0.86f, 0, 0); gl.glRotatef(90, 0, 0, 1); textRenderer.draw3D("" + c, 0, 0, 0, 0.001f); textRenderer.flush(); gl.glPopMatrix(); rotate += step * w; }
textRenderer.end3DRendering(); gl.glPopMatrix(); } |
TextRenderer is made once. The code is not optimal and there are some magic numbers but this was the only way I could make it work
|
|
|
|
|
17
|
Java Game APIs & Engines / JOGL Development / TextRenderer speed
|
on: 2008-03-26 17:47:40
|
|
I'm rendering approximately 150 different labels where each letter is rendered on a curve. My solution has been to render each letter separately but this is horribly slow (4 fps). Is there any way of speeding this up?
|
|
|
|
|
18
|
Java Game APIs & Engines / JOGL Development / Re: glslDevil
|
on: 2008-02-27 13:58:21
|
Thank you for that tip.  But ShaderDesigner doesn't seem to be as powerful as glslDevil. glslDevil lets you step through your code and inspect variables while your program is running.
|
|
|
|
|
19
|
Java Game APIs & Engines / JOGL Development / Re: glslDevil
|
on: 2008-02-27 11:04:15
|
|
I have tried gDebugger succesfully as well, and is a very useful tool. gDebugger, however, does not support debugging of glsl programs. I would like to find out if it is glslDevil or JOGL that is the problem.
|
|
|
|
|
21
|
Java Game APIs & Engines / JOGL Development / Re: ByteBuffer issue
|
on: 2008-01-12 11:34:47
|
Looks like this is my issue: GL_RGBA Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. (Note that this mapping does not convert 0 precisely to 0.0.) Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. From: http://developer.3dlabs.com/documents/GLmanpages/glteximage3dext.htm
|
|
|
|
|
22
|
Java Game APIs & Engines / JOGL Development / Re: ByteBuffer issue
|
on: 2008-01-12 10:18:07
|
|
I just found out that the problem is not endianness but something related to:
scale = 1.0f / (maxValue - minValue); //max = 4080, min = 0 gl.glPixelTransferf(GL.GL_ALPHA_SCALE, scale);
When using GL_FLOAT this works as expected. But with GL_SHORT the scale must be something like 5 to represent a useable range.
What am I doing wrong?
|
|
|
|
|
23
|
Java Game APIs & Engines / JOGL Development / Re: ByteBuffer issue
|
on: 2008-01-12 09:19:14
|
Try calling order(ByteBuffer.nativeOrder()) on the ByteBuffer after you create it, before you write anything.
This did not change anything.  Try using ShortBuffer buffer = BufferUtil.newShortBuffer(), then buffer.put(...short value...) and in the gl call just use buffer. Pretty sure BufferUtil lets you create a short buffer as well. I doubt this will change anything but just in case.
I copied the values from my bytebuffer to a shortbuffer but I got the same results. But I need to have a bytebuffer so that the class can support both bytes and floats as well. I am also sure that the buffers contain correct values before being sent to OpenGL.
|
|
|
|
|
25
|
Java Game APIs & Engines / JOGL Development / ByteBuffer issue
|
on: 2008-01-11 16:57:19
|
|
I am doing something like this:
ByteBuffer buffer = Bufferutil.newByteBuffer(size);
buffer.putShort(s); ...
glTexSubImage3D(GL.GL_TEXTURE_3D, 0, 0, 0, 0, w, h, d, GL.GL_ALPHA, GL.GL_Short, buffer.asShortBuffer());
But the results I'm getting looks like there is a problem with endianness.
Anyone see anything wrong with this approach?
|
|
|
|
|
26
|
Java Game APIs & Engines / JOGL Development / Corrupted Display List
|
on: 2007-06-13 17:47:49
|
|
My program compiles a display list of quads and displays them.
Every 5th (or so) time I run the program a couple of random polygons are corrupted and are sticking out at weird angles. Recompiling the display list fixes the problem. Anyone know what causes this? Any suggestions?
|
|
|
|
|
28
|
Java Game APIs & Engines / JOGL Development / InvocationTargetException
|
on: 2006-12-01 19:33:38
|
|
I suddenly get this error on my Windows machine:
I reinstalled Java and removed any old class files or caches so it shouldn't be that. Anyone know what this is?
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: java.lang.reflect.InvocationTargetException at javax.media.opengl.GLCanvas.disableBackgroundErase(GLCanvas.java:352) at javax.media.opengl.GLCanvas.addNotify(GLCanvas.java:154) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at java.awt.Container.addNotify(Container.java:2500) at javax.swing.JComponent.addNotify(JComponent.java:4478) at javax.swing.JRootPane.addNotify(JRootPane.java:680) at java.awt.Container.addNotify(Container.java:2500) at java.awt.Window.addNotify(Window.java:466) at java.awt.Frame.addNotify(Frame.java:501) at java.awt.Window.pack(Window.java:484) at sonarexplorer.SonarExplorerController$5.run(SonarExplorerController.java:110) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at javax.media.opengl.GLCanvas.disableBackgroundErase(GLCanvas.java:350) ... 26 more Caused by: java.lang.UnsatisfiedLinkError: disableNativeBackgroundErase at sun.awt.windows.WCanvasPeer.disableNativeBackgroundErase(Native Method) at sun.awt.windows.WCanvasPeer.disableBackgroundErase(WCanvasPeer.java:114) at sun.awt.windows.WToolkit.disableBackgroundErase(WToolkit.java:376) ... 31 more
|
|
|
|
|
30
|
Java Game APIs & Engines / JOGL Development / Re: Deadlock on Linux
|
on: 2006-11-01 10:55:55
|
|
This is my deadlock:
Java stack information for the threads listed above: =================================================== "AWT-EventQueue-0": at java.awt.Component.invalidate(Component.java:2432) - waiting to lock <0x00002aaab6df4ef0> (a java.awt.Component$AWTTreeLock) at java.awt.Container.invalidate(Container.java:1419) at javax.swing.JComponent.revalidate(JComponent.java:4573) at javax.swing.JLabel.setText(JLabel.java:320) at components.RenderingPanel.display(RenderingPanel.java:197) at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78) at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281) at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194) at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
"main": at sun.misc.Unsafe.monitorEnter(Native Method) at sun.awt.X11.XToolkit.awtLock(XToolkit.java:191) at sun.awt.X11.XDecoratedPeer.reshape(XDecoratedPeer.java:310) at sun.awt.X11.XDecoratedPeer.reshape(XDecoratedPeer.java:403) at sun.awt.X11.XDecoratedPeer.setBounds(XDecoratedPeer.java:411) at java.awt.Component.reshapeNativePeer(Component.java:1924) at java.awt.Component.reshape(Component.java:1880) - locked <0x00002aaab6df4ef0> (a java.awt.Component$AWTTreeLock) at java.awt.Component.setBounds(Component.java:1847) at java.awt.Window.setBounds(Window.java:2342) - locked <0x00002aaab6df4ef0> (a java.awt.Component$AWTTreeLock) at java.awt.Window.setClientSize(Window.java:502) - locked <0x00002aaab6df4ef0> (a java.awt.Component$AWTTreeLock) at java.awt.Window.pack(Window.java:488) at volume.viewer.SonarExplorer.<init>(SonarExplorer.java:132) at volume.viewer.SonarExplorer.main(SonarExplorer.java:561) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Found 1 deadlock.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|