How to render a 3D model faster?

I’ve been developing a 3D game using just standard JavaSE libraries for about a month now. I just got 3D model loading and rendering to work, I tested this with the Standford Dragon (.obj file, 1,000,006 vertices iirc) and it takes 0.15 ms to complete rendering. How can I render this faster?

Also, if I were to use LWJGL instead, would this be any faster?

YES!

Pretty sure it takes longer than 0.15 ms. That would give you a performance of 1 000 006 / 0.00015 = 6 666 706 666 vertices per second. If that’s really the case, I think every graphics programmer in the world would want to have a word with you.

I just rechecked, it was 50,016 vertices and 100,012 faces

That’s still 333 440 000 vertices per second. I’m pretty sure your timings are wrong unless you’ve figured out how to do a 4D matrix-vertex multiply and a w-divide in 10 clock cycles in Java. What FPS are you getting and exactly how are you rendering this with “standard JavaSE libraries”?

long now = System.nanoTime();

//render…

System.out.println((System.nanoTime() - now) / 1000000);

Output: 1468

seems like i missed 2 zero in converting nanos -> millis

Thought so. =D In that case, you will get around 100x to 1000x better performance with LWJGL depending on the hardware you run it on. Do you have a link to the .obj file?

I got it from here http://www.mrbluesummers.com/3572/downloads/stanford-dragon-model

I assume you use software rendering, don’t you? If you used hardware rendering, it would be faster, whatever the binding for the OpenGL API you use (JOGL, LWJGL). I switched to hardware rendering in 2007 and it was really efficient but the biggest increases of frame rate came from several kinds of culling and mesh optimizations.

Edit.: I’m pretty sure your timing is wrong too. Force the high precision timer if you’re under Windows.

Around 400 FPS, depending on how many pixels it covers. That’s untextured and with no lighting though, but those things won’t make it much slower.

400 FPS = 2,5ms = 587,2x faster.

That was on a GTX 260/275. The fastest cards today are around 3-4x faster.