why so slow?

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

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 :slight_smile:

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”?

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

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

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 :slight_smile:

[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…)
[/quote]
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. :frowning:

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

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.

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).

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.)

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?

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

Then there you have it. Try updating your drivers.

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…

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.

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.