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

Procedural Terrain with Dense Forests

Discussion in 'Works In Progress - Archive' started by jc_lvngstn, Jul 1, 2013.

  1. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    [Edit]I asked a mod to change the title to be more accurate. Basically, I am building the terrain mesh from the heightmap data, and have my own system for grass, details and tree placement.
    One of the main goals was that it support distant and dense forests. I think it works very well, see the 2nd or 3rd page.

    I'm finally getting my homemade terrain to the point that it doesn't look like junk.

    $Frikkin Terrain.jpg

    This has been...interesting. You give it a heightmap, and define your custom LOD zones centered around the player, and it generates the terrain. You can see that the more distant mountains are less detailed, while the closer stuff is smoother. For each LOD zone, you determine how detailed it is, and how many "tiles" it is split up into.

    The last bits where matching the seams up well, and also calculating the normals based on the heightmap. Overall...I think it looks nice.

    I still need a good 8+texture splat shader :) The one shown only handles 4.

    Next...grass.
    /wrists
     
    Last edited: Jul 14, 2013
  2. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Been working on drawing grass over the last few days on my terrain mesh.

    $NiceGrass.jpg
     
  3. EverHeartGames

    EverHeartGames

    Joined:
    May 29, 2013
    Posts:
    57
    Looks really good. I can never make terrain look like this.
     
  4. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks. I'm especially proud of it as it's all done procedurally.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    hi there,

    that looks really great, congrats!
    and you have already done half the way.
    but how would you self judge the speed compared to unity’s built in terrain?

    lars
     
  6. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks lars! Right now, it's fast...about 350 fps on my machine, for a very large area of grass. But it's not really a fair comparison, my grass is very simple at the moment. I don't have another project handy that is similar enough, using Unity's terrain and grass, to really compare it.

    Currently, it
    Splits the area into tiles of grass meshes.
    Draws them using Graphics.Drawmesh (I need to add culling, that will help performance). Until then, it draws all of the grass meshes.
    Places the grass very accurately on the terrain, based on the heightmap. No grass above/below the terrain. Finally found a bilinear interpolation function to help me with this, to get exact heights.
    Randomize grass placement and rotation.

    But it's still in pretty early stages.
    I need to make it move with the player (by moving/recalculating meshes on a separate thread).
    Height noise.
    Wind. I am going to have to have wind at some point, based on noise. I just got done looking at your shaders for this, but I'm really not certain how to "plug them in".
    And I'll need to add support for more than one grass type.
    I'd like to add curve support for slopes, so that on steeper slopes you have less grass.
     
  7. Ben-Massey

    Ben-Massey

    Joined:
    Jun 13, 2011
    Posts:
    581
    Sounds good and the grass blending is looking great. How much memory does something like this use to generate during runtime or is this something pre generated?
     
  8. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I created a test scene using the same heightmap, one terrain texture and the same grass. Basically tried to make it mirror my own. Honestly, Unity's seems faster and appears to use less memory. So I either need to do a better comparison that is apples to apples, or I have a lot of tweaking ahead of me :)

    The Unity scene uses about 350 mb, while mine uses about 500. But mine had more terrain textures and a different terrain shader, so again...I need to do a more even comparison.
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    hi jc,
    ;-( what a pitty...

    that seems to be exactly the same way unity draws grass: using huge tiles or chunks.
    and i am not sure if moving the grass with the player will be faster.

    which shader do you use right now? and you might have a look at the advanced grass shader v2 or v3, which should be rather simple to be implemented. all you have to pass to the shader are the wind parameters.

    i hope your system will support custom grass meshes – not only simple planes.
    and it would be great if there was an option to align the mesh to the terrain’s normal (in order to get rid of floating grass on steeper slopes) either for a whole grass type or when painting.

    great work!

    lars
     
  10. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Got the shader working with some very simple wind. I'd love to be able to use a wind zone as input, but I'm not sure how to use one yet for my purposes. I created a simple wind effect just using some lerping, it's pretty rough but at least gives me something for now. Thanks for the great shader lars.


    I also had to toss in the awesome free ocean shader from the forums, it's beautiful. It served as a brief distraction from an annoying issue with reducing grass on steep slopes.
    Here's the ocean picture:

    $Grass and Ocean.jpg


    It will definitely support meshes...the normals are very easy to get from the heightmap. But...I hadn't really even though about releasing it as a nice, clean package on the asset store. I'll have to give that some thought. Also, the system is somewhat tailored to the unique needs of my current main project. Heck, the only reason I started down this road is because Unity's terrain system has some issues I just got tired of seeing.
    But...this may be something I can clean up and make "generalized" enough for mass consumption. Will it ever support painting, or a nice UI? Um not sure. I honestly can't seem to find enough time to scrape up to work on my main project as it is.
     
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    This is looking really nice. One thing that always drove me back to using Unity terrains, even after extensive efforts to program my own, is the automatic tessellation of Unity terrain. This seriously increases the performance of the terrain and I have yet to invest enough effort to explore this for my own projects. Just curious if you have any type of tessellation going on in your terrain? You mention LOD zones in your first post but it's unclear whether these get reevaluated as the player/camera moves closer to the distant (lower) LOD zone... ?
     
  12. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Yes, you can add LOD zones around the player, and as you move the terrain is redrawn.

    It's pretty easy to setup. You pass in the path to the heightmap, and then give it the heightmap size in pixels, the actual terrain size. My example terrain is 2048x2048 pixels.

    You define the LOD zones by telling the terrain how big the zone is, and how "detailed" it is. In the pictures I show, I have the furthest level of detail divided into 16 pixel resolution, 2048 pixels out. The next one in is 8 pixel resolution, from 512 to 128 pixels out. Around the player is an area 128x128 pixels then, at 1 pixel resolution. It's easy to add another LOD. Here's my inititalization

    Code (csharp):
    1.         V2 playerCellPosition = GetPixelPosition(_Player.transform.position);
    2.         _HeightMap = new HeightMap(TerrainPath, 2048);
    3.         _WorldData = new WorldData2(2048, 4, CollisionMesh, MeshCollider, transform, _HeightMap);
    4.         _WorldData.CreateLOD(2048, 16, 256, _DistantTerrainPrefab, _HeightMap, 512, 8);
    5.         _WorldData.CreateLOD(512, 8, 128, _NearTerrainPrefab, _HeightMap, 128, 1);
    6.         _WorldData.CreateLOD(128, 1, 32, _NearTerrainPrefab, _HeightMap, 0, 0);
    7.         _WorldData.GenerateCollisionMesh(playerCellPosition);
    8.  
    9.         _GrassGenerator = new GrassGenerator(128, playerCellPosition, _HeightMap, GrassMaterial, 16, 1024, 4);
    10.  
    11.         _WorldData.Update(playerCellPosition);
    12.         _GrassGenerator.InitializeGrass(playerCellPosition);
    13.  
    14.         _ShiftDetectionDistance = 16; // Half the size of a region from our highest lod.
    15.  
    16.         _Initialized = true;
    17.         _LastShiftPosition = playerCellPosition;
    When you add a LOD using CreateLOD, the first parameter is the outer size in pixels. Then the pixel density. You can specify which prefab (material and renderer) to use for each LOD, above my distant one uses a distant terrain setup (no bumps on the terrain, for example). But the nearer ones do use bump maps for textures.

    LODs are split into patches, for faster processing and keeping the vertex count down. So, the second LOD above is 512x512. It is split into patches, each one 128x128...so the 512x512 lod area is split into 4 patches across and 4 down. Looks something like this:

    $Terrain LODs.jpg

    I circled the lod transitions.

    It generates a local collision mesh, totally independent of the terrain mesh. You determine the radius.

    $CollisionMesh.jpg

    The HeightMap class gives you heightmap based functions...interpolated normals, heights, etc.

    Now...it's still pretty rough imo. I definitely need to add more complexity to the grass...a noise texture for grass noise. And the terrain could definitely use more optimization...even though it gets a very nice framerate as is.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    as far as i know wind zones are only made for the new tree creator shaders and only affect trees which have to be drawn each by each to react correctly to the wind. so i doubt that those would help you on grass rendering.

    as most of us too.

    and there is still another challenging part which are tree billboards… your latest efforts show that you are mostly able to draw mesh trees as fast as the terrain engine but what a lot of people really need is an advanced billboard rendering with correct oriented billboards along the y-axis, and correct dynamic lighting and shading.
    personally i think this is the weakest part of the built in terrain engine as most other issues have already been fixed by third party solutions.
    unfortunately i can’t really help much on this topic because whenever it comes to math,…

    lars
     
  14. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Indeed...I don't know how to solve the billboard issue either. I did some tests with the particle system, that seemed to work well. The billboards are y axis locked...but appear to pivot around the center of the particle, instead of the base of the tree which would require some tweaking. It's not that big a deal, especially at a distance, but if you wanted close billboards you would notice that the trunk didn't always touch the ground in the same place, if you tilted the camera up and down.

    Applying a normal map definitely makes it look better though:
    $Billboard_Norm_1.jpg
    $Billboard_Norm_2.jpg

    Once I have the terrain system where I want it, I'll be putting it to use in my main project, and then I'll turn to the tree/billboard system. If I can't use the particle system, I'll just use figure something else out :|

    Lars, you know a lot more about shaders than I. With a pre-generated noise texture, how hard do you think it would be, when shifting the grass vertices, to sample the noise map and shift the grass by that amount? By providing an offset to the noise texture, you could "move" the wind across the grass by shifting the texture. Another vector could provide the direction that the grass is shifted (the direction of the wind).
     
    Last edited: Jul 6, 2013
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i have never looked that closely into the grass shader but i think you do not have to look up a noise texture in order to get different bending on different clusters of grass.
    in case you have to it would be "just" a texture lookup in the vertex shader – not a big deal but pretty heavy on computation.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    and regarding the billboard issue: i think the c4 engine approach will still be the best!
     
  17. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    What approach specifically? Batching up the quads, or ?
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    creating a depth texture, normal and shadow map for each billboard…
     
  19. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Gotcha.
    Depth and normal are no biggie for me, with CrazyBump. But shadow map...a little trickier.
     
  20. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    JC.... If you haven't noticed... I sent you a PM....
    I really appreciate you work... Both of your threads have made for fine reading...
    And...,
    Lars... as I have said in the past... Much appreciation for your work also...

    I have been continuing my work and I agree with you that the standard Unity Terrain has issues.
    Therefore, I have been working to bypass those issues and use only Terrain Meshes...
    Of course there is a whole new set of issues.
    But, I find that my frame rate has skyrocketed and I can now make all data much higher quality and still run through the web player....

    I found your thread here in an attempt to find a new way to use RunTime/Dynamic Foliage...
    I have also found another fellow attempting what you are working on...
    Here is his link to his Youtube Video...
    http://www.youtube.com/watch?v=0MjSLALAWVA

    Anyways, best of luck in your efforts and thanks...
    :)
     
  21. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    My apologies Paul, I didn't realize I had a PM. Sent you a reply.
     
  22. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Multiple grass support:

    $Flower Variety.jpg
     
  23. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Hey.... Ya got it... Looks absolutely excellent...
    Nice touch with the wild flowers...
    Now... Is it back to the conifers?
     
  24. Max70

    Max70

    Joined:
    Jul 30, 2011
    Posts:
    27
    Very interesting work. I am following this closely :D
     
  25. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    This made me laugh out loud :)

    My wife has been encouraging me not to get swallowed up in nice-to-haves, and get back to the meat of the my project. She knows I could spend a year alone tweaking pines, and still never be happy. Which probably says more about my lack of artistic ability than my determination to get some things right. She has a good point.

    There is still a little way to go. I want to add detail meshes today, and then step back and see where to take it next.
     
  26. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    First (working) results from detail plants:
    $A detail.jpg

    The fps has taken a hit...but mostly because I wanted to show the picture with shadows enabled. Without shadows, FPS is 350+.

    For each patch of vegetation, I create a grass patch made up of combined grass meshes, and a detail patch of combined detail meshes. So, for each vegetation patch, it's all details combined into one mesh.
    The good news is, it appears to run and generate fairly quickly. I plan on offloading the creation to another thread., so that the only thing happening on the main thread is drawing. Should speed things up a little.
    Ok...things I don't like so far:

    I'll have to bake rotation, scaling, and such. Otherwise, they are all the same rotation and scale and that is bland. But, I'm not sure if I can do this on a different thread...might be breaking Unity's rules. If that is the case....FPS will just have to deal :(
    I really need to get culling in, lazy me. It's drawing ALL grass and detail meshes. That's really hitting the poly count and fps, I would think.
    Memory usage seems really high. I need to see what to do about that. In my test, it was up to 1gb. That is not good.
    What else...hmmm. Lars, your wind shader doesn't seem to affect these...which is odd. I don't understand why, but since I am combining the meshes, it would probably look weird anyway.


    So...I guess Unity does the same thing, when it comes to detail meshes. They are baked into patches, which is why you can't have wind with them or it looks weird (the whole patch is affected).

    Honestly...I've got half a mind to just forget this approach, and just use DrawMesh to do it instead. Heck of a lot easier...it just means you see a bunch of drawcalls for each detail mesh. A lot less of a setup hassle. Maybe for most people, they don't -need- a bazillion detail meshes in the scene. Culling and a shorter draw distance could cut a lot of them out.

    Gonna think on it tonight. But I really am having second thoughts about this approach. Any thoughts or suggestions from you all are very welcome.
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    would it not be enough to create the meshes for the different patches only one on start?
    that sounds not too complicated if you stick with patches.

    first it needs a wind input that is currently generated by the terrain engine and passed as global var to the shader.
    you will have to do that manually if you do not use the built in system.
    second: unity’s built in shaders do produce such weird "movement" of detail meshes but it is rather simple to get this fixed by controlling the amount of displacement by either the uv coordinate (a second uv set would be needed to control bending for more complex meshes) or using vertex colors – which is the way i have chosen for my latest version as it is pretty easy to apply by artist and gives you the possibility to also add dry and healthy colors end even ambient occlusion in case you can not bake it into the texture.

    pretty complex detail mesh bending in the wind:

    $Bildschirmfoto 2013-07-08 um 09.19.17.png

    ups, that sounds as if it would kill the framerate. just give it another try!

    lars
     
  28. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Great work, following this with keen interest :)
    Sounds like our wives have something in common, haha!
     
  29. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Do you mean use one mesh for all patches, and just duplicate it from then on? Not sure I follow the question.

    I'll get the culling in, and using vertex colors for wind. I'll apply them based on distance, just to get a simple result.

    So...today looks like mostly getting details working well, and optimization/polish.

    Thanks!
     
    Last edited: Jul 8, 2013
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    one combined mesh for EACH patch and then cull the patches due to their distance.
    so each visible patch forces one draw call.
     
  31. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Well, I am creating two meshes per patch. One for the grass, and one for the details. I wanted to separate them, to avoid the 65k vertex limit, and it also gives me a little more control over details vs grass.

    On the side: I'm having some trouble with culling the grass meshes. For some reason this test completely fails, and no grass is drawn at all.

    Code (csharp):
    1. var planes = GeometryUtility.CalculateFrustumPlanes(Camera.main);
    2. if (GeometryUtility.TestPlanesAABB(planes,_GrassMeshData.Mesh.bounds))
    3. {
    4.     Graphics.DrawMesh(_GrassMeshData.Mesh, _LocalPosition, Quaternion.identity, _GrassMaterial, 0, Camera.main, 0, null, false, true);
    5. }
    Any thoughts on this? It's a simple test, I just don't understand why it is failing. According to the docs, the bounds for the mesh are local coordinates...though, I don't see how that really works since at that point, the bounds check doesn't know the world coordinates for them.

    I recreated the bounds to be in world space, but it still failed. I am calling Mesh.RecalculateBounds() before drawing. And I verified the bounds look legit, here are an example of one of the patches drawn nearby:

    Center: (3.7, 1.0, 3.9), Extents: (5.2, 2.8, 5.4)


    [Edit] Ok I think I get it. I need to test against the renderer bounds. Since I have none (using Graphics.DrawMesh), I will must have not translated properly to world space. I'll revisit that.

    [Edit again] That did it, I must have positioned it wrong. Working now!
     
    Last edited: Jul 8, 2013
  32. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Ok, Texture2D.PackTextures scales the textures in some cases, even if they fit. So the proportions are wrong. I have to figure out how to account for that when I combine the meshes by multiplying by a scale factor depending on which mesh I am working with. I am surprised there is no option to keep the original texture scale grrrrr.

    Maybe time to hit the asset store. I know that there are some texture packer alternatives out there.
     
  33. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    So it turns out baking rotation/scale was easy. As was getting the correct uv/texture proportions from PackTexture.

    $Rotated Scaled Multiple Details.jpg

    Things that remain:
    Wind support.
    Possibly combine grass and detail mesh...they really aren't using many polygons, IF you break up the patches small enough.
    Separate the details functionality into a different script.
    Move the patch mesh creation to another thread.
    Create a nice inspector UI.

    I did some tests with combining them into one mesh. It is certainly doable, but it also means that I have to create one texture atlas that holds all grass AND detail textures. I'm worried about this impact this would have on variety and detail. I'm not creating a super advanced engine that will juggle multiple atlases, so I'm planning on just having a mesh for grass (with its own texture atlas of grasses) and a separate mesh for details, with its own dedicated atlas.
    This will allow more details grass AND details, which I prefer :)

    Also, lars...with using vertex colors for wind, doesn't this limit what shaders people can use? At some point it would be nice to have different tints for the grass or details, and seems like if I use the vertex colors for wind I won't get to use them for tinting or ambient occlusion (if I add that, which is not really likely).

    Would it be better to use the second set of uv coordinates for this?
     
  34. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I'm going to have to put threading on hold...at least for detail meshes. Too many of Unity's functions are not thread safe. I'd have to create replacement Quaternion and Matrix functions, and I'm just not doing it now. I don't even know if Vector3 is usable.

    I have no idea why those are not usable outside Unity's main thread, I don't see why they should be.
    So...for now, I'll focus on overall performance outside of threading, and making the overall code much more clean and presentable.
     
  35. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Some minor improvements in speed and quality.

    $Detail Fun.jpg


    I half expect UT to come and say something about using up their imaging storage, for the forums :)
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    using the 2nd uv AND vertex colors will add a lot of extra data which has to be passed to the gpu. so i just would go with vertex colors.
    use alpha for bending. it would be nice to have it for ambient occlusion though but that can also be baked into rbg – and the color variation will be added on top. that is the way i do in the latest grass shader and it works perfectly.

    lars
     
  37. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I keep forgetting about poor alpha. Thanks, Lars.
     
  38. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    So, I didn't get multithreading in...but I got the next best thing.
    When a new grass patch needs to be created, it queues it up. Instead of processing all patches at once (which caused a fps spike), instead it processes them one at a time, every 10 ms. This way there is no noticable spike.
    Works very will, I think.
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    you are welcome ;-)
     
  40. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Last edited: Jul 13, 2013
  41. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Here the player is in the middle of 4 square km of trees, somewhat dense.
    $IHasTrees5.jpg
     
  42. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    And another...VERY dense, pine and maple trees, high distance.

    $IHasTrees6.jpg
     
  43. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    ok, one more post (for a while at least).
    6 square km of trees, with the player at the center. Fairly dense.

    $IHasTrees7.jpg

    As far as I am concerned, this pretty much makes trees visible about as far as you can realistically see. Now, it uses a lot of memory...all those vertexes you know. The editor about chokes. But running it outside the editor may be a very different matter. This scene has about 3 million triangles.

    Honestly...I wish we could use half floats for vertex information. This is a wonderful example of how it could save memory.
    You can do some things like using slighting larger trees (makes it seem denser than it really is).
     
    Last edited: Jul 13, 2013
  44. mescalin

    mescalin

    Joined:
    Dec 19, 2012
    Posts:
    67
    this is really cool, i am obsessed with procedural generation but have never done terrain i am working on mazes atm


    may i ask, does it go on forever or do you have to render a certain area?

    also are textures deployed procedurally?
     
  45. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Right now, I pass it the path to my heightmap, and it reads everything from there into memory. So...it could easily be made to work with perlin noise aka minecraft.

    For this test project, I'm just using a traditional 4 splat terrain shader, so the textures for the terrain aren't really procedural.
     
  46. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Wow, a terrain like this will create fascinating gameplay. This is awesome.
     
  47. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Four picture taken for a wannabe panoramic view:

    $Pan1.jpg
    $pan2.jpg
    $pan3.jpg
    $pan4.jpg

    You can see more detail if you open them in a separate tab.
     
  48. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Is it weird to have grass that matches the terrain slope? Or should it be just grass, and not flowers (an option per grass)?

    $SlopedGrass.jpg
     
  49. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    JC...
    Thanks for the PM... Yes I needed to get back here and check out how you are doing....
    One thing for sure, you are a good coder... And another... You have good people following you....
    Dam.... I'm thinking you got it nailed down.... Sweet... It looks so good, I can darn near smell those flowers...
    I don't really care for the shots with the big or small ferns. though..
    The last couple with those pics with the sweet flowers are excellent... Looks very similar to a Fiord I visited in Finnmark Norway...
    There is only one thing that bugs me a bit... It looks like you have set the standard fog shader from "Edit / Render settings"
    But the sky has no fog to match the terrain fog... If you have the pro version you might want to add the Pro image effects fog...
    If you get both of those fog systems working together... Bam !
    Now... for the trees....
    Looks awesome....
    I don't know when I've seen anyone pull off what you have pulled off...
    I have never managed such a huge amount of trees and fauna as I have lots of other data in my projects
    Getting it all to run through that piece of crap Internet Explorer, which most people use, seems to be the trick.
    I have my work running right inside Facebook too. So combining IE and Facebook the project has to be very clean...
    I am presently working on a system similar to yours and I have some other concepts I'd like to try too....
    My problem is that I'm a lousy coder.... My main gig is creating the terrain system.... 8 years of R&D and counting...
    I started with 3dGS and switched to Unity just a couple of years ago.... So, I am still trying to get caught up to where I was with 3dGS...
    Your tree system looks excellent... Can it be used with multiple terrains?
    My newest Whistler project (Not yet publicly available.) has over 200 terrain meshes.
    If you want... I can make a full copy available to you to experiment with... I wouldn't mind seeing my huge project with your fauna system combined...
    Maybe... Just Maybe... It's time for a meeting of the minds... And a mingling of systems...
    Anyways, per your funny comment from before.........
    Thank God for the fact that he/she has the GREATEST sense of humor for he/she has made someone for everyone...
    I imagine both our wives are quite similar.... Great to have support and one who dreams as we do...
    I appreciate yours... as I do mine... Well... not quite as much...
    Keep going and thanks for the awesome up-date pics...
    :)

    Edit:
    By the way... If you look at the "About" page on my web site, (Link Below), you will see a pic from my latest Whistler project and you will notice the combination of the two Fog Shaders and how well they work together.
    Just a suggestion...
    http://www.terrasame.com/About_TerraSame.htm
     
    Last edited: Jul 15, 2013
  50. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks! Yeah, I know about the fog...I was mostly working on the landscape side of things, and just tossed the free fog in there. Yours looks much more realistic :)

    Right now the system creates the terrain from a heightmap, but it's really all just numbers wherever it comes from.
    The trees are generated separately from the terrain and grass, they just reference the heightmap and pull numbers from there. The heightmap provides height and normal data given world coordinates. So your system, however it holds the height information in memory, would have to be able to provide that information for the tree system.

    The terrain system used a somewhat brute force approach to LOD...your system probably uses a much more refined approach :)