GeometryBatchCreator removeInstance question

Can someone please help. I've integrated the GeometryBatchCreator to my project, based on TestGeometryInstancing. What bothers me,



how can I remove an instance from it? I am trying to do that but I got an opengl error when committing and updating it on displaying the result…buffers got messed up somehow I guess… someone can give me an example for removing from the mesh with the geometryBatchCreator?

The geometryInstance does not support adding/removing instances… you need to rebuild the buffers every time, and commit the data again… my new version of the classes supports that, and I will see to it that the code is available here or in the jME repository asap!

wow, sounds cool! I am wanting to use it for creating my terrain tiles, and while moving, I want to remove unneeded instances from it. (Huge step by step changing tile terrain…and I don't want to use the terrain part of jme.) Thanks!

It was originally used to create Trees/Leaves and Grass over infinite areas so it should be easy to get it to work just as good on your terrain :slight_smile:

Hmm…I am thinking about yeah, I can reuse the instances inside it, not removing, but reusing…i will try to recode it for that…but hope to see your new code in CVS soon…

I could  boost performance in my game from 70FPS to 90FPS at a minimum  with the tile terrain using GeometryBatchCreator! Wow, that's rather cool.! Only the generation could be done without rebuilding all the time…I hope removing instance will be available soon with a decent example! or can you share the source codes somewhere, so that I can patch my CVS source with it?



thx

Cool that someone is using the classes and getting better results :slight_smile:

yeah! :)  8) Can you tell me why is the Geo.Instance rotation given in Vector instead of Quaternion? I'm noob at such things, and want to know if possible!

In the new code it is a Quaternion, i don't know why I had a Vector in the first place :smiley:

The TestGeometryInstance class in the code I sent to you has key bindings (1 and 2) to remove instances… they should work…



AABB is an AxisAlignedBoundingBox, it works in the same way as the BoundingBox class in jME, the difference is that it stores a max and min value, instead of the center and extents. This makes it faster when modifying the boundingbox… the AABB is converted to a BoundingBox for the final Mesh.

I'm trying to do this removing thing the same way, but in my case I got opengl invalid value error after a while. I don't know why! :slight_smile:

Also lens flare effect is blocked by the big bounding box of my terrain as a side effect. :slight_smile: Will have to find some trick to avoid that…

Sounds like it would have created nasty blocking effects anyway XD

Is there any news when will your new GeometryBatch impl get into JME?

Nope, my plan has been to create a post with a demo of it to let people try it out and give some more feedback…



Then we will see if it can get into jME… :slight_smile:

Snylt said:

Nope, my plan has been to create a post with a demo of it to let people try it out and give some more feedback...

Then we will see if it can get into jME... :)


As someone who has been using it I can say that the newer implementation certainly streamlines the creation of instances and allows for easier and more granular manipulation of instance attributes.  We've had some talks (Snylt and I) about some of the issues between Geometry and TriMesh as I would very much like to use batching on a bunch of Text2D objects (I'm trying to dynamically number a gameboard) but currently cannot.  That aside, the newer implementation seems solid.  You will need to change a bit of code to use it though, it's not a drop-in replacement, but it's not a significant effort to port to either.

All in all, I'm very happy with it.

Now it’s possible for everybody to test the new GeometryInstancing code (source and webstart demo):

        http://www.jmonkeyengine.com/jmeforum/index.php?topic=5945.0



chirstius: with your feedback I converted some of the code so that it also supports Geometry.

Snylt said:

chirstius: with your feedback I converted some of the code so that it also supports Geometry.


Awesome!  I'll have to wait till I get home to try it out but I will certainly let you know how it goes.  Hopefully it wasn't too much effort.  Thanks again for this addition to jME.  Hopefully the newer version gets included in soon!