JME3-Voxel (Voxel-World) Paging Not Working, JME3 Bug?

I have been using the jme3-voxel code found at basically the paging doesn’t work. It seems that if you add multiple meshe’s to the same scene graph then it can’t handle it and flickers between them when you look around with the mouse.

It doesn’t make any difference if you add them all to one node or on there own nodes.

Has anyone had any success in fixing this? I have read through all the code and even re-written it slightly differently but still get the same bug. I can’t spot any errors in the code.

Thanks for your help,


Sounds like a BoundingVolume issue, try calling updateModelBound() on the spatials. If that helps the voxel engine code is missing that update.

It’s hard to say what is wrong just from the information provided but it has to be something about the scene setup. JME can display multiple meshes just fine, normally.

Hopefully someone more familiar with that project can comment… but it’s most likely something wrong in that code. Maybe something being shared that shouldn’t be or bad bounds… any number of things. Does it flicker constantly or is it like if you look in one place one turns off and if you look in another the other one does?

Paul, you didn’t sleep enough, we’re still synced :wink:

Heheh… I’m even on like a sleep schedule from a different time zone right now. I slept from noon to 6 PM today. :slight_smile:

Hi Guys, Thanks for the responses.

It’s definatly an issue with having multiple meshes (meshes created by this code) displayed at the same time.When you look around, even without actually moving, it changes which mesh is displayed in a predictable repeatable way. One appears and the one that was displaying disappears, if you look back at the original place it reverses back to how it was. They seem to display in the correct location, just not at the same time.

Obviously it is suppost to be displaying all the meshes at once. The meshes are for different chunks of the world being loaded and paged in and out as the player moves.

I have tried doing updateModelBounds() on the geometry for each mesh but no joy. Any help appreciated.


@pspeed have you written your own voxel engine for Mythruna?

Can you give us a screenshot of what you are seeing? I still can’t imagine what you explain. Theres no way I can think of that a mesh excludes another mesh, only when you put them all to one Geometry which is obviously wrong.

@iamcreasy said:
@pspeed have you written your own voxel engine for Mythruna?

Yeah... very much custom.

It really sounds like they are getting inappropriately culled. Not being familiar with that mesh code, I can’t say way.

As a TEST (just a test, you do not want to leave it this way), you could try setting the cull hint on them to Never… so that they do not get frustum culled. If they stop flicking on and off then you know it’s a bounding shape issue.

I have tried adding cull hint never to the root, sub node and geometry but it doesn’t effect the results.

To see what I’m talking about first hand please download the jme3-voxel ‘framework’ code from . It’s only a very small amount of code. When you run the PagingTest which is included you will see what I am talking about.

The PagingTest uses generated noise for values, so may look a bit strange a first. If you move back a bit for a better view and the just look around with the mouse you should see all the different meshes flickering about.

I would really love to know what is causing this strange behaviour. I can’t continue with my project until its fixed, and I’m totally stumped as to what the issue is. All of the meshes seem to work indevidually, but not when displayed together.

Thanks for all your help

Are you trying to use lighting material on this? It doesn’t look like it creates tangents. Its really time consuming to create this project, can you please just send a screenshot?

I took a quick look at the code. Can you tell me if all of the child Geometries might have the same name? Though that probably isn’t a problem, it looks like the TerrainLoader might swap them back and forth.

Actually, there would be about 20 different things I’d look into in that code but I don’t really have the time to debug other people’s code right now.

I know that JME can handle this, though because Mythruna has 400 or so nodes on screen just for its terrain and each of those has a dozen or more meshes… and I don’t see any flickering. Something about the pager in that code is getting confused and you may have to put on your debugger hat to find it.

Track wherever nodes are attached and detached. I think you will find your culprit.

Here are some screen shots as requested. It's not a problem with them being added and removed from withing the 'user' code. They are all loaded and only removed and reloaded if paging occours, which in this case it doesn't as the cameras position is not changing. I have tried disabling the update loop after 1000 runs and the problem still occours when meshes are not being loaded.

All the meshes should be displayed at once, but its like it only wants to display one of them and struggles to pick the best one to display at any one time. When you look aroudn with the camera it changes its mind about which one to display. As it does it in a repeatable way I wounder if they are over laying each other some how, and its some how picking which one to render based on the camera view direction?

Any hints on where to look would be great, or how to start debugging further.


I’d still say missing tangents. Use TangentBinormalGenerator on that mesh.

And if you really believe that it’s JME doing this and not the voxel engine then it should be pretty trivial to create a test case. It’s really likely the voxel engine, though… so a simple test case will be hard.

The generator code making these meshes isn’t calling Mesh.updateBound() after it generates them