Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Sweeeeeeeeet JOGL  (Read 2494 times)
0 Members and 1 Guest are viewing this topic.
Offline Java Cool Dude

Senior Duke




Java forever


« Posted 2003-08-03 21: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

Senior Newbie




Java games rock!


« Reply #1 - Posted 2003-08-03 22: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

Senior Duke




Java forever


« Reply #2 - Posted 2003-08-03 23: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #3 - Posted 2003-08-04 00: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

Senior Duke




Java forever


« Reply #4 - Posted 2003-08-05 17: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

Junior Duke




Java games rock!


« Reply #5 - Posted 2003-08-05 18: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

Senior Duke




Java forever


« Reply #6 - Posted 2003-08-05 20: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

Senior Newbie




java is the juju within.....


« Reply #7 - Posted 2003-08-06 14: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

Senior Duke




Java forever


« Reply #8 - Posted 2003-08-06 17: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

Senior Newbie




java is the juju within.....


« Reply #9 - Posted 2003-08-06 18: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #10 - Posted 2003-08-06 18:08:50 »

Dunno, that's how things worked out for me Grin
F:\Jdk\jre\lib\ext
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (29 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (56 views)
2014-10-14 00:39:48

TehJavaDev (55 views)
2014-10-14 00:35:47

TehJavaDev (46 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!