Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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 870 times)
0 Members and 1 Guest are viewing this topic.
Offline Riuga

Junior Newbie





« Posted 2012-12-14 07: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 Wizard


Medals: 64
Projects: 8


Muahahahahahaha...


« Reply #1 - Posted 2012-12-14 07: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 14: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!
Try the Free Demo of Droid Assault
Offline Riuga

Junior Newbie





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

I just rechecked, it was 50,016 vertices and 100,012 faces
Offline theagentd
« Reply #4 - Posted 2012-12-14 16: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 16: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 16: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 16:24:02 »

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

JGO Ninja


Medals: 33
Projects: 1


TUER


« Reply #8 - Posted 2012-12-14 16: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 16: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  
 
 

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (85 views)
2013-05-17 21:29:12

alaslipknot (93 views)
2013-05-16 21:24:48

gouessej (125 views)
2013-05-16 00:53:38

gouessej (118 views)
2013-05-16 00:17:58

theagentd (128 views)
2013-05-15 15:01:13

theagentd (115 views)
2013-05-15 15:00:54

StreetDoggy (159 views)
2013-05-14 15:56:26

kutucuk (181 views)
2013-05-12 17:10:36

kutucuk (181 views)
2013-05-12 15:36:09

UnluckyDevil (188 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.101 seconds with 21 queries.