Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
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  
  VBO Instancing tutorial?  (Read 612 times)
0 Members and 1 Guest are viewing this topic.
Offline viveleroi

Senior Newbie





« Posted 2013-12-08 16:24:47 »

I'm looking for java-specific tutorials or examples on using instancing for VBOs. I've found a few poorly documented tutorials for other languages, but they're less than helpful. I can't find anything specific for java because of how often the word "instance" is used to mean other things. At the most, all I find is a description without any real examples.

I've been building a test app where I render 20x20 chunks of a Minecraft-style game using VBOs. Trying to reach peak performance before I move forward with converting my actual 3d block world game.



Offline theagentd
« Reply #1 - Posted 2013-12-08 17:26:54 »

Instancing isn't a good fit for cube worlds. What you want is to cull specific faces, not cubes. Are you sure instancing is the best solution?

Instancing is the process of rendering multiple "instances" of a single 3D model, allowing you to render for example 100 exactly similar trees in one draw call.

Myomyomyo.
Offline viveleroi

Senior Newbie





« Reply #2 - Posted 2013-12-08 17:44:44 »

I see, ya that makes sense.

I started a few weeks ago on a 3d block world game, and in that I'm using display lists to cache the faces of exposed blocks in each chunk. This method works extremely well, in fact the only performance problem is some noise calculations.

However, I posted on stackoverflow because I've had an impossible time getting my block-picking ray casting working. It's always half a block off. Anyway, so many people have been recommending that I use VBOs instead of display lists but so far I'm still not convinced there's a big benefit. I've written an experimental app where I can play with VBO rendering and I've gone through a lot of learning trying to get them to perform well - I finally had things running adequately with 10x10 chunks of 16x16x16 blocks - but then when I try to bump it up to 20x20 chunks, the fps essentially slows to a crawl. I need to update this testing app with the same face culling logic the real app uses, because until I am really culling all faces, it's not a good performance measure.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ags1

JGO Ninja


Medals: 55
Projects: 2
Exp: 5 years


Make code not war!


« Reply #3 - Posted 2013-12-08 18:51:18 »

I think VBOs are architecturally better than display lists (after all, they superseded display lists) but that does not mean they are faster. Display lists can be the fastest option sometimes.

Offline viveleroi

Senior Newbie





« Reply #4 - Posted 2013-12-08 19:35:24 »

After improving my block face culling in my test app, the rendering is MUCH better - enough so that the VBOs perform just as well as the display lists I currently use.

However there's still a full performance death when I render 16x16 chunks (each chunk as 16x16x16 blocks) instead of 15x16.

I don't understand why one extra row of chunks kills performance. I see nothing that explains it when I profile with visualvm, etc.

I have posted about this on stack overflow (with links to code)

http://gamedev.stackexchange.com/questions/67049/how-to-debug-framerate-drops-with-vbos-opengl
Offline theagentd
« Reply #5 - Posted 2013-12-08 20:19:09 »

After improving my block face culling in my test app, the rendering is MUCH better - enough so that the VBOs perform just as well as the display lists I currently use.

However there's still a full performance death when I render 16x16 chunks (each chunk as 16x16x16 blocks) instead of 15x16.

I don't understand why one extra row of chunks kills performance. I see nothing that explains it when I profile with visualvm, etc.

I have posted about this on stack overflow (with links to code)

http://gamedev.stackexchange.com/questions/67049/how-to-debug-framerate-drops-with-vbos-opengl

We'll need to see code for how you render those chunks then. I assume you only update the chunks when they change?

I think VBOs are architecturally better than display lists (after all, they superseded display lists) but that does not mean they are faster. Display lists can be the fastest option sometimes.
Although they may be faster on some hardware, display lists aren't equally fast on all hardware. VBO performance is a bit less hardware specific.

Myomyomyo.
Offline viveleroi

Senior Newbie





« Reply #6 - Posted 2013-12-08 22:24:33 »

The code for the test app is open source. Although it's extremely simple compared to my game, it's meant to let me have a performance and code organization benchmark, something I can settle on and be happy with before updating my game.

The specific code that builds each chunk:
https://github.com/botskonet/opengl/blob/master/src/main/java/com/helion3/opengl/shapes/Chunk.java

The VBO portion the chunk actually renders with:
https://github.com/botskonet/opengl/blob/master/src/main/java/com/helion3/opengl/rendering/TextureQuadRenderer.java

There are some additional performance changes I want to make, mainly using indexed vertices instead since so may are duplicates, but I'm still encountering such poor performance that I'm not going to switch my game to this. However, since people tend to say VBO performance is excellent, I'm wondering what I've done wrong.
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 (15 views)
2014-08-31 22:59:12

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

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

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

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

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

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

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

Rayexar (72 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!