Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  How to render a 3D model faster?  (Read 1631 times)
0 Members and 1 Guest are viewing this topic.
Offline Riuga

Junior Newbie





« Posted 2012-12-14 06:47:05 »

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?
Offline HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2012-12-14 06:48:40 »

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

[size=30pt]YES![/size]

Offline theagentd
« Reply #2 - Posted 2012-12-14 13:53:51 »

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?

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.

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riuga

Junior Newbie





« Reply #3 - Posted 2012-12-14 14:34:33 »

I just rechecked, it was 50,016 vertices and 100,012 faces
Offline theagentd
« Reply #4 - Posted 2012-12-14 15:04:58 »

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

Myomyomyo.
Offline Riuga

Junior Newbie





« Reply #5 - Posted 2012-12-14 15:15:58 »

long now = System.nanoTime();

//render...

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

Output: 1468

seems like i missed 2 zero in converting nanos -> millis
Offline theagentd
« Reply #6 - Posted 2012-12-14 15:18:57 »

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?

Myomyomyo.
Offline Riuga

Junior Newbie





« Reply #7 - Posted 2012-12-14 15:24:02 »

I got it from here http://www.mrbluesummers.com/3572/downloads/stanford-dragon-model
Offline gouessej
« Reply #8 - Posted 2012-12-14 15:57:18 »

Also, if I were to use LWJGL instead, would this be any faster?
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.

Offline theagentd
« Reply #9 - Posted 2012-12-14 15:58:27 »

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.

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

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (24 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (42 views)
2014-08-19 09:29:53

Tekkerue (41 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (26 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (73 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!