Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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 5002 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  
You cannot reply to this message, because it is very, very old.

Galdo (262 views)
2017-01-12 13:44:09

Archive (429 views)
2017-01-02 05:31:41

0AndrewShepherd0 (888 views)
2016-12-16 03:58:39

0AndrewShepherd0 (826 views)
2016-12-15 21:50:57

Lunch (961 views)
2016-12-06 16:01:40

ral0r2 (1194 views)
2016-11-23 16:08:26

ClaasJG (1295 views)
2016-11-10 17:36:32

CoffeeChemist (1319 views)
2016-11-05 00:46:53

jay4842 (1403 views)
2016-11-01 19:04:52

theagentd (1217 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!