StrandTree - Ice Procedural Tree Generator

Plugins linking to this thread: (hide)

Strand TreeAuthor: Fabricio Chamon
Updated April 2014 with a fix by Hans Adrian for Softimage 2014+. Strand Tree is a set of ICE compound nodes that allow the creation of plants and trees. See the author site / the si-community discussion for documentation, example scenes and videos.

Emitters: Emit Branches, Emit Leaves Grow Control: Even distribution grow, Random distribution grow Modifiers: Modify Branch Color by Iteration, Modify Branch Width by Iteration, Modify Particle Size by Iteration, Modify Value by Iteration, Modify Value by Normalized Strand Segment Debug: Debug Iteration Strand Effects: Deform Tree by Curve, Surface Grow Rendering: Tree Visibility Options, Use Geometry Branches Presets: Basic Tree, Pine Tree

Hans' interesting explanation for the Softimage 2014 fix: [..] I moved the »set data« node to outside of »Add point« node on creation. This is because whenever there is a »Add point« node, the custom attribute stored in points may be reset. This was the case with »self.__strandTree_NumBranchesPerIteration«, which was reset to 0. It caused division by 0 in »Even Distribution Grow« node and thus the whole compound does not work. To work around this, we need to set the custom attributes in per Object context, instead, so that those attributes will not reset when there is another »Add point« node.

Available: Softimage ICE Procedural Tree Generator, ICE Procedural Tree - Surface Grow and Tree simulation - wip.

local backup: StrandTree.xsiaddon (fixed version)

tomalc
Posts: 16
Joined: 27 Apr 2010, 18:24

Re: StrandTree - Ice Procedural Tree Generator

Post by tomalc » 28 Apr 2010, 12:09

Hi,

I've upload a test scene (MixedStrands.zip)

you'll see that there is indeed a bug, for the sake of simplicity I've just made a random switch for the shape (segment or cylinder) and it works.. or not ! changing the seed value can make it works sometimes... maybe some lazy evaluation problem..

about the strand resolution, I add a ShapeResolutionU and shapeResolutionV because this is the rendered tesselation. even a strand with a few segment can build millions of polygons at render time, so this is to force the tesselation low. as you can see the result is not so different, but read the log !

with ShapeResolutionU (= 7) & ShapeResolutionV (= 16) :
// INFO : GAPM 0.4 info : triangle count (including retessellation) : 8316
Image

without ShapeResolution optimization :
// INFO : GAPM 0.4 info : triangle count (including retessellation) : 127316
Image


thomas.
Attachments
MixedStrands.zip
MixedStrands test scene
(204.1 KiB) Downloaded 219 times

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 28 Apr 2010, 13:20

ShapeUresolution and ShapeVresolution are neat. never seen them.

For rendering, a workaround seems to be to make the first particle a segment shape (added a TestParticleID and an OR node in your scene)
softimage resources section updated Jan 5th 2024

tomalc
Posts: 16
Joined: 27 Apr 2010, 18:24

Re: StrandTree - Ice Procedural Tree Generator

Post by tomalc » 28 Apr 2010, 23:47

cool !

setting the first particle to segment makes the rig work, thanks ! all I have to do after that is to clone this first particle to give it back a cylinder shape, it works !

I've made a rough test with the basic tree preset. using segment shape and shapeResolution it gives a descent result with less than 5 000 triangles ! (it was about 1 000 000 before !)

now I'm trying to figure out how to give the strands (those using segment shape) a thickness (given by the particle size ?) I can set in SI units.. the strands thickness seems to be in pixels, so I guess I'll have to play with screen resolution, distance to camera and fov... it's a shame I have lost all my college knowledge about trigonometry ! has anyone here heared about a compound that can do that ?

Thomas

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 29 Apr 2010, 00:07

if you're on '11 you can set the bool ShapeSizeAbsolute attribute for each particle. If it's "true" then strand width is in SI units.
softimage resources section updated Jan 5th 2024

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 29 Apr 2010, 05:58

Reinhard, thanks for pointing the problem. (in fact I was already expecting some problems like that)
Would you mind sharing the scene or posting a screenshot of the ice tree so that I can repro and try to fix the compound ? Also, great to know about the "first particle" solution for the segment shape problem. =)

Thomas, I also highly recommend you to use ShapeSizeAbsolute if you can go with 2011, but if you can't, try a simple "get distance to object (camera.kine.global.pos)> rescale > set strandsize". This is not 100% correct math, but maybe it can be visually acceptable.

About tree optimization, I'm experimenting with tree obj generated via Andy Nicholas' saverRenderMesh addon coupled with helge's mt_spring addon. On a low res tree this can produce much faster/stiffer sims than verlet integration if all you want is a calm breeze movement. then it can be sent back to the original ice tree via geometry queries.

ps: very nice to see the renders, keep'em coming!

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 29 Apr 2010, 08:49

Hey, got a little time to step aside the technicalities and have some fun creating images. The idea is to always try to achieve a different look on next renders! Here's a more stylized childlike/fantasy tree:
fantasy_tree
fantasy_tree
fantasy_tree_m.jpg (218.86 KiB) Viewed 4348 times
the setup is very simple: 3 tree point clouds, one bending to the left, another bending to the right and the third bending to the front (bend strands compound plugged on "execute on emit..." to get the curly feel). Also there's 3 spiral curves and each ice tree uses deform tree by curve. A lattice controls the spirals, so that you can model the trunk flow. Lastly, Emit Leaves with simple sphere shapes, throw a little color and voila!

I found the need of having an ice var that tells if a particle is a leaf in the render tree. So I'll update the Emit Leaves compound to have a "isLeaf" boolean you can use to switch colors/shaders in the rendertree.

let's see how it goes on the next...

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 29 Apr 2010, 15:21

Thanks for looking into this. It's a basic tree preset with these settings changed:

Hide Leaves
Branch iterations 9, Num Branches 4
Branch Grow Start 0.775, Branch Spread 20

When a "Modify Value by iteration" ("Value"=21) is connected to "Strand Resoultion", the branch flips.

Thomas, If you can't/don't want to go with ShapeSizeAbsolute, Anto posted a ICE tree image in the Kristinka Hair Tests thread which does the computation (near the end of the thread). Using ShapeSizeAbsolute has some effects on the render, it's difficult to describe. The strands looks less smooth.

The last tree image has a nice style.
softimage resources section updated Jan 5th 2024

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 07 May 2010, 00:43

I was testing instancing. Good thing with trees is that you can hardly see they're all the same as soon as their rotation is randomized
(updated with newer picture)
Image
6.000 instances of the same tree
58.000.000 strand segments
avg RAM usage=2.5GB
Last edited by rray on 07 May 2010, 20:31, edited 3 times in total.
softimage resources section updated Jan 5th 2024

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 07 May 2010, 16:17

Very cool Reinhard! I'd add a little tree size/color variance to sum up as well.
Is this mental ray that you used? How are the render times?

My early tests had some 2 or 3 different tree pointclouds in a group, that were random instanced on the forest.
I'll try to make a render and post here also.

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 07 May 2010, 20:27

Thanks, Fabricio! I have added varying size now (modified the picture).
It is rendered with mental ray, the render time was about 6 hours (2.2 ghz core 2 duo 4GB ram...need to upgrade if I want leaves)
Used Raytracing mode with a 40-lights lightrig (room for improvement :D)
softimage resources section updated Jan 5th 2024

Theht
Posts: 6
Joined: 10 Jun 2009, 01:15

Re: StrandTree - Ice Procedural Tree Generator

Post by Theht » 09 May 2010, 12:42

really nice man =) is there any way to convert this into polygons after simulation ?

User avatar
Maximus
Posts: 1105
Joined: 09 Jun 2009, 15:45

Re: StrandTree - Ice Procedural Tree Generator

Post by Maximus » 09 May 2010, 14:59

hmmm a question !
how you instanced all those trees? with instance shape?
can show a bit of ice tree please? i'm trying to learn

thanks and awesome work, this is really interesting to watch!

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 09 May 2010, 21:25

@Theht: yes, you can use Andy Nicholas' SaveRenderMesh addon: http://www.andynicholas.com/?page_id=158
it's a lightmap shader that can export objs out of the tesselated rendertime meshes. you can set the following attributes on the icectree for optimization: self.shapeResolutionU and self.shapeResolutionV (both need to be integers)

@Maximus: it's instance shape, you can instance point clouds too! isn't it nice? =)

Theht
Posts: 6
Joined: 10 Jun 2009, 01:15

Re: StrandTree - Ice Procedural Tree Generator

Post by Theht » 10 May 2010, 11:13

thanks man wokrs great.

User avatar
rray
Moderator
Posts: 1775
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 12 May 2010, 01:02

Hey cheers!!
I just experimented, instancing trees also works when they have leaves (which are instances themselves, so this could have been a problem)
Too little ram for renders though ;(
Using the tree itself for an instance for its leaves, lead to a crash
%-( :D

Maximus: The ICE tree for the instance is like this: I used a primitive->pointcloud->grid, randomized the points in XZ axis a bit, and tweaked a little terrain elevation with the move point tool.
Then attached an "instance shape" node with the tree point cloud, a "set particle size" and a "set particle rotation", last two fed with random values.

It's important to go into the "particle display" property of the grid pointcloud, and set it to something else than "automatic", otherwise you'll have OpenGL performance problems.
softimage resources section updated Jan 5th 2024

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 12 May 2010, 16:26

I've also experimenting some tree instancing with leaves, and they work just fine, aside from the heavy openGL which I had to set display as BBox, and tremendous amount of RAM mental ray needs to render it (12gb was not enough for 50 instances!). I'm sure Arnold can handle some million instances very easy though.

About using the tree istself for instance on the leaves, probably led to an infinite loop, that's why it crashed! =)

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests