Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
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  
  Should I move to VBOs? [Resuelto]  (Read 2892 times)
0 Members and 1 Guest are viewing this topic.
Offline Kakashi266

Junior Member





« Posted 2011-03-17 22:36:52 »

Hey folks. I've been working on a game for a long time now. I made it using immediate rendering. It's a simple display, drawing 612 quads for the tiles (as long as there is something to draw at all), and quads for whatever other characters there are milling about. It runs at 60fps with the v-sync, and does so smoothly even on my old laptop (which is 5 years old... but does have a dedicated graphics card).

Seeing as how there is so little stress (since I see people complaining about how their millions of vertexes are only chugging along) in my game, is there any reason at all for me to rewrite the whole thing using VBOs? I've been working on it the past few days, but I'm not a hardcore programmer and I'm running into issues.

Thanks in advance for the opinions.

Offline badlogicgames
« Reply #1 - Posted 2011-03-17 23:59:53 »

No.

http://www.badlogicgames.com - musings on Android and Java game development
Offline Kakashi266

Junior Member





« Reply #2 - Posted 2011-03-18 00:04:24 »

Succinct. Thank you.

EDIT - I decided to go with the VBOs. With two clicks and a copy/paste I solved the major problem that was making me rethink.

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

JGO Kernel


Medals: 380
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2011-03-18 09:10:29 »

I'd say "yeah, why not" as you'll be using the API as properly intended, it's future proof, architecturally correct, and fun to learn Smiley

Cas Smiley

Offline delt0r

JGO Knight


Medals: 27
Exp: 18 years


Computers can do that?


« Reply #4 - Posted 2011-03-18 13:15:54 »

I would emphasis the future proof aspect. I can't see immediate mode staying around much longer really. Well not without falling back to some unaccelerated legacy mode.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline kevglass

JGO Kernel


Medals: 165
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2011-03-18 13:17:02 »

Depends if you've got more interesting/important things to do on the project. It's not what I'd call a priority.

Kev

Offline avm1979
« Reply #6 - Posted 2011-03-18 16:16:45 »

I had an odd experience switching some stuff over from immediate mode to VBOs recently.  Huge speedup on my PC, but seriously, horribly slow on two different macbooks (one mine, one somebody else's).  *Much* worse than immediate mode.

Switched to vertex arrays, which ended up being almost as fast VBOs on the PC and worked fine on the macs, too.

I suppose I was mucking up something with VBO's, but it's hard to see what - the switch to vertex arrays uses 99% the same code path, since the usage for both is so similar.  And it worked well on the PC.

Offline gouessej
« Reply #7 - Posted 2011-03-29 11:17:44 »

I don't advise you to use immediate mode anyway as it might become poorly implemented in the future. Rather use at least vertex arrays and VBOs but avoid mixing them. I agree with princec.

Offline Kakashi266

Junior Member





« Reply #8 - Posted 2011-03-29 13:28:06 »

I guess this can be closed. I moved to VBOs already Smiley

Offline Z-Knight

Senior Member


Medals: 1



« Reply #9 - Posted 2011-05-12 20:24:56 »

As simple as it may sound you may look into DisplayLists.

I have a program that reads in 3DS graphics files and I implemented 4 rendering modes: Immediate, Display Lists, Vertex Arrays and VBOs. I found the following speed relationships/rankings between these modes:

ModeSetupRendering
Immediate1 (best)4 (worst)
Display Lists31 (best)
Vertex Arrays23
VBOs4 (worst)2

The display lists had the cost of setup that was generally minor but it had the fastest rendering...for one model I had rendering times of 0-15 milliseconds, while in Vertex Arrays and VBOs it was 45-60 milliseconds, and in Immediate mode it was 120 milliseconds.

The downside is that displaylists are locked in to displaying their content, so if it changes (or your window reinitializes) then you need to recreate the list. The same applies to VBOs...you have to rebind and that has a little cost to it. Vertex Arrays and Immediate mode have no cost to reinitialize.

The rendering surprised me that using display lists was much faster than VBOs or Vertex Arrays. I guess I might be able to combine displaylists and vertex arrays/VBOs but I'm not sure...that possibly would be the optimal solution.

Anyway, look into display lists as they may be more useful than you initially thought - I did and it improved my performance significantly.

One MAJOR CAUTION I have with VBOs is that they are apparently not well implemented on Mac OS and as a result you will have a huge slowdown in their initial creation. For the example model I used it took about 1 second to create/bind the VBOs on a PC but 120 seconds (2 minutes!!!) to create/bind on a Mac.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #10 - Posted 2011-05-13 09:36:23 »

It depends on the implementation of display lists in the drivers. When static VBOs are well implemented, you get the same performance than a smart use of display lists.

Offline Z-Knight

Senior Member


Medals: 1



« Reply #11 - Posted 2011-05-13 16:01:29 »

It depends on the implementation of display lists in the drivers. When static VBOs are well implemented, you get the same performance than a smart use of display lists.

ahh, good info.

I suspect the same applies to the implementation of the VBOs in the drivers because I'm having heap memory issues and crashes when switching from immediate mode/display lists mode to using vertex arrays/vbos. I run out of memory on the first rendering call and the application crashes on a computer using an onboard Intel Graphics card....sigh, kind of disappointing but nothing I can do about it.
Offline gouessej
« Reply #12 - Posted 2011-05-17 08:42:52 »

It depends on the implementation of display lists in the drivers. When static VBOs are well implemented, you get the same performance than a smart use of display lists.

ahh, good info.

I suspect the same applies to the implementation of the VBOs in the drivers because I'm having heap memory issues and crashes when switching from immediate mode/display lists mode to using vertex arrays/vbos. I run out of memory on the first rendering call and the application crashes on a computer using an onboard Intel Graphics card....sigh, kind of disappointing but nothing I can do about it.
What is the exact error message or trace? VBO using direct NIO buffers mainly consumes direct memory, only a very little memory on the heap. Intel Graphics cards are unfortunately very bad, their support of VBO is particularly bad on those labelled "OpenGL 1.5 ready", they have serious problems of performance on PBO too.

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.

Grunnt (17 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
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!