JoGL ports: Post them here

Topic says it all; instead of creating countless threads about every port, I thought it’d be more efficent to have em all within one.
Notice the following demos are all jar executables.

GameTutorial 41= Height map + Fog
Quake 3 Loader and Animator

PS: Pepi, I’d like you to take a closer look at ProcessKeyboard() function in the first linked port; now if you can put that in all Nehe’s ports, it’d be awesome :slight_smile:

As requested… ;D

I have worked over the weekend to create a Quake3 BSP viewer app in Jogl. I made use of one of the Nehe tutorials for helper classes and resource loaders… Thanks for those people who created them.

Here’s the Eclipse project and the sources:

http://www.openworkflow.org/jmundo.zip

I’ve run this app and even though it doesn’t raise exceptions or dumps, it only shows a completely black screen ???

I’ve tried a lot and did identify some bugs in the process, but cannot seem to get it working. If only it would even show garbled objects… My hunch is that it may be with the use of the buffers… If it’s simple, please post the resolution in the forum and I’ll update.

Let me know what you think about this thing and perhaps we can put the sources in collaborative working environment somewhere.

Cheers,

Chiraz

:o

I’ve just found out the most stupid mistake in my Q3 BSP viewer, glDrawElements or glDrawArrays was never called ( it may do several passes for transparency and special effects ). Rather than let you look into it for hours yourself:

In the FaceRenderer you’ll see a renderFlush method. The setState function would always return 1, which is why it was never called.

I’ve had to update the shaders to increase the numpasses and modify the setState. It should return when it gets a 0 back, rather than > 0.

Things work now actually! For an interesting shot:

http://www.openworkflow.org/screenshot.jpg

Meshes and textures are not working properly yet.

The framerate I estimate about 10-15 or so. This is when rendering the FULL scene ( PVS and clipping DISABLED ). Amazing what you can jam out of a JVM!!!

Cheers,

Chiraz

Great Job dude, now let’s build a team and code a game :slight_smile:

Anyways I tweaked my code as much as I can, and all the ports now come as executable jars.
I also improved keyboard’s events processing a lot as well as my textures texture loaders.
Some of you brought to my attention that Lesson 27 doesn’t display any shadows. Turned to be the stencil buffer had to be manually enabled on the Radeons R2xx line of cards (8500,9000,9100,9200). Bug that is fixed now.
Also in Lesson 22 wouldn’t run on linux because of the lower/upper case issue that the textures names were coded like in the port. It is now Fixed.

Lesson09
Lesson12
Lesson18
Lesson22
Lesson24
Lesson27
Lesson30
Lesson34
Lesson37
Quake 3 Loader and Animator

Finally I reworked my basic JoGL frame as well as my simple Texture loader which manages Bmp, GIF, JPG and PNG image formats.
Check them out here:
Texture Loader
JoGL basic frame

I’d appreciate any feedback :slight_smile:

:o A Must see :o

My jaw dropped open when I saw it! That’s an awesome piece of work! I was going to look into terrain rendering next, but maybe already right now I’m gonna look into it a bit…

-=-=-

I’ve scrapped the port of the levelviewer, because I found something better:

http://www11.brinkster.com/chapter23/

It’s way more OO based than mine was, plus that it runs properly. Given this as a starting point, I should be ok extending from that source. The source zip file contains the ported sources from GL4Java… You should be ok to run this against any quake map.

Screenshots:
http://www.openworkflow.org/newshot1.jpg
http://www.openworkflow.org/newshot2.jpg
http://www.openworkflow.org/jmundo.zip

PVS needs some work especially in outdoor scenes. Mesh generation is still off by a bit but nothing that can’t be fixed…

Btw… This thread has three interesting things going… A character animator, a BSP viewer and a terrain renderer… I wonder if these three things can merge together in one impressive demo? :slight_smile:

Cheers,

Chiraz

WAOW ;D

Looking GREAT (heya, Markus and David - are you guys watching this?) :smiley:

[quote] :o A Must see :o
[/quote]
cool , and of course runs great on my linux box … http://www.gnox.net/images/jogl_linux.jpg

regards

Yes. What are you insinuating?

That you both should add fog (if you haven’t added it recently?) and show us some new screenshots (not saying wurm doesn’t look good already - just that it can get better) ;D

Ouch, I just noticed I forgot to add a smilie.
Hehe, that sure changed the tone of that post. :wink:

I think in order to combine distance fog with height fog (mist?), I’d have to write a vertex shader. And I’d rather not read THAT specification quite yet. Hehe. :wink:

But it does look good. =D

Not had a chance to run it, but looks great in the screenshot!! Although, is there something odd going on with the normals defined for the surfaces? Seem to be dark bits here and there… or are they cloud shadows?

Kev

Nehe lessons 1-20, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 42, 45
Source
Binaries

[quote]Nehe lessons 1-20, 22, 23, 24, 26, 27, 29, 30, 33, 34, 36, 37, 39, 42, 45
Source
Binaries
[/quote]
Dude try calling a function that checks the keyboard input from within the display method; It’ll make the controls much, much smoother.

Example:


  void ProcessKeyboard(){

    // Most functions has been moved to the camera class
    if(g_Camera.keys[KeyEvent.VK_SPACE]){
      // To get a few different ideas of what a detail texture
      // could look like, we want to change it's scale value.
      // Times the current scale value by 2 and loop when it get's to 128
      terrain.g_DetailScale = (terrain.g_DetailScale * 2) % 128;
      // If the scale value is 0, set it to 1 again
      if(terrain.g_DetailScale == 0)
        terrain.g_DetailScale = 1;
      g_Camera.keys[KeyEvent.VK_SPACE] = false;
    }
    /////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
    // To make the tutorial more interesting, we add an option to increase
    // and decrease the height of the fog by using the + and - keys.
    if(g_Camera.keys[KeyEvent.VK_ADD]){        // Check if we hit the + key
      terrain.g_FogDepth += 1;                 // Increase the fog height
      if(terrain.g_FogDepth > 200)
        terrain.g_FogDepth = 200;              // Make sure we don't go past 200
      g_Camera.keys[KeyEvent.VK_ADD] = false;
    }

    if(g_Camera.keys[KeyEvent.VK_SUBTRACT]){   // Check if we hit the - key
      terrain.g_FogDepth -= 1; // Decrease the fog height
      if(terrain.g_FogDepth < 0)
        terrain.g_FogDepth = 0;      // Make sure we don't go below 0
      g_Camera.keys[KeyEvent.VK_SUBTRACT] = false;
    }
    /////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
  }

:slight_smile:

Lesson44: Lens Flare Tutorial

When I sat down and started porting this demo, it was around 7:30PM EST, now when I take a look at my clock it says 12:10 AM…
Damn someone throw me a life ;D
Anyways my unique comment regarding this port is the fact that it runs slightly faster than the equivalent demo in C++.
Java 1 C++ 0 :stuck_out_tongue:

[quote]try calling a function that checks the keyboard input from within the display method
[/quote]
I realize it’s done like this in the C demos, but I don’t really see the benefit of sticking with this for the Java version. Any other opinions on this?

@pepijnve: For sake of clarity I’d prefer sticking to the Java method. We could always add comments or an extra tutorial if the difference is really big.

@Java Cool Dude: your Lesson27 now at least shows shadows (compared to the one from pepijnve’s bag-of-ports) but it still doesn’t work right: the shadows show up on the wong side of the ball in the middle! (they seem to wrap around the ball)

http://www.realityflux.com/abba/ShadowThatWorks.jpg

As you can see, the program is running fine the way it is, actually it worked fine ever since day 1, I don’t know what’s going on on your side.
Maybe if you list your system specs we can try and help you out?
@Pepi: Check the new version of Lesson 34 that I put up; zooming in and out is now much much smoother than it ever was .

Now I got it… My code now repeats using the keyboard repeat rate, which of course isn’t very smooth. By setting flags on and off you get a much smoother effect. I should have thought of this :-[ Using the keyboard repeat is never a good idea…
I’ll fix this in my code asap

[quote]Now I got it… My code now repeats using the keyboard repeat rate, which of course isn’t very smooth. By setting flags on and off you get a much smoother effect. I should have thought of this :-[ Using the keyboard repeat is never a good idea…
I’ll fix this in my code asap
[/quote]
Cheers mate :slight_smile: