Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Sweeeeeeeeet JOGL  (Read 2045 times)
0 Members and 1 Guest are viewing this topic.
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« on: 2003-08-03 17:10:24 »

Aight I spent a litte over a day learning opengl as I was fed up with Java3D limitations, and I finally succeeded in porting my collisions demo to jogl.
What I noticed in this API switch is the fact that jogl runs  about twice as fast as  Java3d.
check this demo out and give me your impressions as well as the framerate you guys get on your machines (use fraps) Smiley

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

http://www.realityflux.com/abba/JOGL%20collisions.rar

Use left and right arrows to rotate around the center of the room, up/down to zoom in/out and num_8/num_2 to elevate camera or lower it.
Enjoy.
Next project; stencil shadows Tongue.....hopefully
Offline epotash

JGO n00b
*

Posts: 26


Java games rock!


« Reply #1 on: 2003-08-03 18:42:05 »

thats a pretty nice application... unfortunately i am unable to run because of problems i am having with gl on this linux machine.  a few questions...

not to be rude or anything but, why do break all naming conventions with your classes, variables, and functions?

i find it interesting that you create your own sin/cos tables... however, im not sure how effective this is. have you tried to run both with tables, and using the the Math.sin, Math.cos functions, and compared CPU load... i think that there are sin and cos tables built into hardware, which would make it more efficient to just use the functions.  nevertheless, if you still want to use the tables, you can use just one table, because cos is just a sin with a phase shift of pi/4....

but nice job man, your work will be very useful for me in my own attempts to build an engine....
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #2 on: 2003-08-03 19:15:37 »

Hi
I name my own functions after the terms that make the most sense to me,  and hence make things a bit easier especially when I exceed 600 lines of code per demo.
Plus I hate having all my stuff packed into one class as it makes the code unpleasant to read, therefore  I try to make as many as I see fit.
Back to your comment regarding cos/sin tables, I think I read somewhere that the hardware built-in function takes around 125 cpu cycles to come up with a result which would hurt the performance quite a bit in high fps engines. Besides, I already coded some water effect demo that used Math.sin in every frame but I wasn't too pleased by the performance.
Once I switched to the said tables, it actually run faster and that's why I'm keeping it.
Lemmie see how I can merge the sin/cos tables into one ^_^
Games published by our own members! Go get 'em!
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #3 on: 2003-08-03 20:09:17 »

Update;
I managed to squeeze out some decent 30%+ performance boost by doing some code clean up here and there, I also reduced the size of the explosions and updated the physics engine  Smiley
http://www.realityflux.com/abba/w00t_2.jpg
PS: On my 2.1 Ghz Athlon, radeon 9500 Pro I get around 750fps at 1024*768 which is more than twice the performance of the same looking, yet different collision demo found at nehe's site.
^not being a cocky [censored] Tongue
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #4 on: 2003-08-05 13:54:32 »

Last update;
Just thought I'd let you guys know that I got about 25% performance increase compared to the previous built by calling display lists.
http://www.realityflux.com/abba/new_screen_disply_lists.jpg

Here's the package
http://www.realityflux.com/abba/JOGL%20collisions.rar

I'm welcoming any comments suggestions
/me is back coding his shadows Grin
Offline DavidYazel

Sr. Member
**

Posts: 265


Java games rock!


« Reply #5 on: 2003-08-05 14:24:36 »

I wonder what the exact conditions are that display lists are useful.  I have found them to be slower than vertex arrays.  Were you using vertex arrays before you switched to display lists?

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #6 on: 2003-08-05 16:45:37 »

Before I introduced display list to my code, I used to draw the room as well as the cylinders using GL_QUADS, and the glu code for cylinder spawning. I would call these functions in every update which happens to be every elapsed frame.
As I mentioned earlier I gained 25% more performance calling up display lists that actually holds the geometry and attributes for the said part, than the previously stated way.
Offline jujumen

JGO n00b
*

Posts: 23


java is the juju within.....


« Reply #7 on: 2003-08-06 10:30:13 »

what command do you use to compile and run jogl from the command line or what is the best ide to use? ive been trying to use jbuilder 9 personal i keep getting exception in main error? hlp plz Embarrassed

From the land beyond beyond........
across all hope and fear........
i bid you JAVA do appear.
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #8 on: 2003-08-06 13:51:38 »

Use textpad dude; BEST TOOL EVER
ctrl +1 compile
ctrl + 2 run batch
ctrl + 3 run applet.
That's all waht I've been using so far :p
Anyways you need to install jogl.jar in your jre ext folder, and the 2 .dll in your system32.
Voila Smiley
Offline jujumen

JGO n00b
*

Posts: 23


java is the juju within.....


« Reply #9 on: 2003-08-06 14:00:01 »

thanks ill try that. But why system32 what about jre bin?

From the land beyond beyond........
across all hope and fear........
i bid you JAVA do appear.
Games published by our own members! Go get 'em!
Offline Java Cool Dude

JGO Ninja
***

Posts: 680


Java forever


« Reply #10 on: 2003-08-06 14:08:50 »

Dunno, that's how things worked out for me Grin
F:\Jdk\jre\lib\ext
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 21 queries.