Home Technical Talk

Tree making fast technique?

24

Replies

  • Em.
    Offline / Send Message
    Em. polycounter lvl 17
    Nice thread and good job pointing out the normal and lighting issues of canopies, that shit and trees in general get overlooked a lot.

    This is all from the perspective of doing pretty low-poly art(read, not 360/PS3), so keeping that in mind these are my thoughts.
    I've evaluated all sorts of tree generating tools and programs at work and like a few others have had no luck with them. I like doing trees and because I've done a lot of them, I can make them pretty fast with good ol' fashioned poly modeling and I get clean geo that looks exactly how I want. I get what I want the first time without having to try to get sliders and numbers to produce it. When I messed with speed tree, I spent so much time optimizing my trunk after the fact it ended up being pointless.

    Either way, I feel like if anything, it's a good idea to learn how to make great trees if you're going to be an environment artist. A lot of people aren't good at trees and it's a nice weapon to have in your arsenal. Get some good source material and make it happen.
    As far as populating large areas goes, you'd be surprised how much variation you can get off of modeling 5 trees(a couple of texture variations, thickness/scale changes of trunks, different canopy constructions, etc. to make additional variants from the original 5).
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    Thanks a lotfor the nice replies , I am using so far 3dsmax 2009 , I am also making trees in max to use in a cryengine in a blue mars setting sois a slight different editor but almoust 99% the same used for crysis , just a bit more evolved since is a subsequent updated one after crysis wars... some features are disabled still but most are in .... I am really working hard at making trees now and I want to make them good , realistic and most of all performant , the place doesnt need to be a fps place but it is so vaste that will have tons of plants and trees in a very wide area to explore .... I am not an expert and I amjust an amateur learning all the time so forgive some inaccuracies and my ignorance in many fields ....
  • Eric Chadwick
    Em, can you share some techniques? NAIMA, not a problem at all, keep asking questions.
  • Em.
    Offline / Send Message
    Em. polycounter lvl 17
    Eric, would be happy to do a little write-up, I mean I mainly just poly model the trunks, edge extrusion, cutting in ridges, manipulating verts etc. but it might be helpful to someone. It may take till the weekend to get to, got a lot of crap going on this week.

    Naima, everyone has to start somewhere, this is what PC is for. ;)
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    For example one issue I am having right now is how to make a belieable dense foliage for a tree and avoid the squarish recognizeable look of the planes of the foliage texture , o actually how to arrange them ..

    plus does the cryengine supports custom normals ? meaning so that I woudl get use of this plugin for it?
  • Michael Knubben
    You know what, why don't we turn this thread into a back-and-forth on different techniques? The problem with making a tutorial on your own is that, most of the techniques I know were discovered out of neccesity, on a commercial task, and it might not always be the best one. If someone posts their technique, others can make observations on what they believe to be its flaws, and how they could be improved.
    In which case, it would be nice if 'stupid questions' didn't get a negative response, but rather an informative one.

    On Eric's tree for instance, I think it could have been much improved if you tweaked the little cluster of leaves to the right (in the top image) to be more like a sphere on it's own. I also would have used a much more rounded mesh to dictate the normals for the main cluster of leaves, for the lighting to really catch the form.
    normalthief.jpg
    This might be something you all disagree with, in which case it would be great if you'd tell me why, and how you'd do it differently.

    Also, a comprehensive list of engines that do and don't support custom vertex normals would be great. Can we take it as a fact that udk/ue3 doesn't support it, or is it only the current exporter that neglects to export them? If this were the case, it might be as easy as getting one of our Epic employees to ask a programmer whether this is something they'd want to change for us.

    What I'm curious about is... if an engine doesn't support custom vertex normals, does it always just break the actual vertices to at least get broken up vert-normals?
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    that's the tree I was working on but how I get a picture without the planes showing?

    28409682.jpg

    also when rendering I get all those weird red things ... I am using tiff files ....
  • Michael Knubben
    Naima: I realise what I just said about stupid questions, but yours was answered by Eric, with pictures and all.
    Is it that you just don't understand what normals do? If so, I'll try to give you the concise version: they influence shading. Broken up normals give hard shading, welded normals give soft continuous shading, and you can tweak your normals to influence the way it appears to receive lighting.
    Also, I would advise against rendering anything for realtime purposes. Use 3point studios' new shader or Xoliul's shader, those are fantastic for previewing your asset roughly as it would appear ingame, with all the same limitations.
    I watched a tutorial yesterday where someone rendered stuff to preview small changes to their spec maps, and it drove me crazy. That is just a massive waste of time and flexibility, and I would advise against it!
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    but I am making it for a crysis level , so I have to use the crytek shader for the materials there bu tthey do not render in the rendering window well I Guess , anyway I could even skip that if I was able to visualize well in the viewport itself , so far the graphics are really low res and I always have the annoying panels lines for all objects and dunno how to disable enable them ....Also about normals what I didn't understood is not what they do but if this system of unifying normals cn be applied in crysis sandbox items and also what shoudl be the source target for "stealing" normals with that tool ?...
  • Eric Chadwick
    MightyPea wrote: »
    On Eric's tree for instance, I think it could have been much improved if you tweaked the little cluster of leaves to the right (in the top image) to be more like a sphere on it's own. I also would have used a much more rounded mesh to dictate the normals for the main cluster of leaves, for the lighting to really catch the form. This might be something you all disagree with, in which case it would be great if you'd tell me why, and how you'd do it differently.
    My example was made super-fast, with crossing-plane particle meshes. These do give a lot of vertex normals, which means they can shade very well when the normals are bent. But the silhouette isn't always the best. Kind of "clumpy".

    Depends on the type of tree I think, some work better with a "cup" shape for the leaves. I don't like the hard edges I usually get from "cups" though. Here's what I mean by "cup" shape.
    MightyPea wrote: »
    Also, a comprehensive list of engines that do and don't support custom vertex normals would be great.
    Sounds great, add it to the wiki when you find out, maybe here.
    MightyPea wrote: »
    Can we take it as a fact that udk/ue3 doesn't support it, or is it only the current exporter that neglects to export them? If this were the case, it might be as easy as getting one of our Epic employees to ask a programmer whether this is something they'd want to change for us.
    I think the UDK import process creates the vertex normals from scratch, but I haven't used it enough to know for sure. Check the UDK section. Also you could contact the Epic members via the Job Census list. Great idea to contact them.
    MightyPea wrote: »
    What I'm curious about is... if an engine doesn't support custom vertex normals, does it always just break the actual vertices to at least get broken up vert-normals?
    Usually not in my experience. Usually if they don't support smoothing groups (which are a form of edited normals, though not exactly the same mechanism) then they will recreate the normals on import as if it's all one smoothing group (no hard edges).

    One way to circumvent this is to manually break edges on your mesh, forcing the duplication of vertices, and thus breaking the normals. However this is generally a bad practice as it can create gaps, doesn't play well with vertex shaders nor automated LOD nor dynamic tesselation, and it increases the memory cost of the model unnecessarily.
    NAIMA wrote:
    but I am making it for a crysis level , so I have to use the crytek shader for the materials there
    This is the best way. You should be editing your models by using a real-time shader, because that is the closest method to how it will be rendered in the game engine. It won't be a perfect match, it never is. But it is better than the non-game-like artifacts you get from rendering.
    NAIMA wrote:
    but they do not render in the rendering window well I Guess
    No they do not. Real-time shaders are not meant to work with the renderer. They are only meant to work in the viewport.
    NAIMA wrote:
    so far the graphics are really low res
    perhaps this is because the viewport window is small, try making it full-screen (alt-W is the default hotkey in Max).

    It could also be your Direct3D settings. You should enable "Match Bitmap Size As Closely As Possible" here, then reload your Max file.
    NAIMA wrote:
    and I always have the annoying panels lines for all objects and dunno how to disable enable them
    Have you tried the F4 key? Shaded wireframe toggle.
    NAIMA wrote:
    Also about normals what I didn't understood is not what they do but if this system of unifying normals cn be applied in crysis sandbox items
    Probably not. Do a test and see. Create a box, add an Edit Normals modifier, rotate the normals to all face up, export into Sandbox, see what you get.
    NAIMA wrote:
    and also what shoudl be the source target for "stealing" normals with that tool ?...
    In my screenshot, the red mesh at lower right is the "reference" mesh. I just made a quick shape that had the normals pointing in the directions I wanted the tree to use.
  • Xendance
    Offline / Send Message
    Xendance polycounter lvl 7
    Shame that not all game engines support modified vertex normals :\
  • cman2k
    Offline / Send Message
    cman2k polycounter lvl 17
    Wow, lots of great information in here. Thanks Eric and everyone else for your patience with this, this is great stuff!
  • Eric Chadwick
    np Carlos.

    Did some more testing today. Trying different shapes, different normals, but same textures. Both trees are around 620 tris, including backfaces.

    The trees that are 2nd from right... I used a more blobby reference shape for the Normal Thief script, worked better than the simpler red shape from before. Also the script ran faster, woot!

    The trees on the far right... I bent custom normals for a single foliage piece, then duplicated that around to make the tree. So each foliage clump has sphere-like vertex normals.

    Tree_Normals.gif
  • RexM
    Nice stuff here.

    I'm gonna see if Cryengine2 has support for vertex normals. This would be fantastic for my vegetation if so.

    EDIT: It seems that any engine with dynamic lighting supports vertex normals.
  • Eric Chadwick
    RexM wrote: »
    It seems that any engine with dynamic lighting supports vertex normals.
    Right, but the question is do they let you bend those normals?
  • RexM
    What do you mean? Like with making clusters with sphere-like normals like you did above? Most likely, don't see why it wouldn't be supported since it is still within the capabilities of vertex normals regardless...

    Alternatively, is there a version of Normal Theif or a similar script for XSI?
  • Eric Chadwick
    In my experience, the lack of support is usually because the programmer who wrote the export/import pipeline did not see the need to add support for custom vertex normals.

    So when you export/import your hand-tuned model from the modeling application (XSI, Maya, Max, etc.) into your game editor (CryEngine Sandbox, Unreal Editor, etc.), then the custom normals are either discarded at export time because the file format doesn't support them, or the normals are simply recalculated on import.

    Support for smoothing groups/hard edges is not the same as support for edited normals, at least with 3ds Max. Supporting them means using different parts of the SDK. So although games often support hard edges, they are not likely to also support custom normals.
  • RexM
    All that is left is to just try it out.

    Is there a way I can convert this max script for usage within XSI?
  • Eric Chadwick
    Not sure, there might be. Here's the script. Does XSI's scripting language let you project between meshes, and read/write vertex normals?
  • RexM
    I have no idea unfortunately, I have not worked with any XSI scripts.
  • Eric Chadwick
    You could try searching any XSI script repositories you know of. If there isn't one already, you could contact someone who made something similar, ask if they're interested. You might be surprised how often this works.
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    So did anyone try if the Cryengine supports custom normals? I have yet to understand how to use this thief thing t try myself actually ....
  • Eric Chadwick
    You don't need that script to test vertex normals in Sandbox. Did you miss this earlier post?
    NAIMA wrote:
    Also about normals what I didn't understood is not what they do but if this system of unifying normals cn be applied in crysis sandbox items
    Probably not. Do a test and see. Create a box, add an Edit Normals modifier, rotate the normals to all face up, export into Sandbox, see what you get.
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    Have you tried the F4 key? Shaded wireframe toggle.

    Still there ...
  • Eric Chadwick
    Go to File, Save As, Archive, and upload the file here. Make sure the FX file is in the Zip file too.
  • Eric Chadwick
    Added this example to the wiki Vertex Color page

    VertexColor_Tree.gif
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    NAIMA wrote: »
    Still there ...
    I rectify , it worked thanks ....
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    Here is my ingame wip on a ceiba pentandra ...

    My main concerns are about the shape distribution of the foliage to get a realistic look ...



    http://img192.imageshack.us/img192/9111/kapokshape.jpg


    this is a test of less foliage density on the texture on left and more on right ...

    http://img534.imageshack.us/img534/2934/69655829.jpg
  • Eric Chadwick
    The fuller texture looks better to me, not so "floaty" on the tips.

    But the trunk look like an older tree, while your top looks like a younger tree. They don't match. If it's older, it should be wider. If younger, the trunk needs to be smaller diameter and the leaves need to be bigger.

    Ceiba_pentandra_1.jpg

    Ceiba_pentandra_MS_6628.JPG

    A younger tree:
    SDZoo_08_21_09038.jpg
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    Ok I remade the top of the trunk andded more branches etc... how looks now?

    76663387.jpg

    note that the left one is taller nd I sinked more in the plane to compare the other old one on right also I still haven't separated the low poly groups from the highpoly versions so that's why looks more dense ....


    That's ingame...

    78954879.jpg
  • Eric Chadwick
    Looks OK to me. If the scale is that massive, you will need other props around it to help "sell" its size. Also the texture density on the bottom of the trunk will be important.
  • Eric Chadwick
    Made a comparison image for a page on my site. Even just vertex color without any lighting is a nice step up.

    tree_shading_examples.jpg
  • Michael Knubben
    Excellent resource, Eric.
  • michi.be
    Offline / Send Message
    michi.be polycounter lvl 17
    Indeed. The vertex color stuff is very cool too. I hope it wont interfere with materials with use also vertex colors so there wont be leaf bending at the dark spots. Saved the pic and will use it for my trees.
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    Heelo all first post here :) I'm also experimenting-learning a bit..

    Birch - trunk still to come today. It was not intended to by low-poly.. But comment on improve are welcome.
    screen01_birch.jpg

    Thuja
    screen02_thuja.jpg

    btw: Eric can I ask how are you doing that turntables? :) some handy script?
  • Eric Chadwick
    michi.be wrote: »
    Indeed. The vertex color stuff is very cool too. I hope it wont interfere with materials with use also vertex colors so there wont be leaf bending at the dark spots. Saved the pic and will use it for my trees.

    The leaf bending depends on your tech I think. CryEngine? If they use vertex color for other things, then you probably couldn't use it like in my image.

    Though maybe you could make a shader that uses vertex alpha data as your color instead, or maybe a different vertex channel altogether. A UV channel can be used to store vertex color instead of UVs.
  • michi.be
    Offline / Send Message
    michi.be polycounter lvl 17
    No I use Leadwerks Engine for most work. CryEngine has a nice vegetation shader system already.
    Will ask the dev if its supported :)
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    nIce thread and tech info.. I'm also using normal thief, Nice but sooo slow tool. I'll post some images when I'll be able to do so.. :/ My post didn't get in.. ?! Low post count? weeee
    btw: Eric how you preparing this turntables? Is there some workaround/script for them?
  • Eric Chadwick
    Nope, no script. Just animated a 360 degree rotation, Make Preview out to AVI, and converted to animated GIF.

    First tree doesn't look like it's shading correctly. 2nd tree... can you show the wireframe?
  • THE 5
    Offline / Send Message
    THE 5 polycounter lvl 14
    NAIMA:
    If your tree is gonna be THAT huge, how about a similar root style like in avatar?
    Avatar_Tree_of_Life.jpg
    Shure boosts complexity, but i think thats worth it.
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    Here's the wire.. nothing special.. this tree was made for close contact.. So it's little heavy on poly.. I'll post some in-game screen soon..
    screen03_thuja.jpg
    Must say that making vegetation is quite heavy-brain-damage stuff :)) MUST look good and MUST run smooth in ANY case.. then I think it's good..
  • Eric Chadwick
    Em. wrote: »
    Eric, would be happy to do a little write-up, I mean I mainly just poly model the trunks, edge extrusion, cutting in ridges, manipulating verts etc. but it might be helpful to someone. It may take till the weekend to get to, got a lot of crap going on this week.

    Any updates Em?
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    THE 5 wrote: »
    NAIMA:
    If your tree is gonna be THAT huge, how about a similar root style like in avatar?
    Avatar_Tree_of_Life.jpg
    Shure boosts complexity, but i think thats worth it.


    I would really love that , now my kapok tree isn't abnormal as this one but is a natural real one growing about 40 - 50 m above the ground and emerging on the other normal trees of the jungle by at least 10 - 20 m up , the roots are immense compared to a man , the problem I am having is that I chose a texturing made witha tiled texture , so the look is pretty much uniform , I would have gone with a direct painting with mudbox but then the texture woudln't look so much detailed especially on the roots , so I am kind of stuck in how to get more details or more variety , I can't add detail maps or decals on the vegetation object in crysis editor , I coudl may be dirty a bit more the texture tiled but then It woudlnt look varied much couse all the tee woudl get similar distribution ....

    Any idea on how to make it better textured?


    Also about that tree osted right above looks great I think :) ....
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    @NAIMA: I unaware of crysis editor how it handle trees but I would suggest double trunk geometry and use that cloned trunk with some slight offset to map it with alpha texture you wish.. Since it's crysis engine I think higher polycount does not matter so much in object of that scale.. ;) just my 2 cents..
  • Tumerboy
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Great thread guys. Eric thanks for all the info and help.
    We tried speedtree out here at work for a while, and found that it took us longer to get what we wanted, and it was more cumbersome (programatically, and asset-wise) than just building trees by hand. It's definitely a cool program, it just didn't do what we needed easily.

    So, I've built a bunch of trees by hand now, and have always edited the vertex normals. However, I like the look of NormalThief.

    Eric, is the red shape (or whatever you're stealing your normals from) just something that you model up to roughly the shape of the canopy? Or is there some other magic involved?

    I'd also like to note that a lot of people when they first start making trees (myself included) tend to make the trunk in some specific shape they want, and then just kind of blob leaf cards all over the place. I think it's equally important to understand the canopy shape of your tree as your trunk shape. Many trees have drastically different canopies, and understanding that can make a big difference in the final look of your tree.

    It can also be important to leave cards out of the center of your canopy. Rather than blobbing them all together, actually building a shape out of your leaf cards, and leaving the central area more open and airy will give many trees a more realistic feel.

    Lastly, I know some people will argue, but learn some botany. Don't just go modeling "a tree," figure out WHAT kind of tree you want, what kind of tree makes sense for the environment you're making. Learn the names of some basic trees, and use those as a foundation for even more fantasy type trees. There are giant differences between oaks, birches, fig, Ceiba, Cedar, Redwood, and many other trees, and understanding some of those differences will really make your trees feel more natural.

    How do you guys generate your leaf cards/frond textures? I've handpainted some, I've fully modeled up high poly leaves/branches and then rendered them down. But I've never really felt like I've gotten anything that looked really good. Any tips/ideas/suggestions on this front?
  • Mark Dygert
    Awesome post Nick!
    Tumerboy wrote: »
    Lastly, I know some people will argue, but learn some botany. Don't just go modeling "a tree," figure out WHAT kind of tree you want, what kind of tree makes sense for the environment you're making.
    Yes, in so many ways yes!
    Know the difference between a well groomed tree and what it will look like out in the wild. Some trees when not properly pruned will have a huge mess of trunks a bit like bamboo. The same tree when properly pruned will have one trunk and be crafted and shaped over time, probably with a bunch of man made knot holes in the trunk. They will remove older lower thicker branches until it gets above human height then they normally are left to go wild with occasionally pruning.

    The more attention the tree gets the crooked the trunk is.
    For example the tree Eric is using has a prominent V to it pretty early on. If one of those branches was pruned earlier the trunk would a lot more straight.

    Trees that sprout tiny thin branches that break off easily often have pretty straight trunks.

    The point I'm driving at, is don't always make the tree you see out front of your neatly groomed office park. Like Nick said get out and get some research. Sometimes if you're lucky the well groomed trees will scatter seeds to areas that are not maintained and you get to see what the wild version looks like. If you live in a barren wasteland its all that much more important to educate yourself because you're way more likely to encounter well groomed trees vs wild versions.

    Arboretums can be good places to find a wide variety of plants and trees and no one freaks out when there's a crazy guy with a camera taking pics.

    Like all things we recreate, the more you know the better it comes out.

    About the cards. I normally start with photos I've taken and heavily paint over the top. With photos you take you get a great deal of control.

    Make friends with a gardener while they're out pruning trees. They often pile branches up on tarps which make great back drops for easy filtering. You can also blue screen branches and leaves on your own or with buddies. Just watch out if you decide to go gorilla pruning, in some places its illegal and even if its not you'll probably be chased out by a rake wielding tree hugger. Again if you live in a barren wasteland... you're kind of S.O.L. and stuck looking at books (which are probably under copyright) and the web (which are probably horrible images, hard to separate and more than likely not owned by you).
  • NAIMA
    Offline / Send Message
    NAIMA polycounter lvl 14
    About how to make the foliage , I have taken oneleaf and I build up out of it the whole branch and subleaves just altering repainting etc ... I guess I can say the whole thing is 99% handmade and 1% photo... but I am not sure of the results anyway ...

    http://img210.imageshack.us/img210/4775/ceibapentandra.jpg

    skip thew shape couse that is older ....
  • Justin Meisse
    Offline / Send Message
    Justin Meisse polycounter lvl 19
    I've just ventured into the world of foliage: for the cards I modeled leaves and branches, rendered out a diffuse, then applied a material with NormalTexMap in the diffuse and rendered out the normal map.
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 11
    For me, I usually start googling a LOT just to find some not 100% good pic but more bad ones for reference, interesting shapes and variety. (As Turnerboy and Vig mentioned, sometime I feel amazed how the same kind of tree can look like, sometime you can say that this two of a same kind are not same kind :)) ) Then start to make trunk..

    This is most important part for me to define it cause it will alter total overall look of tree.. References come handy at this stage to decide which parts to actually model and which can be 3d planes.. Ususlly starting with rough spiky one and adding loops where necessary, always from simpler to more complex shape.. Opposite does not worked for me.

    In parallel I usually prepare 2 separate textures.. 1 for trunk and sometime for leafless branches and second one with leafy branch or two and some dead (or leafless) one.

    After texture is ready I start with slicing and shaping them to look not too flat.. ALWAYS working with triangles.. Here two ways you can go :)) To place main 3d planes branches first or leaf branches first and leafless as second. This varies from tree to tree.
    Right before finish I usually move some vertex here and there in foliage area to stress uniformity and repeating shapes.. If you using large planes this is quite obvious so you should look over this part closer. Try to rotate model as much as possible and review it from angles that you will be looking at it most and concentrate on them little more.

    I work with Unity3D and there is not much candy in vegetation than in crysis.. Normal thief is quite handy tool for more correct shading in engine.

    I saw michi.be vegetation done for crysis and must say some nice pieces there... Maybe he can bring more light into this.. :)
    I'm also interested in bushes and smaller vegetation examples.. Cause this ones are even closer to player..

    Hawk
  • Eric Chadwick
    Tumerboy wrote: »
    Eric, is the red shape (or whatever you're stealing your normals from) just something that you model up to roughly the shape of the canopy? Or is there some other magic involved?
    Right, just modeling a shape that looks like how I want the tree's normals to point. The red shape was not a good one tho, too simple. Normal Thief worked better when I fed it more of a metaball-style shape.
    Tumerboy wrote: »
    How do you guys generate your leaf cards/frond textures? I've handpainted some, I've fully modeled up high poly leaves/branches and then rendered them down. But I've never really felt like I've gotten anything that looked really good. Any tips/ideas/suggestions on this front?
    Photos work well, and hand-painting the alpha has worked better for me than working to remove the fringe I get when photographing against a colored backdrop. Also Crazy Bump makes a decent normal map if needed.

    Experimenting some more now with making a leaved model to bake branch textures. The program Ben Apuna mentioned, tree[d], works great for generating the 3D branch with leaves on it. Just feed it a single leaf, and your bark texture, then mess with some settings, and export an OBJ to Max for rendering.
24
Sign In or Register to comment.