Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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] 2
1  Discussions / General Discussions / Re: Emedding Shaders in applets on: 2008-07-31 08:33:26
The way you should be doing this is by having the shader files seperate to your class files. WHen you build it all you should put it into a jar archive and use that as the library for the applet:

If you really really do not want anything aside from class files you can do the dogy thing and make the shaders just Strings in your application code. I do not endorse this, but it will work.
2  Games Center / Archived Projects / Re: HDR / Bloom tech demo on: 2007-07-26 03:02:29
Thank you for giving it a run everybody.

OleR: That should not be happening at all and I can't explain it. Try clearing your webstart cache and trying again, it's like webstart isn't using the right classpath...

Moogie: I have that same setup on my hope PC and it works. Are you using recent drivers? There shouldn't be a black screen though... :S very odd I have noticed the same thing happening on the new macbook pro's (nvidia cards).... maybe there is an issue there I will have to have a look into.

In other news, I have also got tone mapping working in a more recent build. I might upload it tonight when I get home from the office.

Thanks again!
3  Games Center / Archived Projects / HDR / Bloom tech demo on: 2007-07-20 11:27:47
Here is a new tech demo that I have been working on in LWJGL. The scene is rendered into a float buffer, and the component that is > 1 is gaussian blurred and redisplayed over the top. The bloom is slightly 'exaggerated' in this demo... but what's the point of a bloom tech demo if you can't make it look like gears of war.

The demo requires OpenGL 2.0, Non power of 2 textures and float texture support:

4  Java Game APIs & Engines / Java 2D / Re: Opinions on Exceptions on: 2007-06-07 06:48:40
If something can naturally occurs in your game (i.e. the example you described) then you should not be throwing exceptions. Exceptions are for exceptional situations, as their name implies.

What you described is using exceptions for control flow, which is a bad idea. The exception code adds a (small) runtime overhead, but it also drastically increases the verbosity of the code you write; which is never a good thing.

The final point is that it decreases the implied 'meaning' of the error. The more exceptions you have the more you increase the chance of a critical exception being overlooked during debugging and standard runtime. Throwing exception also leads to lazy habits, just doing a catch(Exception e) for example.... it's not a good thing to do.
5  Java Game APIs & Engines / JInput / Re: I give up on: 2007-06-07 06:30:49
I understand your frustrations Kaffine, I was recently playing around with some java physics library. I dont' mind if library is not mature, and I can expect to find bugs.

What I don't like is many groups don't offer 'real' releases, and their sites are very empty with regards to how / what is available. In the end I just hunted down the CVS repository and built my own version of the project... But it's not a very easy / professional way to distribute an open source package. And I really don't think the excuse of "it's free so you should be happy is valid" because in the end it only hurts the open source group. If things are too difficult no one uses it / reports bugs / is willing to contribute. Even if you don't have a great / mature product; helping and facilitating ease of use will end users greately increases the exposure and number of users of the project.

I think lwjgl have done a great job of releasing and making an easy to use product. Many other groups could learn a thing or two from their practices.

(Sorry for the rant, but it's been on my chest since it took me 8 hours to get a physics library working when it should have been a 30 minute low effort task)
6  Game Development / Newbie & Debugging Questions / Re: Generating executables for Linux and OS X on: 2007-04-24 11:10:38
Hey Jon,

 I have used this application before: with success. It's a pretty cool app, and you can get a 30day trial to see what you think of it. It does windows / osx / other all as one build process.

7  Java Game APIs & Engines / JOGL Development / Re: Tangent space and parallactic shader.. on: 2007-03-25 01:46:55
After having a quick look over your code it looks to be the calculation of the averages... I'm not quite sure where because your code is written in a different way to which I do it.

Here is the way I do it, hopefully it will help you out:

For each face I calculate the TBN, then add it to any attached vertices like so (The updateFacePerVertex is what you are after):

public class IndexedFace extends RealtimeObject {
  private int[] vertIndex = new int[3];
  private int[] texIndex = new int[3];

  private Vector3f normal = new Vector3f( 0, 0, 0 );
  private Vector3f biTangent = new Vector3f( 0, 0, 0 );
  private Vector3f tangent = new Vector3f( 0, 0, 0 );

  private static final RealtimeObject.Factory<IndexedFace> FACTORY = new RealtimeObject.Factory<IndexedFace>() {
    protected IndexedFace create() {
      return new IndexedFace();

  private IndexedFace() {

  public static IndexedFace newInstance() {
    return FACTORY.object();

  private Vector3f v2v1 = new Vector3f();
  private Vector3f v3v1 = new Vector3f();

  public synchronized void updateFacePerVertex( List<CalculatingVector3f> verts, List<TextureCoord> texCoords ) {
    //Calculate the vectors from the current vertex to the two other vertices in the triangle
    v2v1.sub( verts.get( vertIndex[1] ).vector, verts.get( vertIndex[0] ).vector );
    v3v1.sub( verts.get( vertIndex[2] ).vector, verts.get( vertIndex[0] ).vector );

    // Calculate c2c1_T and c2c1_B
    float c2c1_T = texCoords.get( texIndex[1] ).getU() - texCoords.get( texIndex[0] ).getU();
    float c2c1_B = texCoords.get( texIndex[1] ).getV() - texCoords.get( texIndex[0] ).getV();

    // Calculate c3c1_T and c3c1_B
    float c3c1_T = texCoords.get( texIndex[2] ).getU() - texCoords.get( texIndex[0] ).getU();
    float c3c1_B = texCoords.get( texIndex[2] ).getV() - texCoords.get( texIndex[0] ).getV();

    float fDenominator = c2c1_T * c3c1_B - c3c1_T * c2c1_B;
    float fScale1 = 1.0f / fDenominator;

    tangent.x = ( c3c1_B * v2v1.x - c2c1_B * v3v1.x ) * fScale1;
    tangent.y = ( c3c1_B * v2v1.y - c2c1_B * v3v1.y ) * fScale1;
    tangent.z = ( c3c1_B * v2v1.z - c2c1_B * v3v1.z ) * fScale1;

    biTangent.x = ( -c3c1_T * v2v1.x + c2c1_T * v3v1.x ) * fScale1;
    biTangent.y = ( -c3c1_T * v2v1.y + c2c1_T * v3v1.y ) * fScale1;
    biTangent.z = ( -c3c1_T * v2v1.z + c2c1_T * v3v1.z ) * fScale1;

    normal.cross( tangent, biTangent );

    verts.get( vertIndex[0] ).addComponent( normal, biTangent, tangent );
    verts.get( vertIndex[1] ).addComponent( normal, biTangent, tangent );
    verts.get( vertIndex[2] ).addComponent( normal, biTangent, tangent );

    verts.get( vertIndex[0] ).setTextureCoord( texCoords.get( texIndex[0] ) );
    verts.get( vertIndex[1] ).setTextureCoord( texCoords.get( texIndex[1] ) );
    verts.get( vertIndex[2] ).setTextureCoord( texCoords.get( texIndex[2] ) );

Then I iterate though these verts and get the average normal ect:
  public void addComponent( Vector3f normal, Vector3f biNormal, Vector3f tangent ) {
    this.normal.add( normal );
    this.biNormal.add( biNormal );
    this.tangent.add( tangent );

  public Vector3f getVertexNormal() {
    Vector3f buffer = new Vector3f();
    buffer.normalize( normal );
    return buffer;
8  Game Development / Networking & Multiplayer / Re: Synchronization Questions on: 2007-03-20 08:36:03
synchronised static methods  Cry Cry Cry Cry Cry

Please don't ever do this. If you need to synchronise a static method there is most likely a problem with your design. The only time I can think of off the top of my head is if you are doing a get on a singleton that is lazily initialised.

The smaller the time you make the lock for the better, only do it for critical regions, otherwise performance will suffer.
9  Games Center / Archived Projects / Re: Parallax Mapping Demo (Updated) on: 2007-03-09 14:36:41
Parallax demo now also uses specular mapping.... I'm not sure if I like the effect yet, I might have to go and redo it.

10  Games Center / Archived Projects / Re: Normal Mapping Demo on: 2007-03-08 07:25:51
The texture was from a tutorial on normal mapping.

Its a bit different from normal mapping, it's more an extension. The changes which had to be made were only in the fragment shader.

What you do it as well as a normal map you send a height map. At the pixel you are examining you look at the hightmap then use this value to offset the UV reading from both the diffuse texture and the normal map.

Here is a great site that goes into depth about how to do it:

and a nice app to make the depthmap if all you have is a normal map:
11  Games Center / Archived Projects / Re: Normal Mapping Demo on: 2007-03-08 04:44:53
Massive update now...

Parallax mapping Cheesy

Take a look at this sexyness (same poly count as before, but now it has a new texture which is low res and ugly Sad)
12  Games Center / Archived Projects / Re: Normal Mapping Demo on: 2007-03-07 10:08:45
Runs fine here, all 4fps of it Smiley

Windows XP, Pentium M 1.5ghz, Nvidia FX 5650 go <- thats why it's slow Smiley


If you turn off HDR (hit 'n') you should get about 10 -15 more FPS I think.

Quote from: appel
You should have the spheres rotate.

Spinning balls Cheesy I should do that...
13  Games Center / Archived Projects / Parallax Mapping Demo (Updated) on: 2007-03-07 04:17:39
Hey guys, I've just finished putting together another demo and I thought you might like to see it.

It's a normal mapping demo, as the title would indicate, and the engine is multi threaded. It's a few megs in size due to libraries that I am using and the like. I hope you like it:

If it crashes / dies I would love to see a stacktrace / log of what happened it will be located here: user.home/enginelog.txt.

It requires openGL 2.0 and some pretty spiffy hardware, but it should run okay if you meet the requirements. If you could post some numbers regarding the fps / hardware you are using that would also be great.

And if you can't run it, here is a nice screen shot for you (and yes the terrain is procedurally generated):

Now for shadows....
14  Discussions / General Discussions / Re: GDC 07 on: 2007-02-07 02:13:06
I wish I could be there, one of my lecturers from university is presenting a talk or seminar on virtiual worlds I do believe (Yusuf Pisan)
15  Games Center / Archived Projects / Re: Prototype - Playground on: 2007-02-02 01:07:15
That's sleak and sexy kev, good job. I like the download / play mechanics.

Did I mention that it looks good Wink
16  Discussions / Miscellaneous Topics / Re: OpenGL/Graphics section on: 2007-01-23 05:34:05
A good idea. +1
17  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-17 13:17:15
You can now run the demo if you don't have NP2 // float buffer support. It doesn't look as good and the shader is a bit of a "quick hack" but it seems to work.

I have verified it on an 9800 with old drivers. mileage may vary, if it doesn't work, and it should on your system paste the log... I like ironing out bugs.

18  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-16 13:17:19
Okay, new version of the demo has been uploaded, following features added:

Blur pass has been modified to use a shader based of the rendermonkey jitter blur. It looks much nice now (but I still have to do 3 passes)
Tone Mapping added (still in the very early experimental stages)
Updated UI

Float buffer dependency workaround will be pushed up tomorrow.
19  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-16 04:54:39
I've been thinking about this, should I not be using arb_texture_rectangle and instead be using arb_non_power_of_two? That would stop me having to write duplicate shaders and also allow me to remove some of the extra render paths I've had to code for....
20  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-16 03:23:27
PS. The NV compiler gave quite a few warnings with regards to your shaders. More specificaly, sampler2DRect and texture2DRect aren't defined in GLSL. Just use sample2D and texture2D

I think that's because I didn't define the #version to be 110. If I change them to sampler2D it will not work as texture rectangles are being used. They require sampler2DRect, or so I am led to believe.
21  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-15 23:32:09
Ohh that's nice, I have a quick question on it though:

Is the tap distance just a function of the UV coords and the texture width so you can line your samples up on pixel bounderies?

And second, the gTexelOffset parameter is not being passed to the function, if that is the case how can the offset be correct because the texture width needs to be known? (actually are uniforms masked out in HLSL and they are passed just not explicitly like build in variables?) If that is the case I'm guessing they aren't passed as tex coords because of the upper tex coord limit on most hardware (8 I think it is of the top of my head).

Care to clear this up for me?
22  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-15 21:27:29
Very nice demo. I love those little techy demos, they make my day  Grin

Thank you Cheesy I'm adding normal mapping to it at the moment, so hopefully it will look even better!

How are you extracting your highlights? Are you filtering the >1.0 values that come from the lighting equations to another texture, bluring that and applying it on the scene?

Yep, that's the way.. float textures make everything so slow though so I might rewrite it to just to a contrast based HDR.

Another thing, you could try using a jitter blur pass from the rendermonkey library. Its much faster than a seperable gaussian blur filter and gives superior results IMO. You dont get the pixely/boxy effect with it.

Well done

I'll download this rendermonkey and have a look.... Looks like I will need to reinstall windows though Sad
23  Games Center / Archived Projects / Re: HDR Demo on: 2007-01-15 02:12:39
I'm doing a horizontal pass, saving that to a texture, then doing a vertical pass on that.

You are correct, it doesn't get too much coverage, and I was trying to fix that up a tad yesterday. I may rewrite my shader, as at present if I turn the radius up it gets quite streaky and the only way to fix that is to do more passes with the blur, and they eats GPU time (see the attached image for a look at just the HDR portion if I try to increase the radius).

The HDR portion of the image is true HDR, it's the left over from the original forward shading of the scene. I may end up removing this though so that it works on cards without floating point textures, or at least write a render path for those cards.

I hope I addressed your question, if you want more details or have some advice about the blur I am doing I would love to hear it.

This is what happens if I push the blur radius too large:

24  Games Center / Archived Projects / HDR Demo on: 2007-01-15 00:13:42
Hey guys,

I've just finished putting together a tech demo in the 3d engine I am working on, it's more to iron out some little bugs in the engine then to show off a fully featured demo, but that's not to say that it can't look pretty is it?

The demo was written in lwjgl and makes use of some pretty advanced OpenGL features, it uses a light based forward shading method and accumulates the effect of each light on the scene into an offscreen float texture. The next part of the render takes the float texture and 'copies' any values from the image which are >1 into a 512x512 buffer. This buffer is then Gaussian blurred along the x axis, then y axis (This method is discussed in the GPU Gems book) 3 times so that a nice smooth blur exists on the texture. This is then overlayed on the original image to create the HDR portions of the final scene.

The demo requires the following:
OpenGL 2.0 Support

And it is recommended that GL_ARB_TEXTURE_RECTANGLE is also present, but is not needed (The fallback path to normal power of 2 textures has not been extensively tested)
w,a,s,d to walk around
mouse to look
h to toggle HDR

Known issues:
There is some form of depth buffer corruption occurring on mac osx, if anyone sees this and has suggestions feel free to offer them, I would appreciate it greatly.
The keyboard input is not being debounced at the moment, this means it make take a few hits of the 'h' key for the toggle to actually work.

If the demo crashes in flames or errors out in a bad way please post the log so I can fix the issue. The log is called "gameenginelog.txt" and will be created in the deploy path for your webstart. The log is also printed to the console, so you can also cut and paste from there.

25  Discussions / Miscellaneous Topics / Re: Other forums/blogs? on: 2006-08-05 13:36:39
Well known one: - I love the postmortums, they are the best part.
26  Java Game APIs & Engines / OpenGL Development / Re: FBO issues on: 2006-08-05 13:27:56
Looks like I can use FBO's but I can' activate texture units :/

This was my fix:

 GL13.glActiveTexture( GL13.GL_TEXTURE0 );
 GL11.glEnable( GL11.GL_TEXTURE_2D );

I forgot that I disabled my texture units after each pass :/
27  Java Game APIs & Engines / OpenGL Development / FBO issues on: 2006-08-05 10:13:01

I'm quite new to FBO's but want to incorperate them into my 3d engine. I am unfortunatelly having a few problems.
What I am doing is this:
1) Rendering my scene normally
2) Turing on my FBO
3) Rendering the scene again
4) Turning off the FBO
5) Adding an ortho overlay on the screen attempting to display the FBO texture.

The problem is that the only thing in the texture is white, no scenedata Sad

Here is some code showing how I set up the FBO (done once at initialisation):
    IntBuffer intBuffer = BufferUtils.createIntBuffer( 1 );
    EXTFramebufferObject.glGenFramebuffersEXT( intBuffer );
    myFBOId = intBuffer.get();

    EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, myFBOId );
    EXTFramebufferObject.glFramebufferTexture2DEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT,
                GL11.GL_TEXTURE_2D, textures[0].getTextureID(), 0);

    EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);

note: FBO error check just ensures completness

And each frame I do this:
1) Render scene normally, then:

    //Render to FBO
    EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, myFBOId );
    EXTFramebufferObject.glFramebufferTexture2DEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT,
                GL11.GL_TEXTURE_2D, textures[0].getTextureID(), 0);

    GL11.glPushAttrib( GL11.GL_VIEWPORT_BIT );
    GL11.glViewport( 0, 0, 512, 512 );
    GL11.glClear( GL11.GL_COLOR_BUFFER_BIT );


    //configure camera
    GameManager.getCameraManager().getCamera( "main" ).lookAt();
    EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);

      GL11.glTexCoord2f( 0,1);
      GL11.glVertex2f(0, 200);
      GL11.glTexCoord2f( 1,1);
      GL11.glVertex2f(200, 200);
      GL11.glTexCoord2f( 1,0);
      GL11.glVertex2f(200, 0);
      GL11.glTexCoord2f( 0,0);
      GL11.glVertex2f(0, 0);

I have been attempting to debug this issue for a few hours and I can't seem to get anywhere no matter what I try. Any help would be greately apreciated. I am sure the bug in there is quite trivial; I just don't have enough experience with FBO's to spot it.
28  Java Game APIs & Engines / Tools Discussion / Re: Bug tracking / Feature request - Sound off! on: 2006-07-07 06:48:50
We use mantis at my office. It's easy to use and we have had no drama.
29  Java Game APIs & Engines / Tools Discussion / Re: Code Management Solutions - Sound off! on: 2006-07-07 06:48:08
Subversion through and through.

It's free and it's also the best.
30  Discussions / General Discussions / Re: Maven on: 2006-06-28 09:53:18
I tried to set up maven a few months ago and got no where.... mainly due to documentation issues and the like.

Things are much better now and in the long term it is much easier to maintain then ant.

The stuff I'm using is Maven 2.0, Maven 1.0 is deprecated and is way to Apache for my liking. Is there any chance you were using Maven 1.0?

There are a good list of tutorials here:

The only real guide that you need is the "Getting started" guide. Most of the other stuff is "incase shit" guides.
Pages: [1] 2
Galdo (246 views)
2017-01-12 13:44:09

Archive (414 views)
2017-01-02 05:31:41

0AndrewShepherd0 (874 views)
2016-12-16 03:58:39

0AndrewShepherd0 (810 views)
2016-12-15 21:50:57

Lunch (947 views)
2016-12-06 16:01:40

ral0r2 (1178 views)
2016-11-23 16:08:26

ClaasJG (1279 views)
2016-11-10 17:36:32

CoffeeChemist (1312 views)
2016-11-05 00:46:53

jay4842 (1396 views)
2016-11-01 19:04:52

theagentd (1208 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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‑
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!