Home Technical Talk

Using NormalThief to Weld Branches to Tree Trunks

polycounter lvl 7
Offline / Send Message
feanix polycounter lvl 7
Okay, so NormalThief is great for changing the normals on our foliage to make trees look more natural. I see that SpeedTree "welds" their branches to the trunks of their trees by making the normals at the base of the branch match up with the normals of the face they're intersecting. I figured I'd give this a shot!

Here's my test mesh.
xAPey.jpg

I run NormalTheif using the trunk itself as a the ref object.
I0GjQ.jpg
jZP5H.jpg

Not too bad! Trouble is now the whole branch has normals taken from the trunk! :(
CNYAH.jpg

I try to remedy this by reseting the verts that aren't close to the trunk.
MXUcJ.jpg

There's still a bit of a sharp transition between the stolen normals and the regular normals.
2H5vq.jpg

We need to interpolate the normals between the trunk and the regular normals. I can think of three ways to do this:
  1. Manually edit every vertice to create a smooth transition. Time consuming!
  2. Use the weld average tool in Edit Normals modifier to progressive average the normals. Looks a bit bad and also slightly time consuming.
  3. Create a new NormalThief script that has an option to influence vertices more or less depending on their distance from the reference object. Best solution, would be a bon to the community. But guppies put my maths skills to shame. :(
Anyone have any ideas on how to best tackle this?

Replies

  • Eric Chadwick
    I've tried this as well, except bending the branch base normals manually instead of using a script.

    I think it's much better to actually cut the branch into the trunk, and weld the verts.

    The only reason not to would be to allow it to work with a procedural animation system like SpeedTree has, which gives a wind-like effect by bending the branches. But most games these days use vertex shaders instead, which is a bit more of a universal tool, you can use it for a lot.

    Anyhow, interpenetrating looks kind of cheap up close, IMO.
Sign In or Register to comment.