SimArboreal Release - Formerly "Tree Editor"

I’m in the process of making this a plugin for the SDK, including creating trees right from the SDK and handling of the tree files. @pspeed, it would be easier for me if the tree files had a distinct suffix instead of the “double-dot” one with the final .json ending, do you think thats possible?

1 Like

Another tree video. Bigger trees and I’ve properly applied it to all of the LOD materials.

1 Like
@normen said: I'm in the process of making this a plugin for the SDK, including creating trees right from the SDK and handling of the tree files. @pspeed, it would be easier for me if the tree files had a distinct suffix instead of the "double-dot" one with the final .json ending, do you think thats possible?

I could… but I hesitate too for probably irrational reasons.

Really the SDK won’t like extensions with a dot in them? That’s really too bad.

1 Like
@pspeed said: I could... but I hesitate too for probably irrational reasons.

Really the SDK won’t like extensions with a dot in them? That’s really too bad.

Well we do support mesh.xml but as said it would be much easier with a normal ending and generally I don’t think every xml or json file needs to be marked as such by the suffix. In fact I find this practice a bit silly and more often causing problems than doing any good, I mean you don’t have .exe.bin either :wink: Technically the assetmanager/engine actually doesn’t support double endings properly.

1 Like
@normen said: Well we do support mesh.xml but as said it would be much easier with a normal ending and generally I don't think every xml or json file needs to be marked as such by the suffix. In fact I find this practice a bit silly and more often causing problems than doing any good, I mean you don't have .exe.bin either ;)

Nah, it’s to easily distinguish some other format I might make in the future. .simap.xml or whatever. Probably thin.

Also, if someone has a regular .json editor for some reason then they could pop these open without forcing it. An excuse that’s better for XML but I suspect .json is becoming more popular in viewers and editors.

Plus I guess I’m affected by too many years of processing boatloads of files by type rather than content and getting frustrated when “yet another XML file type that isn’t an XML extension” was found.

Anyway, I can change it but not tonight.

1 Like
@pspeed said: Nah, it's to easily distinguish some other format I might make in the future. .simap.xml or whatever. Probably thin.

Also, if someone has a regular .json editor for some reason then they could pop these open without forcing it. An excuse that’s better for XML but I suspect .json is becoming more popular in viewers and editors.

Plus I guess I’m affected by too many years of processing boatloads of files by type rather than content and getting frustrated when “yet another XML file type that isn’t an XML extension” was found.

Anyway, I can change it but not tonight.

In that case I think it would make more sense to simply check the file header, you will open exactly that file anyway, so no real overhead there (also generally commenting on that practice, not just bashing you ;)). I see what you mean by the file editor but for me personally, I have more files with xml content that I want to open in the appropriate program instead of an xml editor than vice versa. And how exactly does windows handle “double endings” in the file/assiciation manager? Or is it in fact real MIME support there?

1 Like

Windows only checks the last extension. Doesn’t check the content either.

To be safe, I did a test; I created a text file and added .jpg to it’s name… results: windows opens it with paint (and gets an error).

1 Like

Just moving this forward so that people who click on the “latest post” button don’t have to scroll back past file type discussions. :slight_smile:

3 Likes

The wind is looking really good. Just glancing at the code I see that it is implemented in the shader - not an easy task. Does the wind apply to the LODs?

What future features do you anticipate adding to SimArboreal (if you don’t mind me asking)?

1 Like
@pspeed said: Just moving this forward so that people who click on the "latest post" button don't have to scroll back past file type discussions. :)

YouTube

I find the tree wind…“weird”…mainly in the lastest video where you have big tree trunk. The wind couldn’t really move these large trunks …only branches, end of the branches to be exact. With these moves (a 150km/h wind at least ^^) you’ll find your trees on the floor. No?

On a side note, i’ve noticed that the leaves quads rotate “abnormally” when you fly near…something like billboarding i think.

1 Like
@JoeMama said: The wind is looking really good. Just glancing at the code I see that it is implemented in the shader - not an easy task. Does the wind apply to the LODs?

What future features do you anticipate adding to SimArboreal (if you don’t mind me asking)?

Yes, the wind applies to LOD.

I have a few things planned but nothing concrete. I want to add leaf atlas generation to the tool, for one.

1 Like
@haze said: I find the tree wind..."weird"...mainly in the lastest video where you have big tree trunk. The wind couldn't really move these large trunks ...only branches, end of the branches to be exact. With these moves (a 150km/h wind at least ^^) you'll find your trees on the floor. No?

On a side note, i’ve noticed that the leaves quads rotate “abnormally” when you fly near…something like billboarding i think.

Well, the strength will have to be tuned for different types of trees, of course. It will be a settable parameter soon.

1 Like
@pspeed said: Well, the strength will have to be tuned for different types of trees, of course. It will be a settable parameter soon.

Cool :).

1 Like

Will the wind strength be ably to vary smoothly? The game I’m building supports both wind direction and wind strength so being able to ramp up and down the wind strength seamlessly would be awesome. Support for wind direction where the trees lean slightly based on wind direction and strength would also be a plus.

1 Like
@JoeMama said: Will the wind strength be ably to vary smoothly? The game I'm building supports both wind direction and wind strength so being able to ramp up and down the wind strength seamlessly would be awesome. Support for wind direction where the trees lean slightly based on wind direction and strength would also be a plus.

There is no wind direction right now but it should be easy to add. Hardest part is adding the material parameter to all of the different shaders (4 j3md files)… other than that it would simply be swapping out the TreeWind.glsllib file. I don’t know if I will add direction or not but as I said it’s easy to do if someone wants to fork the shaders. Actually, hmm… the cross wind turbulence I’ve included would be slightly more difficult. Still, that’s all inside the lib file so at least there is that.

Direction could be used to control global strength also if you included magnitude in the vector.

1 Like

Added tree-specific wind parameters and made another video with stiffer trunks for those big trees:

I’m trying to change the file extension for save files and then I’ll post another release.

2 Likes

New release is up.

The download links are:

https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-Windows.zip
https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-Linux.zip
https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-MacOSX.zip

Easy link to the beginning of this thread for all related links, source code, etc:
http://hub.jmonkeyengine.org/forum/topic/simarboreal-formerly-tree-editor/

Reiterating basic usage instructions here:
Spacebar – toggles between movement and edit mode (the app starts in camera mode)
WASD – moves the movement camera mode
Cursor keys/Mouse – changes camera direction in movement mode;
Shift – moves faster
Shift + Ctrl – moves super fast
SysReq - take a screen shot
F12 - toggle video recording on/off
F3 - toggle settings and debug HUD on/off
F5 - toggle JME settings HUD on/off

Change log for this release:
[java]

  • Added an action to save the tree atlas images
    as PNG files.
  • Fixed how the atlas textures are generated so that they
    save as embedded textures in the j3o.
  • Fixed impostor meshes to use short buffers instead of int.
  • Added toggleable noise-based wind
  • Added a video recodring option F12
  • Added editors for the tree wind-related parameters
  • Changed the tree parameters file extension to just plain
    .simap The old simap.json extension is still supported for
    loading and the file format itself hasn’t changed.
    [/java]

The big deal is the embedded textures thing (now impostors work automatically from the j3o) and the wind thing (wind also works automatically from the j3o).

Three parameters control the wind for a particular type of tree:

  1. Flex height. The whole tree sways in the wind but the flex height control how much of it is mapped to a curve. Everything above the curve is linear. Generally, you want to set the flex height to about the height of the main trunk above ground.

  2. Trunk flexibility: controls how much the trunk sways in the wind. For thicker trees, use smaller values.

  3. Branch flexibility: controls how much the branches sway in the wind due to higher frequency cross-turbulence.

Enjoy. And let me know if there are any shader bugs.

Note to existing users: if you want wind to show up in your .j3o trees then you will need to re-export them. If wind is turned on when you export then it will automatically be turned on when you load them, too.

4 Likes

The wind is looking really good. The one thing that kind of pops out is that the leaves aren’t being agitated by the wind. I’m not sure what would look best with billboard style leaves but some additional movement or rotation would add a lot. Do you have plans to improve the leaf wind? If not, I’ll take a stab at it.

1 Like
@pspeed said: New release is up.

The download links are:

https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-Windows.zip
https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-Linux.zip
https://simsilica-tools.googlecode.com/svn/trunk/SimArboreal-Editor/release/SimArboreal-Editor-MacOSX.zip

Easy link to the beginning of this thread for all related links, source code, etc:
http://hub.jmonkeyengine.org/forum/topic/simarboreal-formerly-tree-editor/

Reiterating basic usage instructions here:
Spacebar – toggles between movement and edit mode (the app starts in camera mode)
WASD – moves the movement camera mode
Cursor keys/Mouse – changes camera direction in movement mode;
Shift – moves faster
Shift + Ctrl – moves super fast
SysReq - take a screen shot
F12 - toggle video recording on/off
F3 - toggle settings and debug HUD on/off
F5 - toggle JME settings HUD on/off

Change log for this release:
[java]

  • Added an action to save the tree atlas images
    as PNG files.
  • Fixed how the atlas textures are generated so that they
    save as embedded textures in the j3o.
  • Fixed impostor meshes to use short buffers instead of int.
  • Added toggleable noise-based wind
  • Added a video recodring option F12
  • Added editors for the tree wind-related parameters
  • Changed the tree parameters file extension to just plain
    .simap The old simap.json extension is still supported for
    loading and the file format itself hasn’t changed.
    [/java]

The big deal is the embedded textures thing (now impostors work automatically from the j3o) and the wind thing (wind also works automatically from the j3o).

Three parameters control the wind for a particular type of tree:

  1. Flex height. The whole tree sways in the wind but the flex height control how much of it is mapped to a curve. Everything above the curve is linear. Generally, you want to set the flex height to about the height of the main trunk above ground.

  2. Trunk flexibility: controls how much the trunk sways in the wind. For thicker trees, use smaller values.

  3. Branch flexibility: controls how much the branches sway in the wind due to higher frequency cross-turbulence.

Enjoy. And let me know if there are any shader bugs.

Note to existing users: if you want wind to show up in your .j3o trees then you will need to re-export them. If wind is turned on when you export then it will automatically be turned on when you load them, too.

Yeah, that’s really awesome. So many options…i can spend hours playing with it :s. Great job.
Can you increase a bit the grid range(20 max instead of 10) to test big forest.
No shader problems and performances are quite satisfying.
The wind is much nicer ^^.

I love to play with it <3. Thanks for this amazing tool Paul.

1 Like
@JoeMama said: The wind is looking really good. The one thing that kind of pops out is that the leaves aren't being agitated by the wind. I'm not sure what would look best with billboard style leaves but some additional movement or rotation would add a lot. Do you have plans to improve the leaf wind? If not, I'll take a stab at it.

Turbulence agitates the branch tips at a higher frequency than the rest of the tree so the leaf quads do get agitated. It’s hard to agitate the leaves within the quad without some animation. From that it’s hard to guess how fast to agitate, too.

See, really, I’ve dressed up and polished this pig about as far as it will go, I guess. It’s not at all an accurate representation of wind since normally oscillation only happens when the wind isn’t moving the tree. I try clever ways to simulate this by having the branch intensity delay the tree motion just a bit… makes it look like the branches rock back and forth after a big wind. Mostly, I fake a lot of stuff together and fake a little more and it becomes random enough to be semi-believable… and it’s relatively cheap. (2 sine lookups per vertex does make my old-school brain shudder a bit but it seems not to draw down the frame rate at all.)

A more proper solution involves not only determining wind strength but the slope of the change in wind so that the tree can oscillate or not based on whether the wind is backing off. There are a few ways to do this. Also, the tree itself needs to be treated as bones of an animation so that each joint gets rotated properly. This would also allow the down wind section of the tree to have more turbulence than the leading side and support the lateral torsion separately.

So, my fear on leaf agitation is that if I add it then it will look less natural by being a more incorrect thing. That being said, it wouldn’t be the first time that some acceptable trick eventually occurs to me.

1 Like