Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: Can't get JOAL working on Mac on: 2006-10-20 05:59:22
Thanks Ken, all working now on my mac  Smiley
2  Java Game APIs & Engines / Java Sound & OpenAL / Can't get JOAL working on Mac on: 2006-10-14 11:30:46
I've been using JOAL successully on a PC but now that I am trying to run the same project on a MAC I get following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
   at java.lang.Runtime.loadLibrary0(Runtime.java:822)
   at java.lang.System.loadLibrary(System.java:992)
   at com.sun.gluegen.runtime.NativeLibLoader$1.run(NativeLibLoader.java:68)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.gluegen.runtime.NativeLibLoader.loadGlueGenRT(NativeLibLoader.java:66)
   at com.sun.gluegen.runtime.NativeLibrary.ensureNativeLibLoaded(NativeLibrary.java:350)
   at com.sun.gluegen.runtime.NativeLibrary.open(NativeLibrary.java:163)
   at net.java.games.joal.impl.ALProcAddressLookup$DynamicLookup.dynamicLookupFunction(ALProcAddressLookup.java:60)
   at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:64)
   at net.java.games.joal.impl.ALProcAddressLookup.resetALCProcAddressTable(ALProcAddressLookup.java:100)
   at net.java.games.joal.impl.ALCImpl.alcOpenDevice(ALCImpl.java:342)
   at net.java.games.joal.util.ALut.alutInit(ALut.java:62)
   at demos.joal.SingleStaticSource.main(SingleStaticSource.java:146)

I get the same error if I try to run one of the JOAL demos. Oh, and its a pre Intel mac. Any ideas?
3  Java Game APIs & Engines / JOGL Development / Re: Some of the JOGL demos run very slow on NVIDIA card (?!) on: 2006-08-24 18:56:24
I tried both Web Start and running it from command line and I have the same speed issues.
Specifying -Dsun.java2d.opengl=true didn't seem to help either. On my laptop with the ATI card, things are actually running very smoothly, without having to specify this variable. Anyway, I also tried using JRE1.6 but no speed improvement either.

The Water demo runs so slow, something like 1fps, that I suspected it was running without hardware acceleration, but that's probably not possible, because doesn't this stuff make heavy use of shaders?

So I ran demos.printext to check whether any extensions might be missing but it seemed like all necessary extensions are available. I assume, I would get some exceptions with the Water demo anyway if this wasn't the case.

I didn't get around to check out any older NVIDIA drivers but will hopefully get around that soon. If you can point me in any other directions, that would be much appreciated. Also could you tell me which NVIDA card or cards of other brands you've been using successfully? Thanks.
4  Java Game APIs & Engines / JOGL Development / Some of the JOGL demos run very slow on NVIDIA card (?!) on: 2006-08-23 18:58:47
Hi there,

this post may sound a bit odd, but I've got problems getting the jogl demos running smoothly on PCs with NVIDIA cards. The demos that turn out to be extra slow are:

- Water (Procedural Texture Physics) demo and
- Vertex Buffer Object
- Vertex Array Range

I tried out two different desktop PCs with NVIDIA GeForce cards and both had similar speed issues. Here are the specs:

WinXP Pro / Java 1.5.0_06
Pentium 4 3Ghz
2Gb RAM
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce 6500/PCI/SSE2
GL_VERSION: 2.0.1


WinXP / Java 1.5.0_06
Pentium D 3.2Ghz
1Gb RAM
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce 7300/PCI/SSE2
GL_VERSION: 2.0.3


The odd thing is that I have managed to run the same demos very smoothly on two laptops, one PC with an ATI Mobility Radeon X300, the other one a Alu Powerbook also with an ATI card. The Java setup on the Laptop is the same as on the other machines. This is really weird, because having read quite a few threads in this forum, I discovered rather the opposite, that there have been lots of problems with ATI cards.

Any suggestions what the problem might be?

...and yes, I have installed the latest drivers ...
5  Java Game APIs & Engines / JOGL Development / Re: Can't get GLSL Shader working properly on: 2006-07-25 08:42:58
Brilliant, that fixed it for me too.

Thank you very much. Smiley
6  Java Game APIs & Engines / JOGL Development / Can't get GLSL Shader working properly on: 2006-07-21 10:33:57
Can anyone help me with this one? I am trying to get a basic GLSL fragment shader working. Creating and compiling the shader programs seems to work  fine but when I draw a simple square with a texture, the image flickers and also the texture mapping is kind of wrong.

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  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
import com.sun.opengl.util.*;
import com.sun.opengl.util.texture.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

public class BasicGLSL implements GLEventListener {

   private String textureImageFile = "C:/data/nhs/images/flower.jpg";

   public int vertexShaderId, fragmentShaderId, shaderProgramId;

   private Texture texture;
   
   private float red = 1.f, green = 0.f, blue = 0.5f;
   
   

   public void init(GLAutoDrawable drawable) {
      GL gl = drawable.getGL();

      // create texture
      try {
         texture = TextureIO.newTexture(new File(textureImageFile), false);
      } catch (Exception e) {
         System.err.println("texture creation failed.");
      }

      //create and compile vertex shader

      /*
       void main(){
       gl_Position = ftransform();
       }
       */

     
      String vertexShaderSource = "void main(){ gl_Position = ftransform(); }";
     
     
      vertexShaderId = gl.glCreateShaderObjectARB(GL.GL_VERTEX_SHADER_ARB);
      gl.glShaderSourceARB(vertexShaderId, 1, new String[] { vertexShaderSource },
            new int[] { vertexShaderSource.length() }, 0);
      gl.glCompileShaderARB(vertexShaderId);

     
      // create and compile fragment shader
     
      /*
       uniform vec4 colour;
       uniform sampler2D tex;
       void main (void) {
       gl_FragColor = colour*texture2D(tex,gl_TexCoord[0].st);
       }
       */

     
      String fragmentShaderSource = "uniform vec4 colour;\n";
      fragmentShaderSource +="uniform sampler2D tex;\n";
      fragmentShaderSource +="void main (void){gl_FragColor = colour*texture2D(tex, gl_TexCoord[0].st);}";
     
      fragmentShaderId = gl
            .glCreateShaderObjectARB(GL.GL_FRAGMENT_SHADER_ARB);
      gl.glShaderSourceARB(fragmentShaderId, 1,
            new String[] { fragmentShaderSource }, new int[] { fragmentShaderSource
                  .length() }, 0);
      gl.glCompileShaderARB(fragmentShaderId);
      shaderProgramId = gl.glCreateProgramObjectARB();

      // link shader program
      gl.glAttachObjectARB(shaderProgramId, vertexShaderId);
      gl.glAttachObjectARB(shaderProgramId, fragmentShaderId);
      gl.glLinkProgramARB(shaderProgramId);

      //
      gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
      gl.glClearDepth(1.0f);
      gl.setSwapInterval(1);
   }

   public void display(GLAutoDrawable drawable) {
      GL gl = drawable.getGL();

      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);

      texture.bind();
      texture.enable();

      gl.glUseProgramObjectARB(shaderProgramId);

      int colourVarNr = gl.glGetUniformLocationARB(shaderProgramId, "colour");
      gl.glUniform4fARB(colourVarNr, red, green, blue, 1);

      int texSampler = gl.glGetUniformLocationARB(shaderProgramId, "tex");
      gl.glUniform1i(texSampler, 0);

      gl.glActiveTexture(GL.GL_TEXTURE0);
      gl.glEnable(GL.GL_TEXTURE_2D);

      gl.glBegin(GL.GL_TRIANGLE_STRIP);
      gl.glTexCoord2f(0, 1);
      gl.glVertex3f(-1, 1, 0);
      gl.glTexCoord2f(0, 0);
      gl.glVertex3f(-1, -1, 0);
      gl.glTexCoord2f(1, 1);
      gl.glVertex3f(1, 1, 0);
      gl.glTexCoord2f(1, 0);
      gl.glVertex3f(1, -1, 0);
      gl.glEnd();

      gl.glUseProgramObjectARB(0);

      texture.disable();
   }

   public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,
         boolean deviceChanged) {
   }

   public void reshape(GLAutoDrawable drawable, int x, int y, int width,
         int height) {
      final float h = (float) width / (float) height;
      GL gl = drawable.getGL();
      GLU glu = new GLU();
      gl.glViewport(0, 0, width, height);
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      glu.gluPerspective(80, h, 0.1f, 20.f);
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();
      glu.gluLookAt(0, 0, 2, 0, 0, 0, 0, 1, 0);
   }

   // /////////////////////////////////////////////////////////
   // MAIN
   // /////////////////////////////////////////////////////////

   public static void main(String[] args) {
      GLCanvas canvas = new GLCanvas();
      canvas.addGLEventListener(new BasicGLSL());
      final Animator animator = new Animator(canvas);
      Frame frame = new Frame("BasicGLSL");
      frame.setSize(400, 400);
      frame.add(canvas);
      frame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            runExit(animator);
         }
      });
      frame.setVisible(true);
      canvas.requestFocus();
      animator.start();
   }

   protected static void runExit(final Animator animator) {
      new Thread(new Runnable() {
         public void run() {
            animator.stop();
            System.exit(0);
         }
      }).start();
   }

}
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (32 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (58 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!