Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  LibGDX ModelBuilder  (Read 2034 times)
0 Members and 1 Guest are viewing this topic.
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Posted 2013-10-03 02:35:33 »

I've recently lost my code to my old game, so I'm starting a new 3D game. I wanted to make a voxel game, and I was wondering if this is feasible with LibGDX and its 3D API. My main question is whether the modelbuilder is fast enough to create all the cubes I'll need, and how it actually works exactly. What type of OpenGL rendering metro does it use? VBOs?
Thanks!

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 136
Projects: 4
Exp: 3 years



« Reply #1 - Posted 2013-10-03 02:42:42 »

Another voxel engine? Grin
Anyways, source is here, don't think you should have too much trouble understanding it because you know lwjgl (if I remember correctly).
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #2 - Posted 2013-10-03 02:50:04 »

Yeah, making a voxel game was always my goal, and now I'm almost there Smiley

So that was pretty easy to read, wasnt that complex. However, I read somewhere that the ModelBatcher actually doesn't batch its rendering calls, it just sorts calls out and binds shaders, so its actually slow to use. Is this true? And can I also modify the individual vertices on a box? Because I'll need to do all sorts of culling.

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

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #3 - Posted 2013-10-03 17:09:58 »

Just posting back to resolve my question; LibGDX's 3D API seems very slow, I created 16x16x16 boxes from the ModelBuilder class, and my FPS dropped to less than 60 whereas with my crappy, thrown together voxel "engine" built on LWJGL can handle 4x that many cubes before dropping to even 60 FPS. Makes me wonder how exactly the models are rendered!

Offline davedes
« Reply #4 - Posted 2013-10-03 18:06:08 »

You should probably look here if you plan to make a Voxel engine with LibGDX's 3D API:
https://github.com/libgdx/libgdx/tree/master/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/voxel

ModelBatch won't actually interleave your thousands of cube vertices into the same draw call, it is more focused on sorting geometry based on their materials (like in a typical scene graph).

But in a voxel game, you don't just interleave cubes into a single VBO and expect awesome performance. Instead, you should focus on frustum culling, backface culling, and culling faces that are against each other (since they won't be visible anyways). Apply some fog to reduce the viewing distance. In the end, you should be left with far fewer faces, which can then be pushed to the GPU for rendering.

Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #5 - Posted 2013-10-03 18:10:57 »

Oh, I wasn't really planning on using LibGDX for anything 3D, honestly. I had heard it doesn't interleave geometry, so already that was a huge minus for myself, personally. I'd rather write my own engine and learn how it all works, then use a high level library that I'll never really learn from. I'm still in the learning phase, you see!

Actually, while I have you here, I've heard that combining mesh faces together can be beneficial for voxels, but it also is very slow. I'm thinking it would be very slow for anything but a solid chunk of cubes, but what do I know? Is it a good thing to do or should I should not worry about it?

Offline badlogicgames
« Reply #6 - Posted 2013-10-03 18:58:19 »

Nobody interleaves geometry for you  neither LWJGL nor JME, but ModelBuilder and Mesh can help you do that. See the source davedes posted on how it's done with the new 3D API... For what it's worth, when used with knowledge, it easily beats JME especially on mobile. Doesn't have a scene graph API though, but that's useless for voxels anyways.

http://www.badlogicgames.com - musings on Android and Java game development
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.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (30 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!