Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 6948 times)
0 Members and 1 Guest are viewing this topic.
Offline Opiop
« 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?
Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 167
Projects: 5
Exp: 6 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 Opiop
« 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 Opiop
« 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:

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 Opiop
« 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

« JGO Bitwise Duke »

Medals: 82
Projects: 2

« 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. - musings on Android and Java game development
Pages: [1]
  ignore  |  Print  

EgonOlsen (61 views)
2018-06-10 19:43:48

EgonOlsen (42 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (241 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!