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

Assets [WIP][Sept 16th] Terrafirma - An Auxiliary Terrain Engine Replacement and Extraction Toolset

Discussion in 'Works In Progress - Archive' started by Murpenstien, Dec 31, 2016.

Thread Status:
Not open for further replies.
  1. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks for the info, Murpenstein. Please don't let my requests for more details sidetrack you into something, I'll never hear the end of it if it slows down release :)
     
  2. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    It's no issue at all. The more feed back I receive the better I can make this asset. :) Honestly now that the foundation is there I'm not sure as of now what sticks could really be thrown into the dev process that would really deter things dramatically, lol. xD


    Would just like to report that I'm basically done, as of now I'm prepping the everything for first release. (Demos, Docs and finalizing the interface design.)

    Interface (Not Finalized; But almost!)


    There's two settings missing from the distance tree. Max level per partition and the compression factor for each partition. Aside from that this is the near final product of the mesh generation portion of the interface. Im adding a few things into the editor today so it a bit messy. Ill show that off tomorrow most likely.

    Would also like to mention there's a few more options I have mentioned I recently added. For example there's now a height mask. Patches where all heights are below a certain level will be culled. Say under the ocean. I'm also adding in an interface as well for selective patch culling to as well. Basically you'll be able to select patches you don't want to be processed/render say under the footing of a complex.

    LODs now function in the editor and can be previewed relative to the selected camera in the scene hierarchy. If no camera is selected it will fall back to the scene view display. I figure this will be useful for fine tuning tuning things visually.

    There's a few more thing's, I'll outline everything better either today or tomorrow, in-regards to testing and release, just been really busy.

    Last note however I figure release will come in the next week or two max. :) Essentially revising the final draft as of now and writing the docs.
     
  3. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Wow, looks really good! :)
     
    Murpenstien likes this.
  4. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Late to the game as usual XD
    Is there any talk of terrain holes suitable for cave entrances, cellars, and the like? Apologies if I've missed it being mentioned.
     
  5. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Seems to me that if it is a mesh, you can easily make your own holes. :)
     
  6. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Lol, hi! Yah at some point the system will support tunneling caves, ect. Just not at release. I'm planning on adding on object with terrain blending material support at first while i integrate texture array stuff for displacement and non displacement mapped materials along with a voxel modeler as a supplement though. It's on the list of things to do while I finish up the vegetation system. So i'll be focusing my entire attention on all of that stuff in pieces in periodic releases. Most of the functionality needed to support those features you mentioned though should be possible soon after release actually as I'm going to be prioritizing the remainder of the terrain mesh stuff ( before full voxel terrain).

    Update :

    Release Stuff :

    All the interfacing in-terms of connecting the system to the GUI is 99% complete. Brushes are now layer-able, so you can stack as many brush as you wish with control over each specific layers contribution to the brush used to edit the scene.

    The 1 % is in regard to erosion and noise brush layers.

    These functions can be either painted or applied over the entire terrain in iterations. When painted it will use the layered brush or un-layered brush as a mask. I have my own functions already, I'm also adding interfacing for using your own scripts and functions as well.

    Once i finish that up which I figure will be with-in a few hours today, I'm going to begin working on the documents and finishing up some stuff on the back end. Visually i'll also be finalizing the user interface, so as of now everything is subject to change. I figure for display purposes in the documentation everything is finished enough to head in hard.

    I'm also admit-ably only part way (70%) through neighbor terrain support. So i'll be finishing that up as I complete the docs as well. Ended up rewriting some stuff in relation and need to clean it up.

    Essentially though I'm going to use the documentation as a way of check listing and implementing any minor features while going over everything for bugs over the next week or two. Once the docs are almost ready I'll release dev copies to give another brief, but needed, final look over for anything that needs major attention. And after the documents are finished i'll finally get to set everything up in relation to the asset store which i figure can be done in a day or two, which leaves submission for publishing right after. :)

    New Things
    -More Compressed Batching (Lower draw calls, less work, more memory) More on this tomorrow.
    -Layered Brushes (Mention above, displayed below)
    -Erosion Brushes (Mention above) Preview Tomorrow.

    -Probably more things.. lol

    Here's a tiny taste of what the editor now offers for the time being anyways :

    Layered Brushes


    Splat/Texture Editing Interface


    Still in the midst of adding headers and finalizing placement / adding features (I'm aware of the text being wrong in the splat editor , lol) but feature wise before getting into erosion and noise painting here's where things stand now.
     
    bgrz, magique and Teila like this.
  7. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Are you planning your own vegetation system or keeping to a terrain replacement? What about number of textures in a single pass?

    I'm using Lennart's Awesome Vegetation, and Antonio's Sentieri for the roads/rivers, so top of my list is a mesh terrain replacement, with LODding and preferably holes on the roadmap :)
     
    antoripa, LennartJohansen and Teila like this.
  8. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    What's that? Couldn't find any information on this.
     
  9. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Will be a forum thread in a couple of weeks. Almost ready for the beta.
     
    bgrz and Whippets like this.
  10. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    It will blow you away; it's like vegetation running on someone else's much better computer.
     
  11. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Then I'll definitely keep an eye out for this!
     
  12. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    I'm going to have a vegetation layer, most of it is actually complete there's some screen grabs showing the foundation through out the thread and on the first post, just need to give it the proper attention and the mesher has consumed most of mine for the time being lol.

    I'm gearing this whole endeavor towards current/future terrain standards so I'm going to be releasing support for more then four splats when I finish up the tessellation stuff, as in order to blend height maps I need access to all height maps, in one pass, not just 4 so I'll be working on placing all terrain textures in a single pass when I get to that next month-ish. (Think Battlefront from Dice) For now however I've spoken with Jason and mega-splats integration is on the menu as well. Essentially I'm trying to ensure all the fall back is in place before building systems that rely on newer hardware dx10/dx11 for texture arrays and tessellation.

    Lennart's system should be compatible out of the box speaking of which, and I'm also hoping Sentierri will be as well. I figure in a couple days I'll finally be able to hand off dev files to get that all running to Antonio, Jason and Lennart.

    I'm actually well versed with voxels, I've been building terrain engines for the better part of 8 years, mostly volumetric infact. So not only is tunneling planned, it's a priority. :)

    Definitely should. Currently corresponding with Lennart, and some mornings just looking at the screen grabs he sends me brings me to tears. Gorgeous work, I haven't seen a vegetation asset that rivals it in terms of quality in my opinion. :)
     
    tapawafo, bgrz, Frednaar and 5 others like this.
  13. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    This is all good to hear. I was worried about possible bloat/reinventing the wheel, but if the Terrafirma vegetation system is a fallback for those who won't be using AwesomeVegetation and can be turned off/removed, that's brilliant.

    Overall, the goal is to have all the pieces in place to completely replace Unity Terrain:-
    Frustrum vegetation with billboarding from all angles.
    Mesh terrain with LODding, and tunnelling and/or holes.
    Full PBR single-pass terrain shading with >4 textures.
    Road and river mesh system with terrain carving and river surface meshes (must work on mesh terrains).

    And all of that has to work together and be at least 4 times more performant than the current Unity Terrain. No small task, but looks like over a group of asset-devs, it's coming together nicely. @Murpenstien @LennartJohansen @antoripa
     
  14. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Great trio! This is my plan too and watching and waiting for what will be a great group of terrain assets.
     
    antoripa likes this.
  15. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
  16. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
  17. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    Now I'm really annoyed. I think I've been wasting my time for the past few months, battling with Unity trying to get some decent performance - and now this comes along! Truly amazing work.

    Looks like an insta-buy for me, can't wait ;)

    Looking over the GUI, I don't see anything about colliders - if this uses meshes, does it also use mesh colliders?
     
  18. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    It produces a mesh that is the same as the unity terrain, only faster. You can still add the same heightmap to a terrainData asset and use the terrain collider.
     
    SyGem and Teila like this.
  19. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    IIRC one of the recent updates in Unity stated that a static MeshCollider cost almost nothing now; only non-static MeshColliders were heavy to use.
     
  20. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Excuse me for asking but what is Lennart's Awesome Vegetation????
     
  21. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
     
  22. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Does this mean that unity trees won't work with it?i mean, will be affected by wind? Thanks
     
  23. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    851
    so how did everyone else find out about this supposedly awesome vegetation? ill admit, i searched lennarts post history, couldnt find anything.
     
  24. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    I actualy just added in the visual interface for collision, you can test against the height map via built in terrain collidors or meshes.

    Mesh collidors are supported, there built using the old meshing system. But testing any collidor against a mesh is always going to be slower then testing a collidor against a function (The Height Map). ;)

    The Unity Vegetation System is 100% percent compatible with any height map mesh until I finish my vegetation system. Wind animations are already supported for foliage and tree's will be before terrafirma vegetation release sometime in the next two months.

    Update :

    Interface is for the most part complete, got snagged up working on some future meshing features; Voxels ! :) You can finally dig tunnels.. ;) Patch conversion is complete. There's a lot to this and personally this probably the best volumetric solution to terrain handling I've made in terms of performance. Essentially the terrain uses a number of rules to convert patches of the height field into scaler fields that stitch perfectly with the surrounding height map terrain even taking into account stitching on the gpu.

    Meshes can be generated via the gpu.

    Anyways screen shots below, i'll start with meshes then show of the material. :) Also going to release more on how this is handed and what not over the next week or two, there's a lot to cover so I'll give everything the proper attention as I get everything stable. (Materials are a bit of a mess due to lazy integration.. lol, not visually, just hard to read on the script side).

    Also if you want have a look at the mesh editing portion ive built for voxels, have a look at the bottom of the first post of this thread.

    Patches Stitching to the Old Terrain;


    As mentioned converted patches are completely compatible with the surrounding 2D height map terrain. Stitching with lower levels is also compatible and works the same way via the GPU in the meshes shader;

    Voxel Cell Count Scaleble on the Y-Axis.


    I should mention now this an experimental method, but for the project i'm working on i need a voxel system that can handle ludicrous scale terrain. For the most i'm going to be semi cryptic on everything i've implemented / plan to until sometime after first release.

    Here is one example of how the system can be adjusted; The cell count on the y axis can be adjusted on a disjoint voxel section basis (Voxel patch islands). This can be set up to be done automatically via a number of settings or can be overridden.

    The shader for voxel system is done;

    Vertex Paint Material


    It can blend with the old terrain as well; PBS using standard surface shading.

    Height Map and Volume Patches Texture Blending;

    Weird triangle formations; volume patch; uniform squares height map terrain;

    The interface is now done as well, splat paint and height mapping now logs changes to unity's undo/redo history. I'll bring back my own system so it support as many undo's/redo's as you wish as well as a revision-er. (Save Terrain State instance history; Could treat it as a terrain "version" change history).

    Interface Complete! (Visually ;))


    The interface is now complete, visually aside from the voxel editing settings, some things are a bit of a mess (Shaders..) and need to be integrated a little differently now to accommodate the hybid 2d/3d splat storage other than that though im adding in the visual interface for voxels and starting docs working on the actual integration. If the documents are done before the voxel system is ill hold off on it till a week or two after release.

    In-terms of volumetric data, there isn't really a usage I foresee that couldn't use the hybrid method i'm proposing/implementing, even spherical terrain mapping. I will however in the future have the option for full volumetric support. Ill show off lods a little later as I need to get around to setting up the trans voxel tables which ill probably do sometime into working on the docs. Just figure i'd show the stitching as well as the materials quality as a proof of concept for, "volume patches" as i call them.

    Anyways I figure a week of finishing off the docs and getting the final draft of the scripts related to the release system done before submitting for review and shipping out the first batch of test copies.

    Remaining things to handle now are texture array support and tessellation as well for the terrain meshing portions foundation to be complete. (I'll be optimizing and adding more methods as well as more advanced feature after the vegetation system is done.) I plan to tackle that after release before vegetation,
     
    Last edited: Apr 29, 2017
    docsavage, Acissathar and Whippets like this.
  25. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Only mentioned the other systems that could work well together; but can we bring this thread back on track. It belongs to @Murpenstien and the asset we're looking forward to is Terrafirma which is going to be great.

    I'm sure @LennartJohansen will post when his thread is ready to start XD
     
  26. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    I wish i could show you some screens, it is awesome though! :) Project seems to be under wraps at the moment, I got a look at though through direct correspondence with Lennart.

    Lol, Lennart's asset is fantastic though. ;)

    Also managed to get the voxel support foundation started, actually just posted on that above. :) Figured after you mentioned it I'd get it started, lol. Should be pretty speedy though and should support massive terrains that call for volumetric features.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Awesome. I'm really looking forward to giving this a try.
     
    Murpenstien likes this.
  28. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Not a problem, I'll be in touch with-in the day. :)
     
  29. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Update
    So the interface is now, finally complete.

    Figure id post something to assure anyone who maybe wondering, I am actually working.. lol. Quite a lot actually. -_-) Anyways there's a few more options now, I still have two or three more new items to add but it's basically there.

    I also started the documents and am around 30 pages in. I'm going to start sending out test copies to everyone in the next couple of days, just want to address a couple things and write up a disclaimer pertaining to what I'm still finishing up.

    So if i've discussed testing with anyone in the past 5 months (I remember everyone... ;) ), expect an email/pm in the two-three days. I would like to have a good group of people take a look as a finalize things so I can prioritize any last minute things I may have over looked.

    Anyways here's the interface as of now, if anyone would like to have a look. I'm going to leave the vegetation editor till a little later I should mention as well.

     
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    One thing that just occurred to me and could be very important is Unity's pixel error feature. If I want to improve performance at the cost of precision then I can increase the pixel error. Sometimes the difference is dramatic and for some terrains still quite acceptable in appearance. So, my first question would be what pixel error settings are used for your various performance comparison shots?

    My concern is whether or not Terrafirma has some similar mechanism for taking the same terrain and maximizing performance? I'm worried that I could convert a terrain and performance would be better for Terrafirma, but if I were to increase the pixel error for the Unity terrain then it would suddenly outperform Terrafirma. And if I can't do a similar thing in terrafirma then I haven't gained anything. I would expect that even at max pixel error that I could still get an equivalent Terrafirma terrain to outperform it.
     
  31. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Yah, my bad. I recently rebuilt the distance function. I had it set up a lil dif then unity initially so the you could control the pixel error via a distance magnitude. I did a complete re-write though and it works as it should.

    When using the gradient method, the distance slider is effectively your pixel error control. I'll relabel it properly so there's no confusing this.

    Also because of the way Unity works I don't think this will ever be an issue. I've placed my self in circumstances where the geometry of the terrain in terms of triangles is quadruple what unity would produce and still manged 4 times the frame rate of a unity terrain.

    The key is draw calls. Unity is stuck to a quad tree drawing the terrain. I'm not and handle mesh compression using custom routine based on common data compression methods. The quad tree approach, while commong has alot of shortcomings in my opinion.

    Level 0 patches can never be compacted being a huge one.. This means the more patches at the highest detail the more draw calls. The same isn't true for the lower levels where they may use one mesh to cover say a 2 x 2 patch region due to quad tree split.

    Should note the system can be set up to run worse then a unity terrain, but from my experience when matching a unity terrrain with a pixel error of 1, in terms of quality I haven't encountered yet lower speeds then a unity terrain.

    I tried to write the documents as thoroughly as possible and all of this is covered lol. Ill make them available before release so you'll know how everything works

    Edit should also mention there's an option to control the pixel error at different distances. It's essentially the radial method fused with gradient.

    Basically the rings produced using the radial lod transitions can be layered under the gradient method. From here each "Ring" can have a predefined pixel error. So you could have a low pixel error that gets progressively larger. This ensures that meshes up close are prioritized will the detail effectively falls off as the distance progresses. I added this in recently for an optimization layer for larger Terrains.
     
    Last edited: May 8, 2017
    neoshaman, Whippets and magique like this.
  32. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Well this one has been asked about quite a bit, I got more then 4 textures in a single pass going. Or how ever the best way of describing that would be.

    I spent majority of tonight working on shaders and material related stuff, spending the last hour on texture array support, as you can see below everything went well. :)

    Draw Splat Layers - Single Pass



    Should also mention I cranked the detail up a little bit. Prior this scene would take on average 1 million triangles. Essentially saved 300+ fps on my end.

    As you can see, one set pass call, 5 textures (x2 including normal maps);

    -Brown Dirt
    -White Rock
    -Dark Gray Rock
    -Yellow Grass
    -Green Grass

    2 Control Maps present as well.

    I'm not sure what the limit will be here.. I'm assuming not much since there's no added work here to handle more then 4 splats per pass. I'm going to assume this will all scale a lot better then having a drawcall per pass on top of the sampling, since the shader is basically doing all the same thing in terms of splat blending, just in a single pass.

    So ultimately I personally wanted this so i could properly handle tessellation. I'm sure it's apparent though this cuts draw calls down significantly as well the triangle / vertex counts.

    Also set up a compatible tri-planing layer that matches uvs with the volume patches.

    Tri-Planed Left; Right Mesh Uv Projection

    Anyways I'm going to finish up what I have left in-terms of getting dev builds finished. Shaders was something I kinda forgot about.

    Would also like to apologize for any delays. Personally I'm use to taking on personal projects, something of this scale though is not something I am personally use to. It seems like every "1 hour job completion time estimate" I make ends up being well under what it is actually taking me to get it done. There's also a lot of ground to cover as well in terms of everything. Basically please excuse my young naive-ness when it comes to development scheduling. ;) Just been a little over whelmed but things are now more manageable. I'll leave material settings as is anyways, most likely avoid voxels till after release, and finishing up the documents / bug weening.

    Pretty close to a stable build as well (For Development Purposes). Seems like every-time I say that though I end up un-covering another loose end such as the shader/material options needing attention / more features / better set up. Really think im there this time however. I know of a few bugs that exist before a terrain is generated, (Console error if the wrong page is selected, ect) Nothing that really inhibits it's use however so I'll make sure I got everything (Some distance function modifications to control fall off; This is needed since the distance scheme was rebuilt, along with proper multi-terrain support; Need to rebuild the level adjustment functions to handle disjoint data rather then one large "level map" for all terrain).

    Anyways really excited about having access to all texture /splat layers in a single pass. Tessellation integration is should be really trivial at this point. :)
     
    Last edited: May 8, 2017
    neoshaman, antoripa, Whippets and 2 others like this.
  33. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775

    Spectacular. Going to be a game changer.
     
  34. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Are texture arrays mandatory now? Wii U currently does not have support for this feature although a fix is promised soon.
     
  35. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Nope, 100% optional. :) I personally need tessellation which requires the height maps be processed in a single pass to blend properly at the vert function also figured it would be a nice feature to have on newer hardware. Like I said though, not a mandatory thing at all.
     
    magique likes this.
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
  37. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    There's a few things I know that'll need to be modified. Out of the box definitely no. I can take a look when the time comes how every, it'll be simple modifications I figure though. I've set up a lot of utility functions in my cginc stuff to help with this sort of task. Depending on how comfortable you are with shaders I don't mind lending a hand getting things going worse case. The blend texture shader and the terrain shader would need to be modified for sure. How much so I dont personally know.

    Update

    A few things have been added. One im thinking everyone will like..

    GeoMorphing (LOD Transitions via GPU) Almost 4000 fps from a Nvidea 950 gtx


    Performance Comparision (Unity 3D Top, TerraFirma GeoMorpher Bottom)


    Note; theirs a difference in the texture tiling here. A few things a still needed to be done to the stuff for drawing everything in one pass. In this shot im using a fixed scaling across all splats.


    Supports texture layering in a single pass, gradient and radial transition methods. Runs beyond anything I've produced before, lol. The cpu has essentially been taking out of the equation. This supports tessellation based displacement from height maps.

    In-fact the system supports tessellation out side of this and geomorphing is layer-able with cpu methods. So it can be ran with, or without.

    1024 heightmaps for example require only 4 draw calls along with a single set pass call. Even when voxels are enabled, culling is also done via the GPU as well.

    Also supports collision ;)



    I also added in QuadTree tansitions methods

    -Quad Tree LOD transitions
    -Radial Complete
    -Gradient In the Works (80 percent finished)

    This are supplementary and seem to actually run a bit better then their non quad tree counter parts.

    -Quad Tree Frustum Culling Has been extended;
    -The Original Method Finds the nodes with edge intersections to certain subdivision.
    -New method contructs essentially the radial LOD quad tree recently added and culls based on "pixel error", better quality culling is produced at low pixel errors while sloppy culling comes with higher pixel error values.

    The new method is much faster, not that the previous method had any problems, this one can get away with 16 - 20 tests in some cases.

    The other method however can compensate for starting deeper into the tree, theres benefits to both methods and theyre both relatively cheap.

    Things left to do are down to finishing up the quad tree stuff, a lil interfacing (Most of the new stuff is in) and the documents. I can't give an exact time ill be finished, the docs are turning out to be hefty. Essentially closing up in regards to this chapter though.

    So everything is wrapping up great, lots of fall back and the newest transition method is better then anything i could have ever hoped to achieve lol. For the record a unity terrain run at only 250 fps in this scene. :)
     
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    OK, thanks for the information. It's enough to know that it can work with it at some point and that you can help me get it there if need be. I haven't gotten Dynamic Nature yet, but I'm seriously considering it so that's why I wanted to know. I wouldn't want to buy it if it ended up being useless for me.
     
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Quick question. How does Terrafirma handle terrain resolution? I know with Unity terrain if you change resolution then you lose everything. So, if I start with a low res Unity terrain at 257 can it be upscaled in Terrafirma without losing anything?
     
    Whippets likes this.
  40. AlwaysBaroque

    AlwaysBaroque

    Joined:
    Dec 20, 2014
    Posts:
    33
    Only found this thread today and already I'm drooling with anticipation, so chalk up another customer patiently waiting for release.:D
     
    Murpenstien likes this.
  41. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    First off sorry for the late reply. I actually started work on an additive "covering" systems. Essentially you can layer splats procedurally on-top of the paint-able splats.

    One example would be for snow/leaf covering support based on the surface normal and tolerance/intensity of the area of effect.

    Im also working on a mesh material blend shader that will blend the surface normals of meshes along with their diffuse layers to the terrain mesh as well, so I figure I can provide the functionality for some of those features personally, as I need them anyways and mesh blending was already planned, following EA's frostbite engines terrain system as an example.

    In regards to your second query, by default it will clip the height map when shrinking or add bank regions when expanding. I put in a toggle though that tells the system to double or halve the height map in use. Best practice would be to keep a copy of the original height map, and modify as needed the one in use.

    This can all be handled now though via the cpu/gpu by telling the system to use more or less points to represent the height map. The system for example when told to use a threshold of points twice the dimension of the height map will adjust the vertices using interpolated heights. When the threshold is equal to or less then the height maps dimensions it will sample directly from the height map as no coordinates will contain a fraction.

    Basically there's a few routes this can all be handled.

    Update

    Anyways, for the most part finished up everything. I have one LOD method to finish. But the only thing left is to finish is the documents before It's plausible to submit for publishing. I may finish the above mentioned material blend system. Will depend on time, but everything is done as of now that i had initially planned for release plus some.

    Here's a few screens of the tessellation/displacement mapping system i just finished.





    As of now everything is handled in a single pass (Needed for proper displacement blending). So all textures will be layered in one pass as well.

    The shader supports the deffered rendering path and can receive and cast shadows properly. There's also a few secretes as well. I've designed it so it takes into account the terrain height map as well as the specific spats displacement values. I'll get into what that means later, but essentially it results in a better topology even in areas where displacement maps arent present to sample from.

    This also works with tri-plane projections enabled, so it will work with the voxel engine I'm throwing together as well.

    Anyways that's about it for now. Im going to continue to work on the documents, i figure ill make a post in the next couple days when I finish the LOD system. I'll lay out the contents of documents to give an idea of everything possible so far with the system as well.
     
    Last edited: May 19, 2017
    neoshaman, SyGem, Teila and 3 others like this.
  42. b14de1

    b14de1

    Joined:
    Jul 25, 2012
    Posts:
    12
    Great work @Murpenstien,
    this is looking and sounding excellent! You noted 'The shader supports the deferred rendering path', has this been tested in forward at all? This will be useful to know for VR developers.
    Thanks
     
  43. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Very nice looking terrain, great work!
     
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm either completely misunderstanding your answer or you didn't understand my question. It sounds like you are talking about the terrain width and height, but I'm talking about the heightmap resolution.
     
    AlwaysBaroque likes this.
  45. Fatalis

    Fatalis

    Joined:
    Sep 9, 2013
    Posts:
    52
    Will Terrafirma terrain be compatible with navgrids? Specifically with Apex navgrids.
     
  46. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Since Terrafirma is using the terrain collider it needs a terrainData component with a copy of the heightmap. This is where Apex gets the heightinfo for the navigation system. It should be an easy fix to send the terrainData and not the terrain to apex.
     
  47. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    I'm referring to height map resolution as well. Unity regardless of the width or length will use one vert per pixel in the height map at the height-est level of detail. The way i've set things up is your left with the option to either shrink/expand ur height map, or threat it as unity would when changing resolutions.

    There's options to do this procedurally as well.

    . If your default height map resolution is 512 x 512 you can tell the system to use interpolation to effectively treat it as a 1024 x 1024.

    The interpolation functions result would be the same if you told the system to double/expand your height map pixels and have them baked into the texture.

    Essentially you can have a default height map and adjust it the same way unity would, or u can down sample from it to make smaller height maps, or you can up sample using interpolation to get a larger one.

    The option to scale the height map as the resolution is there, but by default it will act the same as unity.

    The option to bake these changes or have them executed via hardware is there as well. When executing via hardware the system leaves your height map alone and calculates the missing heights on the fly in the case of making the height map bigger.

    The only thing the width and length effects in both the cases of my terrain and unitys is the physical scaling and calculations related to LOD when getting the distance between patches and the view port.

    Yeppers, the system relies on Unity Terrain Colliders (Fastest route in terms of processing) so if it works with Unity Terrains it will work with mine, lol. ;)
     
    magique likes this.
  48. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    As always thank you Lennart for more in-sight. :)

    Edit

    Sorry Magique as well for any confusion. Past couple days have whipped me mentally lol. Basically in terms of adjusting the height map size you two or three routes you can take.

    If you want more points but the same topology you can stretch/shrink the height map. This can be done either through the sampling process when projecting the mesh, or can be baked right into the height-map.

    Basically with the system set to stretch/shrink the pixels, if you started off with a 512 x 512 and set the resolution to 1024 x 1024 the system would map every pixel in the original height map to every second pixel in the 1024 x 1024 one and get the missing heights via interpolation.
    If we instead went to 256 x 256 the system would instead map every pixel in the height map to every second pixel in the old one. There is a loss of information when scaling down then back up to consider, so it would be advised to back up the height map. Theres a whole interface page for handling backing up and re-visioning terrain now though so it shouldn't be to much of annoyance.

    If you want to crop the height map or add blank regions when change the resolution that possible to. When told to not scale the pixels; Say the height map was originally 512 x 512 if we changed it to it 1024 x 1024 the top left corner would contain the portion you've edited and the other 512 x 512 segments would be blank. The system essentially just copies and pastes the values into larger or smaller height maps. If the height map size were say set from 512 x 512 to 256 x 256 you would end up with a quarter of the original height map.
     
    Last edited: May 19, 2017
    magique likes this.
  49. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Sorry didn't see your comment, yes it all works in the forward rendering path. Typically i'm running it forward majority of the time. :)
     
    b14de1 likes this.
  50. Murpenstien

    Murpenstien

    Joined:
    Nov 12, 2013
    Posts:
    104
    Just a minor update, spent a few hours while writing out the docs working on a shader for blending meshes to the terrain object. Was inspired by a lot of things on this one, recently a forum i was reading on the udk boards though and the system Magique queried.

    As of now i still need to finish up the lighting stuff. Ill get to that most likely tomorrow night, since this is work in progress thread figured I post what I have so far;

    Terrain Mesh Intersection Blend Shader - WIP (Before Lighting Corrections)



    The seams where meshes intersect should be gone by tomorrow, but for the most part everything is in order. As of now it's similar if not the same as the effect in borderlands, used to blend meshes.. When Im done it should be battlefront / rts quality though. :) (No noticeable mesh intersections / hard seams where the meshes intersect) There's a few options and the interface i've half built should make it easy to add/remove objects from the scene with out to much set if any.

    Most of the visual errors stem from the normal directions not matching/blending with the terrains surface. With out normal mapping the visual is less pronounced. (Diffuse/Albedo match seamlessly.) As mentioned I should have that all blending correctly as well.
     
Thread Status:
Not open for further replies.