Rendering only visible Geometries: How to improve performances by rendering managment?

Hi there again :slight_smile: . After the notices about the Cubes library I was working with, I decided to start my own project, and generate a world from noise, with block. I used JME3 's Boxes as blocks, and I used custom textures. The only problem are the performances. FPSses are really low (10 FPSses is the maximum I reached). And there are lots and lots of Objects and Triangles to render, outside the camera too.

Here’s a screenshot:

How to I improve performances and make the rendering system better? Maybe with rendering only visible cubes, or only visible triangles and render only visible cubes’ faces’ textures?

P.S.: How do I render different textures on each side of a box? That will be very useful…

Thanks anyway.

EmaMaker.

1 Like

Cube worlds are not made of cubes. As you’ve noticed it is too expensive to render many objects. So the trick is to create a mesh that looks like the surface of a cube world but is actually a larger mesh. There are numerous articles (even in this forum) so search for some keywords like ‘cube world’ or ‘meshing’.
Personally I found these articles pretty good.

1 Like

Thanks so much! I’ll see… :smiley:

1 Like

I guess from what I heard and read in this form is to draw only the visible part of a cube and not a real cube. I’m sure you will find some useful hints in this form which are more JME specific and maybe that what you are looking for.

1 Like

Any specific idea? I can’t find anything

1 Like

http://alexstv.com/index.php/posts/unity-voxel-block-tutorial
Unity tutorial, but concepts translate almost 1:1 to Jmonkey, I personally have used this tutorial to create a block world in Panda3d Python game engine

You might also want to look up greedy meshing here on the forums as well

1 Like

Did not find anything on this forum. And code from other Engines it’s not so much useful… :frowning:

1 Like

Not to sound harsh, but you might want to pick a simpler game idea until you get better at it. Climbing Mount Everest right at the start is not the best way to work your way into mountain climbing and block world games are almost the hardest kind of game to write.

2 Likes

https://hub.jmonkeyengine.org/search?q=voxel:
Some which I can remember in that list:

1 Like

The tutorial will show how to only draw faces that are needed, and the greedy meshing can be found here:

for the github repo it can be found under: Cubes/src/com/cubes/BlockChunk_MeshOptimizer.java

1 Like

And yeah @pspeed already said what I also heard a lot: Cube based stuff looks simple but is not simple. I believe them :slight_smile:

1 Like

I have already worked with Cubes library. It’s not this great thing. Full of limitations…

1 Like

Yeah but maybe you clone it and go with something existing, is better than nothing. Or at least look how they solved the performance issue you have.

1 Like

Yes, but it’s a working example showing how to construct a mesh from blocks. If understanding that is beyond your current abilities then you should shelve this project until you are better at game development.

You won’t find ready-made solutions without limitations because it’s impossible. There will always have to be design tradeoffs to support infinite block worlds. Always.

1 Like

I don’t want to shelve this project. That’s my big project, that’s a great idea. I know how to make it. Just performances

1 Like

Then you don’t know how to make it. Because that’s everything right there.

In a block world, every single decision you make will be performance related.

“I don’t want to learn to swim… just dump me in the middle of the ocean, I’ll be fine.”

We aren’t to discourage you. Quite the opposite. We’d like to see you succeed by picking a simpler project that you might complete without giving up.

To make your own block world you will basically need to build everything from the ground up. You will need to know, quite well, how to:

  1. build your own meshes from scratch.
  2. how to balance a scene graph for performance.
  3. how to hack bullet to use your custom meshes and/or how to write your own collision detection for a block world.
  4. how to implement custom picking for a block world.
  5. write your own shaders
  6. perform terrain paging and background mesh creation. (Be a threading expert)

And that’s just the easy stuff.

2 Likes

And look, I’m not just some random guy who doesn’t know anything about block worlds or picking projects that are too big.

I’ve got exactly both of those things with my project:

1 Like

Hmmm but … then why do you ask? I mean the performance issue you have is because you have no clue. I might be wrong, but it does not perform for a reason and the reason is you draw every cube even the ones can not been seen…

1 Like

That’s the problem. And I asked how to solve!

1 Like

Aha and we try desperately to explain you that this is the tricky part even skilled game programmers have to think hard and apply every trick to make that it performs well…

But I did my part in this discussion and delivered some links I remembered. It may or it may not help. I’m out now of this thread…

1 Like