Generating vegetation – paged geometry style

This is now the info thread for my plant generation lib.


The lib will be used for generating forests and grass covers, borrowing heavily from Ogre3D’s Paged Geometry plugin.


Updated: 2011-11-30

The grass will be released this week. Tomorrow maybe. Everything related to this project will be put in the same plugin from now on.

Keep your eyes open for a log entry if you want to try this thing out.

Grass video


I am interested. Had a look at paged geometry, but decided its quite a lot of work.

How close to paged geometry is it? It sounds like your solution is based on geometry. Would grass be modelled? Could I use a static mesh for terrain? Are you planning on a distribution of objects based on a map?

Edit: aeh, density map is done. Forget the last question…

Sounds great. I was going to take a look at this myself eventually but since you’re working on it I might aswell use yours. The paging thing you are working on, will the work be balanced between all the processors in our computer or will it all be done in a single core?

Intrest, hell yes, where to grab a copy?

Cool. I don’t want to put too much stuff here now, I’ll put images up tomorrow to show it in action.

How close to paged geometry is it?

It’s PG light; the core functionality and a few tweaks. Its running very “close to metal”, relying heavily on jME, and I hope to keep it that way. I’m not aiming for cutting-edge optimization etc. in my code, I’m focusing on functionality; delegating most optimization stuff to the API.

Would grass be modelled?

Yes. Very much like much like PGs grassloader does it - a custom mesh of quads with grass textures on them, distributed either uniformly or through a density map. I’m working on the mesh model now (pretty much copying and pasting from PG) - the density map code is already in place.

Probably gonna use a different alpha fade method then the one in PG tho (it requires a crap-load of depth checks).

Could I use a static mesh for terrain?

Well, yes. Assuming you have an easy way of getting specific height values of your mesh you could do it right away. My current implementation uses terrain data to define a “planting zone”. That could theoretically be any box with a center, a width, a height, and an array of floating point values for y coords. At the moment its running much like PG’s “Treeloader2D”, you could say.

I am working on a “Treeloader3D”, which would be the simple way of solving it for small, static terrains/scenes. With that you can place trees and stuff in an editor and then import the scene, but still use the optimization features of the loader. In fact, Ogitor already works exactly like that with the real PG.

EmpirePhoenix i can’t put the code right now i want to finish the whole package first, just curious if someone else would be interested in using. I put pictures and stuff tomorrow and show how it works with the density maps etc.

Of course we’re interested, this could be an awesome plugin, and could easily “graduate” to core if it’s maintained.

looking forward to this!!

btw if any of you are looking at the picture and feel “wow this guys stuff looks like crap, i sure don’t want anything to do with it/work together with him on something” - I only use crappy low-poly models during dev!!!

Here is a few screens from the Ogitor scene I’m currently working on, just to show i can make stuff that looks descent…



1 Like


Wow this looks freaking amazing!

Looking good. How’s the speed? Maybe you can display the stats?

I am working on the grass now, when I’m happy with the results (sometime next weekend probably) i will put up a terrain with only grass and show the numbers. And also the code, if someone has feedback would be great.

Was there not grass in the pictures posted? Or were those not from JME?

GASP ABSOLUTELY AMAZING!!! Can’t wait for the code :wink:


That looks pretty sweet. It’s lacking shading tho. As it its looks like a cartoon which may be what you are going for.


From what I understood from the post, those pics are from Ogitor and not yet taken from a JME3 app.

The grass mesh creator is finished now, supporting both density and color maps. I’m working on the shaders atm. I’ll post some nice shaded/color mapped images in the coming days.

About the lighting - no I am not going for a cartoon look, but lighting is off for some reason in those pics, not sure why tbh. Maybe i was testing something. Lighting will be available in my grass shader and it will of course be possible to change shading params and update the shader during runtime. It’s essentially the same shader PG uses.

Shadows are different tho, and I will not do any serious work on that myself. At least not until the core stuff is working.


Those images are from Ogitor yes, but it could just as well has been from jME at this point, because it’s such a small scene and i have grass and trees now. There are lots more to do in order to make it efficient however, paging system, proper lod-transitioning etc.

I have hit a speedbump tho - I’m not sure if i want to use the Mersenne twister random generator like PG does, or the standard java one. I’m thinking XORShift, maybe? Also I’m not sure if i like the actual paging system very much; looking for alternatives.

I’m going with XORShift, so that’s already done and implemented. I think I’ll stick with the paging system from PG…

Amazing!!! Man you rock!!! Will it be a JMP plugin? Will your generator/loader be GPU (glsl shader) or CPU based?