Search Unity

3D Terrain?

Discussion in 'Formats & External Tools' started by Lallander, Apr 30, 2006.

  1. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Ok, I am trying to make a few decent terrain maps. I've tried it in Blender with some decent results. So basically what I would like to know is this. Could someone post some hints and maybe a screenshot/example of how to do it well in Blender, or is there a free or relatively cheap tool that people here like to use for terrain generation?
     
  2. greenland

    greenland

    Joined:
    Oct 22, 2005
    Posts:
    205
  3. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Listed for non-commercial use only :(

    Next!
     
  4. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Is it really necessary that you use a terrain map?

    In blender you cant really do this but in maya the mesh paint tools are great for this. You just drag a push or pull brush across the mesh and in no time you can create mountains, valleys, ect.

    Bill
     
  5. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    For the record "Me no understand tech talk for 3d stuffage."

    I just want to make terrain. And I don't have the kind of money to get Maya :p

    Editing a giant mesh to do so in Blender is a bit tough, so I was hoping someone here might have some tips, or an app designed for it. I tried out terragen, not sure how you are supposed to import it into Unity, and of course that whole for non commercial use thing.
     
  6. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Well you should go with blender then, are you using that system of making a greyscale which pushes or pulls the verts a certain distance?
     
  7. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Nope, no idea what that is. I am new to Blender as well, but it's free :D and fairly easy so far for me to grasp.
     
  8. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    So by that do you mean like greyscale maps? or actually making a 3D terrain? If it's a actual 3D mesh terrain whats the method your using to make it?

    Do you have AIM? It's easyer to have a conversation on that. ;)
     
  9. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Grabbing the verts by hand and using the proportional edit function. It is a royal pain in the ass.
     
  10. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Lall I hope that works well for you, for any one else who wants to know how to do terrains with a hieght map, this seems to be a good tut. Check it out

    Bill
     
  11. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Except that whole not working thing it's awesome :D
     
  12. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Anyone else have any ideas?
     
  13. greenland

    greenland

    Joined:
    Oct 22, 2005
    Posts:
    205
    Unless you register for $99.

    You can try it out. If you make a killer app and want to distribute it, drop the cash.
     
  14. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Oh didn't know it had a register option yet.

    How do you go about importing the file?
     
  15. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Well, keep working on it. So will I. We will master the beast.

    Bill
     
  16. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    I've mostly figured it out in blender, but I keep getting stuck at the bit where you actually deform the mesh. I end up with a little island in the middle and then nothing. It does seem to follow the height map I uploaded but on a really small scale. When I render it theres this little bump in the center and the texture renders properly.
     
  17. socksy

    socksy

    Joined:
    May 21, 2005
    Posts:
    244
    I find the quickest and easiest way to make cool looking landscapes in blender is to get a plane; subdivide it as many times as you want detail/size; turn on proportional fall off; and just grab vertices up and down. Proportional fall off has several options on how the surrounding vertices are affected - sharp, smooth, round, curved etc. And, whilst dragging you get a circle showing how many vertices around are going to be affected in the first place.

    Summarised:
    • Make plane
    • Subdivide plane several times
    • Turn on Proportional fall off
    • Grab vertices and drag up and down

    Easy!
     
  18. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    But very time consuming and tedious for large terrains.
    It is a shame there isn't a tool to just drag over the verts to raise or lower them.

    I am close with this height map crap. I just can't figure out why it's behaving the way it is. Instead of morphing the whole mesh now it is only doing a little piece in the center. I doubt this is it, but I will be doing a test in a few minutes to see if the image resolution has something to do with it.
     
  19. socksy

    socksy

    Joined:
    May 21, 2005
    Posts:
    244
    I've made terrains in just under a minute with that technique. The time consuming bit is texturing, which isn't really solved with the other stuff.
    Perhaps if you use vertex weighting, and have a high mesh and a low mesh you could just brush over the low mesh to get closer to the high mesh. Basically, what you described...

    http://orange.blender.org/blog/the-amazing-incredible-monkey-brush
     
  20. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    If I can actually figure out how to do that then yes this would be ideal.

    Well I would still love the exactitude of painting the terrain, but that would still work out very smoothly.
     
  21. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Woot!

    I now have the ability to make terrain. This makes some damn spiffy looking stuff as well. No idea how to do it from a default setting so I just modded that "monkeybrush" file.

    Just something I threw together real quick. Picture taken inside Blender, but it imports no problem.
     
  22. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    If you have access to a PC, this will be the best $30 you have ever invested:
    www.freeworld.org
     
  23. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Uh, that doesnt go any where?

    Bill
     
  24. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi,

    I think that IslandDreamer wants to say www.freeworld3d.org.

    But, how do you use it with Maya?
    IslandDreamer can you give me a guide?

    Thank you in advance
     
  25. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    Oops. Sorry about the wrong address!

    I haven't used Freeworld3D with Maya, but you can export the terrains you create as either an OBJ or a height map.
     
  26. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi,
    IslandDreamer, how do you use the height map on Maya?

    Thank you in advance
     
  27. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    Windows only, we don't need ya :p

    I think this new technique through Blender works quite well enough. It would be nice to automatically texture the terrain, but that's not that big a deal.
     
  28. islanddreamer

    islanddreamer

    Joined:
    Apr 29, 2006
    Posts:
    473
    Sorry; I'm not a Maya expert. Many game engines (like Ogre, 3D Gamestudio, Beyond Virtual) read heightmaps to generate terrains.

    Lallander, I just crossed over to Mac side just to run Unity. With the Intel Macs and Boot Camp, I suspect more and more people will be bouncing back and forth between the two platforms on the same machine.
     
  29. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    I dont, I thought you the hard drive was partitioned and you couldnt view osx files on the window side and vise versa? Is that right or have I lost it (again).

    Bill
     
  30. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    You can read the other partition as a seperate drive from either side.
     
  31. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Oh well never mind.

    Bill
     
  32. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi,

    In order to see/write on the other partition you have to format it on fat32, if you have ntfs, you obtain read permision only.

    But I read that the boot camp is for time limited, do you know when that ends?

    Or, if I missunderstood, Can I use it forever?

    Thank you in advance
     
  33. Lallander

    Lallander

    Joined:
    Apr 23, 2006
    Posts:
    429
    All I know is that BootCamp is still in Beta. That might be true about the different formating hrmm. Anywho I wouldn't touch BootCamp at all till they get some of the bugs worked out, not that I care about running it at all.
     
  34. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    And some of us still work on PPC Macs/won't buy Windows at gunpoint, so it would be nice if the discussion left at least something for the lowest common denominator.
     
  35. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20
    *beats a dead thread into the ground*

    Am I to understand that Unity doesn't support Heightmaps? I could swear I heard someone reliable (Nicholas) mention that heightmaps were treated like bumpmaps. I still have yet to see that work, (or any heightmap-like function work) in Unity. I have seen that an import setting can turn a greyscale heightmap into a normal map, but that's about it. ...have never seen that turn into a 3d surface of any kind...

    Could someone settle this? I'm sure some of us would rather spend 10 minutes in L3DT than spend 10 hours in 3DSMax just to create tests or random land...

    Heightmaps? Anyone? Have I lost my mind?
     
  36. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Procedual Examples folder...
    AC
     
  37. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's a matter of reading the heightmap and generating the 3D object using the mesh programming interface. One of the procedural examples (from this page) even has code that does exactly that, so all you have to do is use or adapt that code.

    Edit: Ooh, posting at the same time is fun!

    --Eric
     
  38. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20
    DORR!!!!
    Thanks guys!
     
  39. hsparra

    hsparra

    Joined:
    Jul 12, 2005
    Posts:
    750
  40. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20
    Alright... Obviously Heightmaps are possible in Unity, and are probably easy to do for every other normal human being, but after two days of trying everything I can, I still cannot seem to make a heightmapped mesh from a greyscale heightmap.

    Here's what I'm doing.. I open a new project, import the generate heightmap script from the procedurals folder found online, and attempt to apply it to anything, just to try to duplicate what happens in the generateheightmaps.unity project. I've tried applying it to an "empty", to a plane, to a cube to other meshes... I looked at the script to see what I could be missing, but I just can't seem to figure it out. So what's the secret? Does anyone know how to use this script, or just how to make a heightmapped mesh?
     
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yep, you apply the script to an empty, and it generates the mesh from a heightmap wherever the empty happens to be located. You have to drag a heightmap onto the "Height Map" slot on the script, and give it a material. You can also change the size by changing the appropriate variables. Are you getting any error messages?

    --Eric
     
  42. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Any luck?
    Now what about this...I have heard that big titles/studios use procedural terrains for their games, probably because of performance. Is this true? has anyone reading this been part of a commercial title that has done so? If so, my question is this: How do you position other objects in 3d space when you dont have a reference for its transform .position? Id like to use this heightmap method, and find out how to make it generate procedurally, endlessly, but if you cant see it, its hard to work with, unless things just drop randomly into the level...

    Thanks for feedback
    AC
     
  43. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Most high-end games don't procedurally generate their worlds. They have artists for that (and lots of them)

    They might use procedurals for smaller details (where are there bushes in this forest), but they don't wanna lose the ability to level-design.
     
  44. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Raycasting...see where the ray intersects the mesh and put your object there.

    --Eric
     
  45. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20

    Yes. I am getting error messages when I try to apply the script to an empty. I am glad to hear you confirm that workflow; I thought that was how it went! What happens is an error message pops up telling me that I cannot apply the script to the empty because "you need to fix all compile errors in all scripts first". This is happening in a new project with only a point light and basic camera added. hmmm...

    On another new project, the script would not apply to the empty. I renamed the object from "game object" to "empty" it allowed me to apply it. YAY! Now to get a mesh collider to work! Harumph!

    Maybe I should stick with trying to build the mesh in a 3D app...

    Nicholas, you and your darned work ethics! I believe you when you say the way others do it is with artists, and I believe that's ultimately the best way to do it for those that have that ability. The cool thing is in some world builder apps that only generate heightmaps and textures, you can still have a pretty fine detail of control of how the maps end up being laid out. My ultimate goal in all this mayhem is to figure out how to actually use what those cats offer (Freeworld, L3DT, DeleD, etc...). If their programs are actually useful in Unity, that might make some goals happen much more quickly for some...

    There might be some major thing I'm overlooking here, too. So far, I haven't gotten past the basics yet, though (e.g. collider on the heightmap generated mesh, etc...).
     
  46. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    BPM_This is what I used. Worked ok
    Code (csharp):
    1. var myMesh: GameObject;
    2. var delayCollider = 5.0;
    3. function Start () {
    4. yield WaitForSeconds(delayCollider);
    5. myMesh.AddComponent ("MeshCollider");
    6. }
    So whats the local"beginners guide to raycasting"?

    AC
     
  47. BigPowerfulMedia

    BigPowerfulMedia

    Joined:
    Oct 26, 2006
    Posts:
    20
    Targos,
    You are a wonderful human being. May you be blessed with 30 large children. Thank you!

    Are you assigning the "empty" game object (that has the heightmap generator Script attached) as the 'myMesh' variable? If so, I experience a lockup whenever the delay collider timer gets to zero.


    ---UPDATE---
    I've discovered that the heightmap has a size limit. (512x512 I think) *smacks forehead* It works if under that limit, but a collider on a procedural mesh really seems to make things slow. It's weird; I always thought procedurals would be easier on a system than imported mesh terrain...
     
  48. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Why should they be easier? Procedurals are usually smaller for storage; but take more time to initialize, and possibly have less optimizations applied (for stored content you can optimize it when building the game; for procedural you'd have to do optimization at initialization time... which can be too slow).
     
  49. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Probably easiest just to put a "gameObject.AddComponent ("MeshCollider");" as the last line in the HeightmapGenerator script if you just want the mesh to have a collider. No need for a delay (unless you want one for some reason).

    It's not so much that the heightmap has a size limit as much as the generated mesh does...65,536 vertices is the max. Which, by the way, is freakin' huge and will take a LONG time to generate a mesh collider if you give it one. Generally you want to keep your objects down to a few K polygons. Even then it will probably take a few seconds to make the mesh collider.

    If you build a terrain in a 3D program, the mesh collider is built once, when imported, and from then on it doesn't need to be built again. Whereas procedural terrain has to build the mesh collider every time you run it. Which is not to say that procedural doesn't have uses, because of course it does, but it's really easy and quick to build terrain in a 3D program.

    --Eric
     
  50. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I've been following this thread and it's sparked an idea that may be possible with Unity:

    There's another sample project (I believe it's also in the "Procedural Examples" folder) that allows the user to paint onto a texture. I wonder if somehow that script might be used with this script to allow the user to create their own terrains? If so, how would they save and re-load their new terrains?

    Also, following Eric's comment above, is there a way to have the mesh and its collider processed only once for a procedural mesh?