Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

foliage without terrain?

Discussion in 'Editor & General Support' started by dr. stupid, Nov 22, 2009.

  1. dr. stupid

    dr. stupid

    Joined:
    Nov 15, 2009
    Posts:
    69
    i often find terrains very limiting. it's hard to do stuff like nice roads and caves.

    can unity's efficient foliage system be used without terrains but with normal level geometry?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No you can't use it without terrains (also its the terrain that makes it that efficient)
     
  3. Gaiyamato

    Gaiyamato

    Joined:
    Nov 19, 2009
    Posts:
    95
    Can you make a custom terrain? Say a hex or circle shape? The default Unity Terrain, while efficient is a real pain.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No, the terrain is heightmap based.

    The best you can do is seriously lower the "uninteresting parts" and hide them either through a mesh that cuts through above or water
     
  5. Gaiyamato

    Gaiyamato

    Joined:
    Nov 19, 2009
    Posts:
    95
    No good to me.
    I guess I'll be doing my trees the old fashioned inneficient way then. :p
     
  6. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    You can use heightmaps to create a custom terrain. I made one out of text with some gradients on it once.

    It can be tricky to use heightmaps though. That one worked perfectly but a later one went haywire. Might have been discrepancies over the sizes.

    There's a bit about hightmaps somewhere in the manual.
     
  7. Gaiyamato

    Gaiyamato

    Joined:
    Nov 19, 2009
    Posts:
    95
    I actually just need a perfectly flat plane that I can place trees and other terrain objects on without issues. Everytime I have tried I get a "No Terrain Object" error, even using custom height-maps (and everything else we tried under the sun).
    In both 2.5.1f5 Pro and 2.6 Indie.

    We had an entire unit of around 30 students and the course supervisor attempt to get Unity terrain working properly with custom objects (as well as a few other items), but no one succeeded using custom height-maps. Only using the default square plane in Unity could it work and most of our models failed to render at all. In the end only trees made in Maya or at least imported into Maya then re-exported and placed on a default Terrain object would even render.

    We also found that if you do NOT place trees using Terrain then after about 20/30 of them your FPS drops below 10 and Unity Editor often crashes. Both Mac and Windows. Mind you the trees actually render if you use another 3D modelling tool than Maya. lol.

    So yeah, this is one area Unity really needs to fix.
    Custom Terrains and/or better handling of a simple low polygon tree need to work. Even Panda3D can do those things relatively easily. :p

    If I could get a flat hex-shaped plane as my Terrain Object and then using the Terrain place trees on it which will work as awesomely as they do in Unity on Terrain objects, then that would be awesome.

    EDIT: Also as usual the Manual and Docs are near useless.
    I think that whoever is writing them is suffering from the issue that a lot of Doc writers do. They know the program inside out and back to front, and assume that people will know things which even experienced Game Developers may not be able to figure out about the quirks of the Unity engine. They also seem to assume that Unity works and is virtually bug free. At least a handful do. Trying to convince people that Unity has some bugs has proven to be a major nightmare, though oddly (maybe not?), not so hard here on the forums or with official Unity developers. lol.
    Maybe time for some forum traulling...

    EDIT #2: Also I don't want to come across like I am bashing anyone or the engine here.. just got a few gripes. By the standard for low cost/free Game Engines Unity is easily the best around, heck it is damn good by a lot of the expensive engines. These issues occur everywhere. Long Live Unity!! :)
     
  8. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    I think there is a tree placing bug in 2.6. I think it's known and Unity are working on it. Have a search.

    To use custom trees there are certain things you must do. You have to use the correct shaders and put them in the correct folder. There is documentation on Unitys site about it. I have done it with C4D using Unitys documentation and it worked fine but this was 2.5.

    I actually think Unity has the best documentation of any game engine I've looked at. It's better than most programs altogether in fact. But it does take a little while to find your way about. Have a good read through the manual and try some of their tutorials.
     
  9. Gaiyamato

    Gaiyamato

    Joined:
    Nov 19, 2009
    Posts:
    95
    I agree with you there on all points, rather sadly on the docs issue.
    I think C4D work really well with unity.
    But I cannot afford it. lol.

    The issues were mostly with open source 3D tools, so perhaps it is more them than Unity. But still the lack of detail in some of the docs is a pain. Most of our issues were in Unity 2.5 actually. 2.6 seems to work really well.
     
  10. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    Terrains are tricky but not broken. If you are having trouble importing a heightmap, you can make a new terrain and sculpt it in Unity (a perfectly tolerable method for student projects).

    If you are having trouble with trees, they must be made according to the specs in the documentation and wiki tutorials. That is, one mesh, two materials. Trees in FBX format (such as Cheetah 3D creates) work just fine. Check out the way the trees provided in the Island demo and on the wiki are constructed.

    I will not defend the documentation except to say it's better than it used to be, and the forums and wiki do a reasonable job of filling in many of the blanks. Dissecting a sample project like the Island Demo is also essential.

    But the terrain system is working pretty well in spite of limitations that people regularly point out. The terrain rendering in 2.6 is in fact much, much faster, and we've seen a significant performance gain on low-end graphic cards with quite large, complex terrains.
     
  11. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    I've imported custom trees perfectly hapilly.

    file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/terrain-Trees.html

    "Creating Trees
    Every tree should consist of a single mesh with two Materials. One for the trunk and one for the leaves. For performance reasons, triangle count should be kept below 2000 for an average tree. The fewer triangles the better. The pivot point of the tree mesh must be exactly at the root of the tree, that is at the point where the tree should meet the surface it is placed on. This makes it the easiest to import into Unity and other modelling applications.

    Trees must use the Nature/Soft Occlusion Leaves and Nature/Soft Occlusion Bark shader. In order to use those shaders you also have to place the tree in a special folder that contains the name "Ambient-Occlusion". When you place a model in that folder and reimport it, Unity will calculate soft ambient occlusion specialized for trees. The "Nature/Soft Occlusion" shaders need this information. If you don't follow the naming conventions the tree will look weird with completely black parts.

    Unity also ships with several high quality trees in the "Terrain Demo.unitypackage". You can use those trees readily in your game. Even if you don't want to use the builtin trees, we strongly recommend that you take a look at those trees as an example on how to model trees."
     
  12. Gaiyamato

    Gaiyamato

    Joined:
    Nov 19, 2009
    Posts:
    95
    Yes you are right, this is what I do right now and it makes great Terrain.
    Just that I needed a hex-shaped Terrain object for a specific game idea I was trying and could not get it to work.

    I actually have the same problem with the palm tree from the island demo. If I try to render it outside of the Terrain object it lags unity.

    The forums are great and the people on here are extremely useful. :)
    Unify wiki is awesome as well.

    2.6 kicks ass. I need to do more work with Terrain in 2.6
    Like I said before. 2.5 was where I had most of my issues, 2.5.1 solved some of them and 2.6 solved a lot more. But I still cannot get a custom Terrain to work, it just tells me "No Terrain Object".

    Yes, to avoid problems those are what I use for now.
    They do the job fine.