Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  
  why so slow?  (Read 2472 times)
0 Members and 1 Guest are viewing this topic.
Offline deepthought
« Posted 2011-01-14 13:09:10 »

i've been running quake2max, which uses opengl immediate mode, but when i mess around with lwjgl, it goes super slowly. why is that?

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2011-01-14 13:39:03 »

How slow is super slow and also, the slow bit from Java's perspective is making tons of calls across the JNI layer to OpenGL, which is essentially free in C but relatively expensive in Java.

Cas Smiley

Offline Mike

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #2 - Posted 2011-01-14 13:59:29 »

i've been running quake2max, which uses opengl immediate mode, but when i mess around with lwjgl, it goes super slowly. why is that?

It is indeed slower but it's not too bad. As long as you know the limitations and work with those you can get some really good fps. My current game runs at about 2800fps on my stationary machine, which is a couple of years old.

Can you give some more specific information except for "super slowly"?

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline deepthought
« Reply #3 - Posted 2011-01-14 16:32:13 »

it works great on my home machine, anywhere between 8 and 26 fps on my school machine, haven't tried on my laptop yet.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Mike

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #4 - Posted 2011-01-14 16:56:24 »

8-26fps with java? What is the speed with c++ on that computer? As it is a school pc I wouldn't expect it to have the newest drivers and so on so it might even rely on software rendering (brrr...)

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2011-01-14 17:13:15 »

SW rendering never gets near 26fps so it's likely to just be a very crappy computer + outdated drivers combo. I'd be surprised though if Quake in Java vs Quake in C makes any significant difference to framerate though.

Cas Smiley

Offline deepthought
« Reply #6 - Posted 2011-01-14 23:39:08 »

Quote
As it is a school pc I wouldn't expect it to have the newest drivers and so on so it might even rely on software rendering (brrr...)

yeah. and until the network was brought down by a virus, the antivirus hadn't been updated since 2004. the IT techs are stupid, and soon, i might have to use a thin client. Sad

but i think it IS software rendering.  i had to set the allowsoftwareopengl property to get the program to even run.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline deepthought
« Reply #7 - Posted 2011-01-18 13:25:48 »

how can i best reduce the number of calls i make?

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #8 - Posted 2011-01-18 13:38:09 »

how can i best reduce the number of calls i make?

Dump immediate mode, switch to using Vertex Arrays or VBO's instead. That should pretty much solve the bottleneck issue. In other words you want to batch the data together as much as possible so you send it to video card in lumps thus reducing the number of calls. This'll be much faster then immediate mode regardless of whether you use java or not.
Offline gouessej
« Reply #9 - Posted 2011-01-18 13:53:36 »

I don't understand... I have a crappy machine (bought in 2004) and both Quake 2 and Jake 2 are quite fast (60 FPS with v-sync).

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline deepthought
« Reply #10 - Posted 2011-01-18 16:24:14 »

vtx arrays or vbos should work. i'm still surprised it goes so slow, though. it is currently only rendering 4 quads with a display list.
(i decided to put any static geometry in a display list, but i'll swith to a vtx array.)

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #11 - Posted 2011-01-18 16:56:31 »

it is currently only rendering 4 quads with a display list.

If that is the case and your getting 8-26fps then jni and the number of calls isn't the problem. Its likely either a bug in your code or the graphics driver/hardware is the problem. Which graphics card is it?
Offline deepthought
« Reply #12 - Posted 2011-01-18 17:03:58 »

under display adapters in device manager it says GenevaLogic Mirror driver  and NVIDIA Quadro NVS (Microsoft corporation)

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #13 - Posted 2011-01-18 19:54:31 »

but i think it IS software rendering.  i had to set the allowsoftwareopengl property to get the program to even run.

Then there you have it. Try updating your drivers.

Offline deepthought
« Reply #14 - Posted 2011-01-18 23:36:19 »

but i don't have admin access at school, even though i could make better use of it than the ITs.
password's probably something obvious, though...

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline deepthought
« Reply #15 - Posted 2011-01-19 00:29:13 »

i know quake2max works fine. i'll try jake2 and see how well that works.if it works fine it's a bug with my program.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #16 - Posted 2011-01-19 19:01:29 »

Do the LWJGL demos run slowly too? Perhaps it's an issue in how you set up the display.
Post some error messages here (without the software rendering flag), and post your init code.

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.

rwatson462 (33 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (51 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (59 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!