Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

jim c

[SOLVED] Right way to skin a tree

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

Share this post


Link to post
Share on other sites

I can't help you unfortunately, but I stopped by just to say that this looks pretty sweet. If your intention is to release the system when it's finished, either as a free or paid asset, I wish you to succeed all the more.

Share this post


Link to post
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).

Share this post


Link to post
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.

1 person likes this

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

And here's the result now, a couple of captures of different frames

tree-wip7.jpg

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now