Jump to content

Why should we avoid tree branches made out of intersecting cylinders?


L B
 Share

Recommended Posts

While modeling trees, we generally use a basic technique: a cylinder-like (or cone-like, if you prefer) shape for each branch, and other cylinder/cones of sub-branches branching from it. (That's a lot of "branch", I'm hoping you follow).

 

Now the usual way to handle trees (and meshes in general) is to have 1 unified "surface", and no intersecting parts. By this I mean that the sub-branches' cones won't dig into the main branch's cone, the modeler will trim off the excess parts inside the main branch, and make it end up nicely.

 

To compensate for my poor explanation skills, here's a complex schema drawn with my even poorer MSPaint skills:

 

post-28-0-13364800-1327365820_thumb.jpg

 

Now, I'm wondering why said "trimming" is good.

  • Does it impact performance positively?
  • Does it remove visual rendering artifacts?
  • Does it lower poly-count?
  • Does it make smoother UV's?

I actually think I can say it doesn't lower poly-count. Take the followind diagram.

 

post-28-0-44211700-1327366606_thumb.jpg

 

On the left, it shows the basic cylinder shape of the main-branch. The red convex polygon marks the intersection of the sub-branch. On the right, you can see the polygon rearrangement done on the main mesh in order to re-triangulate with a hole in the surface left by the trimming. As you can see, trimming actually highers the triangle count. Admittedly, I might not have done the most optimal triangulation for every plane, but I think I'm not far from it. Edit: There is actually 22 triangles if I optimize a little, but it's still more than twice the initial amount.

 

The other argument I think is bogus is the fact that you can have follow-up, seamless UV's.

From what I understood after plenty of Googling, artists tend to be creating separate UV maps for each branch, therefore (to my understanding) breaking the follow-up of the bark texture. Of course, they might be moving the maps around and playing with the settings to make the seam as subtle as possible, but it should theoretically still be there.

 

Here's an image of what I mean. And the source: http://vanessav85.wo.../07/28/tree-uv/

treebasicuvsetup1.jpg

 

You can also look at this YouTube video, in which the author uses the same technique, even if he has 1 uniform mesh:

 

I haven't found another UV mapping technique for trees, so I'm assuming this is the norm.

 

Now the remaining arguments (assuming I logically ruled out the first two, I'm hoping for input here), is that it removes visual artifacts and impacts performance is some other way. From basic renderings I've done in real time, I haven't seen any graphical artifact, but maybe someone will point a special case where it happens. And as to performance, I don't know what logically would. Perhaps some inner, useless texture lookups, but they'd be very minimal (probably less than 1% of the total area of the tree).

 

So, why do you artists bother doing that? Quality standard? Any other reason?

Link to comment
Share on other sites

The main problem with underlying mesh is when you animate. It can give you bad deformations . Normally trees are static unless you want to really bend the trees with wind or a car crash. Generally it's just a good practice.

 

Edit: As for performance. I think a cleaner mesh is drawn a little quicker. You will not really see a difference with a few models. But if you instance a model a lot like you would with a tree, you may see a difference.

Link to comment
Share on other sites

I can think of at least one example of a game where a unified mesh of the trees would save some akwardness, but perhas not remove it entirely.

Gothic3 had trees with intersecting branches, some trees had sway to simulate wind. The result in Gothic3 was that the trees and branches moved slightly out of sync, making it look really odd, that the branches seemed to slide around on the trunk.

That is just one example of a possible implication of intersecting branches over that of a unified mesh.

Win7: 3.4GHz i7, 16Gb RAM DDR3, Radeon HD 6970 2048MB

Link to comment
Share on other sites

There are some reasons why you want closed geometry.

 

1. In CryEngine2 for example breakable trees only worked if you have a closed mesh. This is why the palm trees were breakble and not other trees with multiple branches. A palm is basically a bend cylinder. And the 2D leaf and brach textures are connected with an invisible cubic volume.

 

2. Closed meshes are used for vegetation objects which are direct in players focus. So called "hero objects". More polygones, crisp textures, and mostly a unique UV texture without tiling. Like a big tree in a gloomy forest or so. A focus object. Its also used a lot in arch-viz where you have a fly-by a tree where polycount doesn't matter.

 

3. Closed geometry is also used a lot if you use ZBrush for doing the trunk and branch and paint the texture in viewport and export the maps seamless. Basically for unique meshes which need to look awesome.

 

In general you can add a seam on top of the branch and use pelt mapping to have it nicely unwrapped so it looks good. Projection mapping can be used if you make a CG only tree. If you stick the branches into each other you can allign the mostly cylindrical unwrap to make it a good transition.

In Leadwerks I used vertex paint to cover seams or decals with floating geometry on a trunk. Like a Baobab african tree I had to do some time ago.

 

Bottom line: Do unique trees if you want maximum visual fidelity and the player notices it. Do "common" trees with tiling textures for most kinds of projects where a player passes by quickly. Its still the most used technique around and less time consuming.

In terms of performance a tiling texture with a slight overdraw is always faster as several unique trunk textures with more polygones and even some decals and vertex paint.

  • Upvote 1

Pure3d Visualizations Germany - digital essences

AAA 3D Model Shop specialized on nature and environments

Link to comment
Share on other sites

Even though you said you haven't seen any visual artifacts, having the branches intersect with the trunk usually results in awkward lighting, i. e. the shading often creates a sharp looking edge at the intersection. Depending on the type of tree that might be rather irrelevant (like a palm for example), but it can look really bad on major branches on broadleaf trees. For smaller branches and especially LOD models it usually doesn't matter that much, though.

  • Upvote 1
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.

 Share

×
×
  • Create New...