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)

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

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 07 Apr 2010, 20:18

thanks!

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

Re: StrandTree - Ice Procedural Tree Generator

Post by tomalc » 27 Apr 2010, 19:02

Hi,

First I'd like to thank you for your work on these compounds, they produce really nice trees !

I'm trying to optimize the result, playing with Shape Resolution U & V mostly.

But now I'd like to switch to segment shape for the last iterations so those little branches are rendered with a simple Hair_Renderer shader.

I can switch the shape from capsule to box, but when switching to segment, those iterations don't render.

I tried this :

if state id > n :
-shape = segment
-branch width = branch width * 100 (to match the result from mesh to hair)
-set data self.StrandTree_isHair = true (bool attribute used in the render tree to switch a to Hair_Renderer shader)

I made a test on a simple ice Cloud and it works, but digging in your compound is not as trivial ;)

Do you have an idea why it doesn't work ?

anyway thanks a lot for sharing this !

thomas

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

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 28 Apr 2010, 00:22

Fabricio, this is impressive---Thanks for sharing, this is really fun to use!

I noticed that you can add a few more levels of iteration by putting a "modify value by iteration" into "strand resolution" of "emit branches" .This reduces segment count for shorter branches. Use the default curve, and your original resolution value for the "value" in "modify value by iteration"
(Thomas , I think this is what you meant with "playing with Shape Resolution U & V")

I could add 2 more levels of iteration this way :
tree.jpg
tree.jpg (195.11 KiB) Viewed 4305 times
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 » 28 Apr 2010, 06:19

@Thomas: Hi, this is very strange, I couldn't get to work either. How did you tested this on the simple ice cloud ?

I tried to achieve this with 3 scenarios:

1) point cloud with 2 "add point" nodes, one with particles set to: shape=cylinder, size=0.1 and another with: shape=segment, size=10. Both have a "Create Strands" node connected to the "on creation" port. Right from this simple setup I'm not able to get the segment to render if the first particle has a shape other than "segment" itself or "point".

2) same as above, but the shapes are both cylinder (different state_id on each add point node). From this I did like you: if state_id greater than x, change shape, size and strandsize. interesting enough, this gives me inconsistent results for each of the comparision types:

- equal to, less than, less than or equal to - WORKS
- not equal to, greater than, greater than or equal to - DOES NOT WORK (only the cylinder strands show up on render)

strange is that the viewport is changing correctly, but the render is not.

3) using emit from source instead of add point node, to check if it was something related to init attributes set inside the emitter compound, then doing the same "if state_id = x ...bla bla bla" as before. result: same inconsistency with the comparision node. this is really weird.

SOLUTION: as it looks like a bug, the only solution I've found is to get a second point cloud, plug clone point node (source=first cloud, target=self, delete source if cloned=true), and do the if statements you like to enable the cloning. this worked fine no matter what comparision type I used. attached a pic showing the ice tree:
Ice tree - clone point
Ice tree - clone point
icetree.jpg (58.57 KiB) Viewed 4295 times
(by the way, testing on SI 2010 sp1 here)

@Reinhard: very clever!! I think this setup could fit right inside the emit branches compound on the next version release. What do you think about this being default? Also nice image you have there, lots of strands going on the last iterations huh? (looks like hair). are you rendering with sss or it's just a impression ?

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

Re: StrandTree - Ice Procedural Tree Generator

Post by fabricio.chamon » 28 Apr 2010, 06:30

forgot to say: check first page for a video of a wip tree simulation!

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

Re: StrandTree - Ice Procedural Tree Generator

Post by rray » 28 Apr 2010, 09:29

Cheers man, thanks for picking up on this Fabricio. I think it would be nice to have this as default, the length attenuation fcurve could be reused. It might make sense to implement it using a slider from 0 (no optimization) to 1 (full).

Had some side effects (see attached) using this but I think this could be resolved if new branches were spawned at random % positions instead of at random points. I don't know how difficult it is to implement this because I haven't gone to real depths with ICE yet. There is a compoud I remember (I think done by Helge) called GetPositionOnStrand that could probably be used for this. You can find it inside Kristinka Hair kH_Strand_Length compound.

The material is 2011's Hair_Shading, standard raytracing & shadows using a light rig. I think the SSS effect might come the high number of lights (64).
______#
PS... nice sim!
side effect when reducing segment count
side effect when reducing segment count
IMG_H2.jpg (202.48 KiB) Viewed 4263 times
Last edited by rray on 28 Apr 2010, 18:16, edited 1 time in total.
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, 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 218 times

User avatar
rray
Moderator
Posts: 1774
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: 1774
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 4317 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: 1774
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: 1774
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: 1774
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

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests