Jump to content

[SOLVED] Right way to skin a tree


jim c

Recommended Posts

I've got a nice little lsystem that is producing a tree. The goal is to animate this process. So I'm going from this

tree-wip1.jpg

to this over around 360 steps.

tree-wip2.jpg

So far so good.

The only real problem I'm having is how to best generate UVs while it's "growing". To add nice detailing to the geo I use the UV data to apply some deforms. My problem has been that to get this to work nicely I hand built the UV map in Modo using the last frame of the tree's geo like so:

tree-wip3.jpg

Then I used the UVLayout SOP to layout all the islands horizontally along U, and then gradually increased the V values as they run along the new U coord the to "twist" the UV, which then makes it easier to deform it to this:

tree-wip4.jpg

I don't need to do this to all the geo, just the lower trunk portions, the higher branches don't matter they'll be hidden by all the leaves anyways.

So, the question is, how to apply UVs like this for the rest of the previous intermediate frames? I've tried to use a wire deformer to get the final geo into a similar position as the growing geo and then use an attribute transfer SOP for the UVs, but that doesn't work so well.

Another idea I had was to use a foreach block to isolate the individual branch pieces and then somehow regenerate uvs for each piece, but while I can get the foreach to work I haven;t figured how to re-apply the UVs.

The geo us being created with PolyWire Sop which I think I need to stick with as it gives the best results at joining everything together.

I've cached out various pieces, so I have access to the underlying lsystem wires (prior to it being fed to the PolyWire sop) if that helps.

 

Any ideas would be most appreciated!


Thanks

 

Edited by jim c
Link to comment
Share on other sites

Thanks, I wasn't thinking along those line, it's a project for my wife, she wanted a magic growing tree :) Unfortunately it's taken forever to get done. Id be happty to write up the basics of how it works though (most of the core is coming up with some nice L-system code).

Link to comment
Share on other sites

you could generate the final shape with uvs first, then modify that geometry, moving the points around and blasting and fading in parts of geomety as it grows.

you could use the l system (which I don't like to use because it's not intuitive to use  especially if other people needs to use the setup or modify it, and the same thing can be accomplished with other methods) to drive some attributes on the final geometry that you'll deform / fade.

if the l system grows and change the position of the branches over time, which I guess happens, you should try to separate the growth process from the deformation.

  • Like 1
Link to comment
Share on other sites

OK so I more or less figure out how to get this to work. First problem was that when I switched to the UV viewport, the UV's didn't show up so it was difficult to tell what was going on (they were there however, I could export the model and see the uvs in Modo).

Next step was to delete all the branch geo as it was being created. Using a delete Sop with an expression that checked against the gen attribute (that's supplied by the Lsystem) pretty much did that.

Next I used the UVLayout Sop to layout out the various UV islands that the PolyWire SOP creates more or less horizontally. This is done with UV at the vertex level NOT at the point level. After this was done I used an attr promote sop to calc the max UV value and store in a detail attr.

Created a Attr Wrangle Sop to adjust the uv.y value so its gradually increasing as a function of uv.x/maxuv.x value.

At this point we've got twisting UVs, not matter what frame we're on! The rest was re-suing the existing technique I'd worked out for the static hand built uv's I'd made in Modo.

It's not perfect, when you promote the vertices UVs to point UVs there's some distortion that happens at certain areas, but I can live with that, maybe some clever camera angles to avoid focusing on those spots.

tree-wip5.jpg

tree-wip6.jpg

Edited by jim c
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...