Tree generator

I meant creating cross sections from a mesh. (horizontal projections)

Uhā€¦ theres no mesh manipulation tools at all. You have to manage your vertices and indices yourself I guessā€¦ Though I donā€™t exactly get what you mean I thinkā€¦ If you wanted to create a billboard quad with the tree, youā€™d have to use a preView and render the tree in that once, then put that texture to a billboard. This way you could have lots of trees but only one actual tree mesh in the preview if thats what you want?

I want to create the textures for a billboard.

I see jme2 had a TextureRenderer, is this also available for jme3?

I just explained it. Look at TestRenderToMemory and the TestBillboard. Together they do what I described.

Btw, the file doesnā€™t become visible after its created, you should do a FileObject.refresh() on the folder where you create the j3o file (its easier to use netbeans FileObjects than java Files actually).

Iā€™m currently working on the LOD system. But Iā€™m beginning to wonder if my project is still useful. I see @androlo is also making trees.

Itā€™s not the same thing,

Your projects generate tree models right?

@androloā€™s project is a vegetation system, but i donā€™t think trees are generated, he use tree models, maybe he can confirm.

Really itā€™s 2 complementary projects.

You could both cooperate and maybe merge your projects?

When creating cross sections of the tree I need to get hold of a RenderManager. Any idea how to get hold of one?

you have a renderManager variable in the simpleApplication class

Yes but Iā€™m not working in a SimpleApplication (making a plugin, using OffScenePanel). Should I create a SimpleApplication and use it to locate a RenderManager?

SceneApplication.getApplication().getRenderManager()

Thanks @normen you saved me again.



Iā€™m using a custom control for my cross-sections (you canā€™t create a cross section with all planes in the right order for transparency). This control is also available in a library included in the plugin. Loading the tree in code works, but I canā€™t open it in the scene composer because the custom control canā€™t be loaded. Is there a way to solve this?



Do not expect an update of the plugin this month. I will update the plugin when Iā€™m finished with the LOD system.

Hm, supporting custom controls isnā€™t exactly easy as it isā€¦ Youā€™d have to add the controls as a library in two versions: a) a ā€œJ2SEā€ library (like jme3, jme3-libraries etc.) that can be added to a project so it has the controls on its class path and b) wrapped in the Tree Editor plugin and made public to the rest of the SDK for display in the SceneExplorer etc.

Edit: Later the SceneExplorer etc. will be able to use controls that are in the project (as code or as libraries).

hi like they say i am not doing any tree generation in mine, its more of a complement to yours, not generating any trees but just taking models batching them together etc. makes it easier to control large volumes of trees (or any other models for that matter).



Iā€™m just about done with the paging component, but there will be more time before i get the rest going.



the geometry part of the tree-loader is pretty much done already, its impostoring im working on now, and when you get LODs working I would very much like to use your trees in combination with the treeloader to see how it works.



The tree-loader basically stores tree-data in arraylists, sorted by which grid-page they belong to (which in turn depends on their xz-coordinates, basically). When the loader is called upon to load a page it generates the actual treees from the data.



Iā€™m currently storing trees in a ā€œstructā€ with x,z coords, rotation and scale (sometimes also y coord), but i guess i could store some seed values of yours to generate trees instead. That would be very interesting to try sometimes.



If you get a LOD system I will implement it, and we could make crap loads of trees. :slight_smile:



Also Iā€™m making it work in conjunction with multiple terrain-quads now. not sure what will become of thatā€¦ but maybe it could be used to create like a large landscape eventually, with algorithms for planting trees and bushes in a ā€œnaturalā€ way. That data could be generated at startup, then loaded/unloaded like it works now.



Good luck.



EDIT: I have some basic animal stuff ready as well, insects flying around and fish that eat them etc, some crappy pathfinding. It could become an entire ecosystem.



EDIT: Iā€™ve used ngPlant some and know the basics of L-system stuff etc. but only the basics. It would be interesting to do some stuff together and I could learn more.

I actualy create imposters myself as part of the LOD system.



As impostor I use a crossection with transparant textures. (These classes will be available in the next version of my plugin)

To get the faces in the right order for a correct display of the transparency i use a custom Control. This control tests if the camera is in front of behind the mesh and orders the faces accordingly. (If I do not get the custom controls working in the Scene composer, I will exclude them from the .j3o and they will have to be added in code)



The other part of the LOD system is reducing the vertices used in stems and leaves.

The leaves will be reduced to one face for every leaf.

The stems will be reduce the stem from a cylinder to a triangular bar. (smallest stem levels may not be shown)

I do not know if this will be enough.



To describe a tree made by this plugin you will need a string with the ā€˜speciesā€™ and 4 seed numbers. Loading them in game will be to heavy since it takes about 10 seconds to create a tree from scratch. But a batch creator can be made to create all the necessary trees once and then loading the .j3o files. The name and path of these .j3o files are also based on the name and the seeds.



Iā€™m not using the L-system to create the trees, Iā€™m using the arbaro project and this is based upon a paper: Jason Weber & Joseph Penn: ā€œCreation and Rendering of Realistic Treesā€.

viridris said:
I'm not using the L-system to create the trees, I'm using the arbaro project and this is based upon a paper: Jason Weber & Joseph Penn: "Creation and Rendering of Realistic Trees".

The Arbaro website has a ilnk to that paper, but it seems to be broken. A google search returned a working link:
http://www.cs.duke.edu/courses/fall02/cps124/resources/p119-weber.pdf

Ok that article was interesting, thanks.



My tree geometry/impostoring system is mostly based around a few different low/medium poly models being twisted and turned a little, then added and batched. All the shaders etc. is designed for that purpose.



I guess one wouldnā€™t need anything more then the core paging engine to structure your trees. And its basically ready to go. I am making a final, major change to it now, posting in my thread (i chose to put binary file loading as the default implementation rather then terrainsā€¦ seems more appropriate) :slight_smile:

I would like to use points for the leaves when the tree is far away. Simply setting the mesh mode to points does work but this decreases the framerate. Is there a way to increase the framerate by using some sort of points? And how can I starting from a mesh create these points. (not all points will have the same color.) I searched the forum and found terms like point sprites and gl_point but i did not find any information on how to use them outside a particle system.

I made an update to the SDK so that Controls that are on the project class path via libraries or exist as code in the project can be used in the SceneComposer. This should make it easier to add custom control types. For full control over how the visual node in the SceneComposer acts and behaves its still recommended to create a specialized plugin for it that has the library on its class path as well though. The update should go to stable sometime this weekend I guess.

Iā€™m still testing various techniques on how the lod system should work. I must admit that most of the tests fail (frame rate to low). I also have only about 4 hours a week to work on this project. Progress may be slow, but I have not abandoned the plugin.