Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 / JOGL Development / Re: Announcing: joglutils project on: 2008-07-24 22:46:11
I submitted the code to dev@games.java.net, let me know if it is of any use

thanks,
Ben Peck
2  Java Game APIs & Engines / JOGL Development / Re: AWT has an option called GeneralPath how i can use a like with JOGL.. on: 2008-07-23 04:34:20
Ok, I have not exactly done any of this myself, but I am trying to point you in the right direction, so bare with me...
Now, OpenGL is pretty low level, so there is no "GeneralPath"-like class that you can just call, you have to implement curve/path rendering on your own, i.e. use some math Wink

First, I would explore gamedev.net forums, as I am sure people have asked this before there. I found this post which might give you some idea of what you're getting yourself into, and at the very least some buzz words that will be useful for further research. I think bezier curves and NURBS are what you're looking for.

http://www.gamedev.net/community/forums/topic.asp?topic_id=378739

After you've read that, this paper should give you a pretty solid intro to one of the popular approaches on how curves are done in OpenGL:

http://www.mat.ucsb.edu/~c.ramakr/articles/dls/nurbs.pdf

Hope that helps
3  Java Game APIs & Engines / JOGL Development / Re: Announcing: joglutils project on: 2008-07-21 05:16:38
Would you guys be interested in a Frame Buffer Object class? It covers all the basic stuff like color and depth attachments, but it has some neat features like support for multiple color attachments (a nice feature for those doing GPGPU stuff), and you can designate either a texture or render buffer as the attachment type.
4  Java Game APIs & Engines / JOGL Development / Re: jogl with netbeans gui builder on: 2008-07-21 00:53:16
Just out of curiosity, how would one make a non-JOGL project into a JOGL project? Do you just have to add the native library files into the build path?
5  Java Game APIs & Engines / JOGL Development / Re: AWT has an option called GeneralPath how i can use a like with JOGL.. on: 2008-07-21 00:44:17
I am not too familiar with SVG stuff, but perhaps this project can help. You're basically just trying to render SVG files using OpenGL, right?

http://svgl.sourceforge.net/
6  Java Game APIs & Engines / JOGL Development / Re: Problems loading texture and a question about sprites on: 2008-06-22 17:12:54
So lets say you have a project with a package like org.MyProject

Inside the package MyProject you have a class called TextureLoading, and an image called image.jpg

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
import com.sun.opengl.util.TextureIO;
import com.sun.opengl.util.Texture;
...

public class TextureLoading {
  private Texture tex;
  ...

  public void init(GLAutoDrawable drawable) {
    ...
    try {
      tex = TextureIO.newTexture(
         getClass().getClassLoader().getResourceAsStream("org/MyProject/image.jpg"), false, TextureIO.JPG
      );
    }
    catch(IOException e) {
      e.printStackTrace();
    }
   ...
  }

}


Also, make sure you have textures enabled?
7  Java Game APIs & Engines / JOGL Development / Re: VBO - Example with Vertices, Normals, Textures, Colors on: 2008-06-20 17:02:19
Your render code looks ok, I would suggest binding your buffer to 0 once you are done with VBOs, but thats really all i can come up with. I don't have that much knowledge of the inner workings of VBOs or what wacky stuff apple is up to in their OpenGL drivers, so I can't really be of any service here.
8  Java Game APIs & Engines / JOGL Development / Re: Problems loading texture and a question about sprites on: 2008-06-20 16:56:12
Just in case you haven't perused this yet
http://download.java.net/media/jogl/builds/nightly/javadoc_public/

Are you getting any exceptions when you try to create the texture? I usually get an IOException if I give a bad file path or if the image formatted isn't supported. I took a look at the source for TextureIO and Texture, and there are lots of exceptions being thrown and lots of checks for null.... so if you aren't getting any exceptions thrown and you are just getting null every time, that suggests something more sinister is happening.
9  Java Game APIs & Engines / JOGL Development / Re: vertex shader causing slowdown on: 2008-06-20 16:42:54
Thanks for all the advice. I did some research and it turns out that ATI has taken a loong time to adopt vertex shader texture fetching, so their cards are especially slow at it. I am an undergrad student in a computer graphics lab at school, so I just asked to be moved to a computer with a better graphics card, (nVidia 8800 GTS, dual CUDA! Sooo awesome...) and now I am pumping out 160+ fps. Oh technology Tongue

So I think I will stick with the shader approach, because I really like the idea of using a shader to do my deformation of the field using a texture. VBOs are definitely something to keep in mind though if/when I want to make my code more portable to computers without behemoth GPUs.

Cheers
10  Java Game APIs & Engines / JOGL Development / Re: Problems loading texture and a question about sprites on: 2008-06-19 19:38:21
Can you paste in the call where you are trying to create the texture?

Here's a quick example of how to output the texture once you successfully created a Texture object:
1  
2  
3  
4  
5  
6  
7  
8  
9  
Texture myTex = TextureIO.newTexture( ... );
myTex.bind();
gl.glBegin(GL.GL_QUADS);
            gl.glTexCoord2f(0, 0); gl.glVertex2f(0, 0);
            gl.glTexCoord2f(0, 1); gl.glVertex2f(1, 0);
            gl.glTexCoord2f(1, 1); gl.glVertex2f(1, 1);
            gl.glTexCoord2f(1, 0); gl.glVertex2f(0, 1);
gl.glEnd();
gl.glBindTexture(GL.GL_TEXTURE_2D, 0);


Now you may have to fiddle with the texture coordinates to get the proper orientation of the image, I didn't really bother to look at the order. I would highly suggest you read up on how OpenGL texturing works before going any further. Then once you figure out the basics you can try implementing the techniques that the previous poster mentioned
11  Java Game APIs & Engines / JOGL Development / Re: NPOT Textures and glTexImage2D on: 2008-06-19 18:58:12
A simple idea:

Make an image in photoshop or something, then using the built in texture classes in com.sun.opengl.util.texture, use TextureIO.newTextureData(File file, boolean mipmap, String fileSuffix) to load the texture. Then, look at the data that got loaded into the TextureData's buffer and see how it's arrangement compares to yours. Good luck!
12  Java Game APIs & Engines / JOGL Development / Re: vertex shader causing slowdown on: 2008-06-19 18:45:28
How do I specify two separate VBOs for my position data? Could I have one VBO with 2D position and TexCoords and a separate one for height displacement? In other words, is this a possible setup for my height field?

VBO1: posX1, posY1, texX1, texY1, ... , posXn, posYn, texXn, texYn
VBO2: posZ1, posZ2, posZ3, ... , posZn
VBO3: triangle indices

thanks
13  Java Game APIs & Engines / JOGL Development / Re: vertex shader causing slowdown on: 2008-06-18 22:30:10
I was reading online that ATI didn't implement vertex texture fetching (apparently thats the name for it) for a while.

I am running this on a MacBook pro with an ATI X1600, do you think this card is too old for this stuff?

I read this article: http://www.ozone3d.net/tutorials/vertex_displacement_mapping.php
and they are running fine with 80,000 polygons, not to mention my shaders are simpler.... must be my GPU I guess Sad

However, according to this: http://developer.apple.com/graphicsimaging/opengl/capabilities/
I should have access to up to 16 texture units in vertex programs (search the page for MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB)
14  Java Game APIs & Engines / JOGL Development / Re: VBO - Example with Vertices, Normals, Textures, Colors on: 2008-06-18 21:07:07
I am using VBOs on OS X 10.5 with a ATI X1600 card (MacBook Pro), and I haven't noticed any performance problems
15  Java Game APIs & Engines / JOGL Development / vertex shader causing slowdown on: 2008-06-18 21:04:44
So I want to draw a height field using shaders. I have a VBO of 2D position coordinates and 2D texture coordinates, and a texture containing height values. I have a shader that takes in this texture and displaces vertices based on the value in the texture.

Before I used this approach I just had one big VBO with 3D position coordinates, but I wanted to be able to deform the height field quickly and easily using shaders by making changes to the texture, so I changed to this approach.

So I get this working, but it is really slow (~6fps). The height field is 600x600 and ran at around 50-60 fps when I was using just a VBO.

I am curious if this is just too much data for the GPU to handle, or if I am doing something wrong. So here's my vertex shader,
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
uniform sampler2D heights;

void main()
{
    gl_TexCoord[0] = gl_MultiTexCoord0;
   
    vec4 position = gl_Vertex;
    // Since the texture is black and white RGB, just take the value in red, and scale by 2
   position.z += texture2D(heights, gl_MultiTexCoord0.st).r * 2.0;
   
    gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * position;
}

And the fragment shader:
1  
2  
3  
4  
5  
6  
uniform sampler2D heights;

void main()
{
    gl_FragColor = texture2D(heights, gl_TexCoord[0].st);
}


And here's a snip of the rendering process just in case:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
* textures and buffers are bound, vertex and texcoord pointers created *
* The field is a flat plane rendered as rows of triangle strips, the shader displaces along z *
       int stride = numCols * 4;
        shader.engage(gl);
        // Draw the VBO
       for(int i=0; i<(numRows-1)/2; i++) {
            gl.glDrawRangeElements(GL.GL_TRIANGLE_STRIP,
                0,
                endIndex,
                stride,
                GL.GL_UNSIGNED_INT,
                stride*i*BufferUtil.SIZEOF_INT
            );
        }
        shader.disengage(gl);


Thanks!
16  Java Game APIs & Engines / JOGL Development / Re: GL_POINTS all black coloured on: 2008-06-18 20:47:12
try

gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

before you set color, maybe you have a texture bound by mistake
17  Java Game APIs & Engines / JOGL Development / When/Where to perform collision detection on: 2008-06-05 18:42:25
So I am writing a JOGL application that requires some collision detection, but I am unsure what the best practice is as far as when and where to implement your collision detection code.

This program is a real time simulation that needs to check for collision very quickly and accurately, so when should I run my collision detection algorithm? Should I run it once every rendering, in my display() function, Or should collision detection be separated from rendering, in some sort of main loop?

for example;

mainloop() {
   while( !done ) {
       collisionDetection();
       render();
   }
}

I am currently using the Animator class that contains its own main loop to continually call my display(), so I would have to either extend the Animator class to include my collision detection in the main loop, or make my own animator type class, but since JOGL is all thready and I would really not like to do that.

So what do you guys typically do? Checking once per frame seems fine as far as accuracy, but the application needs to do a lot of computation once a collision happens, so I am thinking if collision detection is in the same thread as the renderer that it will create a pretty tight bottleneck.
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.

Riven (12 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!