The Forester

This is the official thread for The Forester.



News 2012-08-19



The library is now part of the BioMonkey lib. There will be a new thread at BioMonkey 1.0 release.



News 2012-06-30



Back on the job, but it’s gonna be slow progress now during summer. Have a nice holliday/vacation everyone.















What is the forester?



It is a library designed for rendering vegetation, such as grass, bushes and trees.



How do i get it?



The downloads can be found here: http://code.google.com/p/the-forester-jme/



How do I use it?



Check the project page for info. There’s a downloadable demo project with lots of comments in it. There is also a tutorial available here.



What about LOD?



A tree impostor system is being made. It’s been postponed due to transparency issues and some work on the river system, but it’s being wrapped up now (2012-06-30).

30 Likes
@androlo said:
Been doing some more improvements while waiting to see what happens with some engine stuff. This is actually pretty big.

The single pass material stuff is all gone from the grass UI. It's all programatic now, and all you provide the grass object is a texture. Stuff like meshtype and everything else can be changed through the grass object later. If/when there's an editor, that means you'll be able to create a new grass, then set all the stuff in the properties editor.

Gonna do something similar for trees. Since trees need to have materials on them (if not to make modeling easier), I'll just require them to use the regular lighting material, then the tree system converts them to single pass specialized materials automatically, and you do additional configuration programatically, like with the grass. This is good because it lets you view trees and stuff like it normally works, and just throw them into forester without problems.

I really don't see a reason to expose the material stuff to users, because the materials I use are not the standard jME materials. Grass needs no port from lighting.j3md as they have no meshes to be displayed on anyways, until forester creates them - and if they have a mesh, they should be using the treeloader anyways.

To make this easier I think I'm gonna write a few tables in the tutorials for trees and grass etc, with the name of each param and a short explanation of what it does.

EDIT: Got rid of the grass sprite system completely. The 90s are over...

Hehe that sounds really cool :)

Been doing some more improvements while waiting to see what happens with some engine stuff. This is actually pretty big.



The single pass material stuff is all gone from the grass UI. It’s all programatic now, and all you provide the grass object is a texture. Stuff like meshtype and everything else can be changed through the grass object later. If/when there’s an editor, that means you’ll be able to create a new grass, then set all the stuff in the properties editor.



Gonna do something similar for trees. Since trees need to have materials on them (if not to make modeling easier), I’ll just require them to use the regular lighting material, then the tree system converts them to single pass specialized materials automatically, and you do additional configuration programatically, like with the grass. This is good because it lets you view trees and stuff like it normally works, and just throw them into forester without problems.



I really don’t see a reason to expose the material stuff to users, because the materials I use are not the standard jME materials. Grass needs no port from lighting.j3md as they have no meshes to be displayed on anyways, until forester creates them - and if they have a mesh, they should be using the treeloader anyways.



To make this easier I think I’m gonna write a few tables in the tutorials for trees and grass etc, with the name of each param and a short explanation of what it does.



EDIT: Got rid of the grass sprite system completely. The 90s are over…

3 Likes

Very nice :slight_smile:



And congrats on the 1.0 :slight_smile:

1 Like

Changelog:



Log for the latest versions can be found in the netbeans module info.

1 Like

Cool, were can i grab the source code for it? (Since I want to try use it with eclipse)

1 Like

http://code.google.com/p/jmonkeyplatform-contributions/source/browse/trunk/TheForester?spec=svn440&r=440#TheForester



Thanks a lot man!!!

Can we use a texture mask for the grass density?



Also i would like to ask about animation: is it GPU or CPU? How much animation costs for fps?

1 Like

Heres the jar: http://code.google.com/p/jmonkeyplatform-contributions/source/browse/#svn%2Ftrunk%2FTheForester%2Frelease%2Flibs%3Fstate%3Dclosed

Beat me too it heh. I’ll link to it in the main post as well.

1 Like

Hm no, in the jar is only the class files and the JMP Netbeans stuff, but neither source nor the j3m files mentioned in the tutorial :confused:

weird, ill rebuild it then.

1 Like

@androlo: Each time you commit changes to your plugin the added svn revision is upped, you don’t need to up the plugin version manually if you have set “append implementation version automatically” and set the implementation version to “0” in the plugin properties.

Ok it should work now. And btw, there are no .j3m files in there. You’re supposed to create those yourself from the material definitions. Those are in the Resources folder. Check out the “materials” portion of the tutorial.



There can still be bugs tho, please bare with me for some time.

1 Like

@normen

Ok. I had some problems comitting the module when it had not been updated (only the library is ever updated). Svn didn’t think the module had actually changed, its why i messed with the versions. Gonna look at it again.

1 Like
@mifth said:
http://code.google.com/p/jmonkeyplatform-contributions/source/browse/trunk/TheForester?spec=svn440&r=440#TheForester

Thanks a lot man!!!
Can we use a texture mask for the grass density?

Also i would like to ask about animation: is it GPU or CPU? How much animation costs for fps?


You can use any texture for grass density, but I'm gonna have to update the tutorial on how to use the grass grid. I'll do that while keeping an eye on this thread.

And about the maps.. I just changed the entire image system. Took a bunch of stuff from the ImageBasedHeightMap (attributed the code of course), so that most image-types would be supported. It reads the image and saves density data in a float array etc, just like the heightmaps. Its still a work in progress, but hopefully it will be replaced completely by the heightmap stuff.

The animation code is in the shader. The shaders are in the "Resource" folder so you can look at it if you want. It not very expensive, just a sine function and some multiplication and addition.

EDIT: Here it is:

pos.xz += 0.1*m_Wind*inTexCoord.y*inTexCoord.y*sin(g_Time + pos.x * m_SwayFrequency);

m_wind is a vec2, sway frequency is just a value that can be used to change the offset. Hmm but i have messed it up some. The frequency should be multiplied with time as well. Have to change that.
2 Likes
@androlo said:
Svn didn't think the module had actually changed, its why i messed with the versions. Gonna look at it again.

It checks the root folder of the project for the latest change in svn, so in this case its the whole trunk/TheForester folder, including the release/ folders contents.

VERY NICE!! Thanks again!

1 Like

If anyone actually get this to run, please let me know.

1 Like

Hm, just updated the jar, and opend it with 7zip, there still seems to be no src in it, (and not the material definitions I need to use as a basis for my own grass.j3m)

@EmpirePhoenix

Weird indeed. I see both .class, .java and materials in my jar. Have to check it again then…

1 Like