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

GAIA - AAA terrain generator, procedural texturing, planting and scene creation

Discussion in 'Assets and Asset Store' started by AdamGoodrich, May 21, 2015.

  1. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I have a really basic script that controls the intensity and color of a directional light based on it's altitude/rotation. This is quite handy for using in conjunction with Unity's Default Skybox. It's pretty basic, and it currently only affects direct lighting (not ambient, though that would be easy to add). I'll paste the code below and feel free to adapt if you find it useful. Simply save as a .js component and attach it to your scene light and voila!
    Code (CSharp):
    1. #pragma strict
    2.  
    3. var nightIntensity : float = 0.01;
    4. var sunsetDegrees : float = 20.0;
    5. var lightDegrees : float = 10.0;
    6. var dayColor: Color = Color(1.0,0.968,0.933,1.0);
    7. var sunsetColor: Color = Color(0.77,0.33,0.0,1.0);
    8.  
    9. private var lightObject : Light;
    10. private var lightFac : float;
    11. private var sunsetFac : float;
    12.  
    13. function Start () {
    14.     lightObject = gameObject.GetComponent(Light) as Light;
    15. }
    16.  
    17.  
    18. function LateUpdate () {
    19.  
    20.     if (lightObject != null){
    21.  
    22.         //clamp values
    23.         sunsetDegrees = Mathf.Clamp(sunsetDegrees,0.0,90.0);
    24.  
    25.         //find the light factor based on the rotation of the light
    26.         lightFac = transform.eulerAngles.x;
    27.         if (lightFac > 90.0) lightFac = 0.0;
    28.         sunsetFac = Mathf.Clamp01(lightFac / sunsetDegrees);
    29.         lightFac = Mathf.Clamp01(lightFac / lightDegrees);
    30.  
    31.         //set the light intensity
    32.         lightObject.intensity = Mathf.Lerp(nightIntensity,1.0,lightFac);
    33.  
    34.         //clamp the intensity just in case (having a 0.0 intensity can cause un-anticipated lighting problems in Unity)
    35.         if (lightObject.intensity < 0.01) lightObject.intensity = 0.01;
    36.  
    37.         //modulate the light color
    38.         lightObject.color = Color.Lerp(sunsetColor,dayColor,sunsetFac);
    39.  
    40.     }
    41. }
     
    Mr-Logan, AdamGoodrich and kurotatsu like this.
  2. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I have Dynamic sky going.;)

    But will try this as well. Thanks for the contribution.
     
  3. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Thanks Justin, that's awesome. Will convert it to a proper language and integrate it with the work I did yesterday :)

    My beta group knows that I can get a little carried away on adding features, and I think everyone will love the next release ! I haven't put it into my demo project yet and already miss it.

    Biggies for next release so far:

    * A lot of work on usability
    * Composable resources - no more need for just one res file
    * Really beautiful grasses and flowers from turboscalpeur
    * Screenshotting system - because if we didn't see it, it didn't happen!
    * Decent camera setup - great for new comers - instant pretty
    * Simple and vastly better lighting.

    Some people might wonder why the non core features. Its because I want every one to get a good out of the box experience. If you can get a nice environment done, then you can get on with making your game, and focus on where the real value is, which is in the game play. More experienced users will use their own camera and lighting systems.
     
    Mr-Logan, mwituni, Pequisto and 5 others like this.
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    :eek::eek::eek:
     
  5. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Hint hint.. :) Happy birthday !!
     
    smada-luap, Teila and S4G4N like this.
  6. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Gaia can be defined in a single word. Genial

    I never liked the Unity terrain system, so I hardly use the terrain editor.

    Gaia makes the terrain creation much more simple, fast and easy. Who is game designer, this is the tool you need to make your amazing terrains. Gaia brings the creation of terrains to another level.

    Unity developers should implement this tool in their terrain editor.

    A simple feature and easy to implement, and I have not found, it would be the option to reverse the scale of the stamp, only the rotation in some cases is not enough. Of course it gives to flip the image in an external editor, but it would be nice to have more this option.

    Keep up the good work!
     
    S4G4N, kurotatsu and BackwoodsGaming like this.
  7. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Thank you.

    Have you tried inverting the stamp - I think this is what you are asking for.
     
  8. DenisLemos

    DenisLemos

    Joined:
    May 1, 2015
    Posts:
    781
    Sorry I explained wrong. My idea is to reverse the stamp image horizontally and vertically. In some cases only rotate the image is still not enough, because it leaves the image upside down.

    For example this picture:


    When rotated 180 degrees looks like this:


    But in some cases, I wish the picture was as follows:


    If you place a toogle with the option to reverse the stamp horizontally, and other toogle to reverse the stamp vertically I think it would be more practical than edit the image in an external editor.


    [off topic]
    An image of a terrain that I created right now and it took me about five minutes to do, I'm not game designer and I have no practice in creating terrains, but with Gaia I managed to make a realistic terrain with just a few mouse clicks.
    The terrain is still empty, so when I put textures, vegetation and other objects I will bring other images.
     
    Mr-Logan, mwituni, Pequisto and 5 others like this.
  9. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Excellent suggestions, and nice scene, very impressive.
     
    S4G4N and AdamGoodrich like this.
  10. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Ok i understand you... yep will look into it. Would be simple to implement.

    Great shots by the way!!
     
    Mr-Logan and S4G4N like this.
  11. lundon

    lundon

    Joined:
    Nov 6, 2009
    Posts:
    59
    Could you expand on this? How will it work?
    Also, is it a part of the update that went out to your beta testers a couple of days ago, or is it to be in the update after that one?

    (Maybe I also should do the 'long time lurker, first time poster' bit. :) )
     
    S4G4N and kurotatsu like this.
  12. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Hi and welcome :)

    So far only one of the beta testers has the new release. I have expanded the scope since i sent that out and don't want to waste the groups time so it will have to wait a few more days until the latest set of features are completed.

    To answer your question, in Unity when you create a game object you then add scripts to it to give it the functionality it needs. This approach is a composition approach because the new game object is composed of the scripts you are interested in - and each one can be quite independent of the other i.e. the end result is the composition of the parts.

    I am introducing the same concept to Gaia - if you want to mix and match different asset packs with Gaia - perhaps a tree pack, with a house pack and rock pack, then each one can be added independently. Gaia will detect them and then allow you to compose them together into the scene. You as the end user you wont need care about how this is accomplished - it will just work.

    This will allow you to leverage the procedural generation smarts of Gaia with any asset pack that supports it. This support could be provided by you for that asset pack, so that you can leverage it across your scenes and projects, or by the author themselves.

    I am quite excited by this as an approach as it greatly expands the capability of both Gaia and assets that leverage this feature, and I am working with a couple of high quality asset authors to flesh it out. It's going to be super cool!

    If anyone knows any assets packs that could benefit from the procedural power of Gaia then please ask their authors to contact me as i would be happy to collaborate.

    FYI.. there is a bunch more thinking sitting behind this. I will expose more of the planned functionality as it gets closer to release.
     
    Last edited: Nov 23, 2015
  13. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    Adam, the compose functionality addition is brilliant. This actually leads to my next question about tree growth and other assets. Will this work for all tree packs, and not Speed trees only? Do you simply change the tree asset name in the script to make your tree packs work, or do trees added to the resource folder work automatically?

    Thank you for answering my question about reversing the stamp, it seems _7stars was asking the same thing.
    I really appreciate your feedback, and answering every question that comes in. I modded Total War games for years, and spent countless hours on the forums alone :)
     
    AdamGoodrich and S4G4N like this.
  14. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    The tree growth script is a generic growth script, and will work with any game object asset that has a scale. To use it you need to make a new prefab and add the script to it. I haven't featured it yet as it was just something i chucked in because i thought it was sort of cool. There seems to be a lot of interest in it - so i will see what i can to to make it a more seamless thing - e.g. get the spawners to set it up for you automatically.
     
    TheSeawolf and BackwoodsGaming like this.
  15. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    This is the way to go, 'out of the box functionality' it can save people lots of time and also help the less technical.
     
    S4G4N and TheSeawolf like this.
  16. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Hey everyone - check this post out on the 3DForge Exteriors Forum - its a great example of how to set up camera effects and the impact that this can make on the final image.
     
  17. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    I agree as I like many others are on a steep learning curve; I learn by seeing something in practice, being given access to the tools, and then changing and manipulating as I go. Unistorm 2.06 already has this functionality, so I'm looking forward to seeing Adam's script on this too.

    [QUOTE="The tree growth script is a generic growth script, and will work with any game object asset that has a scale. To use it you need to make a new prefab and add the script to it.[/QUOTE]

    Thanks Adam, this is what I was hoping :)
     
  18. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
  19. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    what's a "harry pottery style image" ? I like the screen to gif thing as I've never taken the time to try to learn how to do that, so thanks!
     
  20. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Just thought I would share an update on the new camera and lighting setup - this was done just with GAIA so you wont need to purchase any extra components to get this sort of effect! The images were taken with the new GAIA Screen Shotter component.

    The only external requirement was to include the standard Unity Image effects because GAIA needs them to set the camera up.

    The quality of what you will be able to create just went up orders of magnitude!!

    Eta to completion about a week.

    Grab 2015-11-24 161912 1900x1200.jpg

    Grab 2015-11-24 161444 1900x1200.jpg
     
  21. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    3,213
    Awesome to see the Unity can do this without 3rd party extras.
    I am very sure this will make many users happy.
    Thanks for sharing @AdamGoodrich
     
    Last edited: Nov 24, 2015
    AdamGoodrich likes this.
  22. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Hi Adam,

    I am getting the following error when i try to use Random Location property for grass.

    GUI Window tries to begin rendering while something else has not finished rendering! Either you have a recursive OnGUI rendering, or previous OnGUI did not clean up properly.


    Also I tried reading through the documentation and watched couple of your videos, but couldn't find any instruction on how to avoid grass being spawned on a footpath.
     
    S4G4N likes this.
  23. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    I think the first error is just one within Unity itself and the way it deals with custom inspectors. I don't think there's much to worry about in this case.

    As for the latter one - go into your resources for the grass and where you set slope and height constraints, select the texture option as well and then tell it which texture to avoid - eg !3 (if your path texture is this number) will tell it not to spawn on last texture used in the first block of four that you can assign to the unity terrain (the numbering starts at zero).

    Note that even though you've set this that you could still get the odd grass spawning on your paths owing to the random nature of grass placement and also that the path texture at that point may not be 100% owing to texture blending on the internal terrain splatmap.

    You could also export your path texture out as a mask and use that in the spawner as an area to avoid :)
     
  24. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Is your footpath a texture ?

    If so - lets assume you are using texture slot 5 as your footpath texture (i.e, the 6th texture slot in your terrain).

    To have the grass avoid this when it spawns select the "Check Texture" in your grasses in the resource file - then type !5 in there... or alternatively !<whichever texture slot the footpath is>

    2015-11-24_20-31-36 - Textures.jpg
     
    BackwoodsGaming and S4G4N like this.
  25. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    The error disappeared after deleting treespawner and then reloading it again.Yea I still get odd grass spawning.


    Yes foothpath is a texture. It worked, Thanks.

    I got sandy beach on the same map aswell, and I am trying to avoid grass over the sand texture. I tried adding that aswell to the Matching Texture, but didn't work.

    Is it possible to avoid two textures for grass?
     
    S4G4N likes this.
  26. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Yes - most likely you got the slot wrong - don't put spaces in there either.
     
  27. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    The lighting and camera system really is nice - check the whole set of images on my Facebook page. Why not 'Like' the Facebook page and build it's profile while you are there :)

    These are using the sample 3DForge Village Exteriors buildings, MotuProprio RealRocks, and Turboscalpeur HQ Grasses samples that come with Gaia - no 3rd party asset was used to create these images!!





     
  28. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Yep my bad, got the slot wrong. Working perfect now. Cheers
     
    S4G4N likes this.
  29. LeRan

    LeRan

    Joined:
    Nov 24, 2015
    Posts:
    118
    Hi forum,

    I must admit that Gaia seems to produce outstanding results, and it's indeed extremely tempting :)

    One question though : does Giai allow to generate overhangs in cliffs? The landscape I have in mind wouldn't be the same without extensive rock shelters along rivers. I suppose it boils down to "terrains with a negative normal"?
     
  30. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Jeeze, no lies!
    Sometimes we need to grab him and chain him down to the desk to finish off with what he has, he doesn't go down peacefully either ... kicking and screaming out new code and features he wants to add in the last hour.
     
  31. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Hi,

    No, as its standard Unity (therefore 2d Heightmap based terrains).

    You would need something like ATS or RTP ( I use ATS Colormap Ultra (only $10) which is similar to RTP) .... then you can blend overhang meshes with the terrain.

    Normally if you want to make extensive caves and overhangs, a voxel terrain solution may be a good option too. But you may do ok with meshes and ATS or RTP)
     
  32. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    3,213
    Hi,

    Gaia takes normal Unity Terrain does it magic and gives back normal Unity Terrain
    Overhands is not possible with Normal Unity Terrain, therefore Gaia can not do it either.

    It is a Unity limitation, not a Gaia limitation

    Cheers
    Cobus
     
    Last edited: Nov 24, 2015
  33. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    We can keep him somewhat subdued by showing him screenshots, but that doesn't last long :confused:
     
  34. LeRan

    LeRan

    Joined:
    Nov 24, 2015
    Posts:
    118
    Thank you very much, I will look into that.
     
    mwituni likes this.
  35. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    @chingwa Ignore him :D I've been tempted to get this for quite a while now, and while I also code in C#, if it works 'out of the box' then I'm fine in whatever language it's written in :)
     
    AdamGoodrich likes this.
  36. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    May be true for you, but the fact that it is not in C# is a big reason I am not going to buy it. :)
     
  37. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    I thought you had Suimono?
     
  38. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I do, but at the time there was no competition. There is now. :) And there are several really good weather/time of day assets. Given a choice, I choose C#. Easier for my programmers to work with and to plug in our scripts and other assets.
     
    hopeful likes this.
  39. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    And his famous words during beta.. "It will just take 20 minutes.." Usually that meant a day or two... heheh

    *looks for a new hiding place from Adam* :p
     
    AdamGoodrich and Teila like this.
  40. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    This was my biggest reason for not buying the sky system. I don't have time to learn UnityScript and if I have problems or errors, with C# I can generally troubleshoot them on my own. I bought Suimono because at the time there wasn't competition and @chingwa indicated he was going to do a C# port. But with all the new stuff still coming out UnityScript, now I'm wondering. :( Personally, I kinda wish Unity would just dump UnityScript and Boo all together and standardize with C#.
     
    montyfi and Teila like this.
  41. Daniel-Talis

    Daniel-Talis

    Joined:
    Dec 10, 2011
    Posts:
    425
    Is there a way to stop grass appearing through objects? Having it protrude through spawned rocks, stairs and floors looks very unrealistic.
     
  42. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    I spawn my grasses last and have it set to spawn on virgin ground, meaning nothing is there.. Seems to work ok for me.

    In fact, I've kinda rearranged the whole spawn order. Here is the way I have my spawn group set:

    1 - Ground Textures
    2 - Building spawner (to scope out viable building locations)
    3 - Rocks and other objects
    4 - Trees
    5 - Grasses
     
    AdamGoodrich, Teila, Pequisto and 2 others like this.
  43. Pequisto

    Pequisto

    Joined:
    Apr 21, 2015
    Posts:
    66
    This is exactly the same order I use (except I don't spawn buildings or structures using Gaia... not yet, anyway).

    The only part I'm struggling with at this point is making World Streamer and Gaia play nice together on a large tiled terrain. :(
     
  44. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Yeah.. I only spawn buildings as a rough guide. I usually end up moving them around a bit afterwards to get just the right look and feel, but Gaia give a real nice baseline.

    Not sure on the World Streamer part. Had never heard of it before seeing it mentioned in this thread. And I haven't played with Sectr since early in the Gaia beta cycle. I'm kind of waiting for multi-terrain support in Gaia before screwing around with that stuff. No need to waste energy on figuring out stuff that Gaia may end up doing for me later. But I'm at an early point in my development cycle, so may not need a solution as quickly as others might.
     
  45. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hi. Is it right that all Detail meshes must be vertex lit or the exporter fails to pick them up? and nulls out?

    basically

    Code (csharp):
    1.  
    2. for (idx = 0; idx < terrain.terrainData.detailPrototypes.Length; idx++)
    3. {
    4. terrainDetailProto = terrain.terrainData.detailPrototypes[idx];
    5. if (idx < resourceDetailPrototypes.Count)
    6. {
    7. resourceDetailProto = resourceDetailPrototypes[idx];
    8. }
    9. else
    10. {
    11. resourceDetailProto = new ResourceProtoDetail();
    12. resourceDetailPrototypes.Add(resourceDetailProto);
    13. }
    14.  
    15. resourceDetailProto.m_renderMode = terrainDetailProto.renderMode;
    16. if (terrainDetailProto.renderMode == DetailRenderMode.VertexLit)
    17. {
    18. //This does not cover the use case of grass lit?
    19. resourceDetailProto.m_name = terrainDetailProto.prototype.name;
    20. resourceDetailProto.m_detailProtoype = terrainDetailProto.prototype;
    21. }
    22. else
    23. {
    24. //This does not cover the use case of grass lit?
    25. resourceDetailProto.m_name = terrainDetailProto.prototypeTexture.name;
    26. resourceDetailProto.m_detailTexture = terrainDetailProto.prototypeTexture;
    27. }
    28.  
    not sure if it is by desgin? thanks

    upload_2015-11-24_20-12-24.png

    maybe
     
  46. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Is anybody using GAIA to produce an urban scene? Just wondering if there are any interesting advantages, disadvantages, wrinkles.
     
  47. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Proximity thing works pretty well too. You need to tag your objects and add that tag to the Gaia resources and check the proximity box.
     
    S4G4N, AdamGoodrich and runningbird like this.
  48. FyreDogStudios

    FyreDogStudios

    Joined:
    Aug 23, 2015
    Posts:
    97
    3 minutes, timed myself.

    Screen Shot 2015-11-24 at 21.48.55.png
     
    mwituni, S4G4N, AdamGoodrich and 5 others like this.
  49. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    I need to make a "water" asset purchase to compliment my Gaia terrains. Can anybody offer suggestions as to what the preferable system for ease of use and setup would be? I ask here because Adam has mentioned both Ceto and Suimono.

    Does Ceto actually support rivers and lakes, as it mentions only ocean in the title?
     
    S4G4N likes this.
  50. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    PlayWay Water.(I took Ceto out in favor of this.)
    I'm using Tengoku Dynamic sky, as well in this shot.


    I wish I could get my grass to spawn like your guy's, mine is only spawning sporatically, and around the edges of my island.
     
    ZenMicro, S4G4N, AdamGoodrich and 2 others like this.