Announcement

Collapse
No announcement yet.

Blending meshes with landscapes with no seams: how?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic Blending meshes with landscapes with no seams: how?

    Blending meshes with landscapes with no seams: how?

    Hi,

    Does anyone know a clear and well described technique available in UE4 to put rock meshes in a landscape and integrate them smoothly with it?
    The idea is to have a result like this:



    I found this video from a thread on polycount. Following the discussion, no one really found a way to reproduce it in UE4.
    But the post is almost 18 months old. So, maybe, since then, something new happened...

  • replied
    Hmm.. i was trying the Material .. Thanks but i have an Problem.. it seems i have an Dark Shadow when im Using this Feature , When im Reduce the Dithering , The Shadow Disappears but.. than i dont have that blending anymore.. any ideas?

    Leave a comment:


  • replied
    Originally posted by kjetilhj View Post
    You can normalize the distancefieldgradient node. Feed it a worldposition and it will give you the normal from the distancefield. Use distancetonearestsurface to decide where to blend in the normal. It's takes a bit of tweaking to get right, and most likely does not work in all cases, but it's worth a try. I commented on another post here. https://forums.unrealengine.com/deve...-of-two-meshes
    It shows a basic version of the material + video here - http://take.ms/v0nUZL
    Just adding that Generate Mesh Distance Fields must be enabled at your Project Settings and you need to certify on each mesh the distance field is set for generation aswel.

    Leave a comment:


  • replied
    You can normalize the distancefieldgradient node. Feed it a worldposition and it will give you the normal from the distancefield. Use distancetonearestsurface to decide where to blend in the normal. It's takes a bit of tweaking to get right, and most likely does not work in all cases, but it's worth a try. I commented on another post here. https://forums.unrealengine.com/deve...-of-two-meshes
    It shows a basic version of the material + video here - http://take.ms/v0nUZL

    Leave a comment:


  • replied
    Originally posted by Norman3D View Post

    This does not accomplish what OP is asking for. He wants to be able to blend the normals with the underlying mesh so that there are no visible seams.



    You can't access the underlying terrain's normal maps. So you'll have to take the terrain to 3dsMax or other 3d software and get the normal map from the terrain by projecting it on to a plane.
    You could render to texture in UE 4 and then only render the normal map channel.

    Leave a comment:


  • replied
    It's been quite some time since anyone posted on this thread but I am looking for this exsact solution to get rid of the nasty hard edges on my static meshes that are intersecting the terrain dynamically. Since it's been so long has anyone come up with a solution? I'm not a programmer so I would have to follow a tutorial to set up the proper MF, definitely a topic worthy of being necro'd.

    Leave a comment:


  • replied
    Hey Ryan, any updates on adding the ability to sample the terrain's heightmap/normal and weightmaps in the material editor? I'm using a technique you described in another thread by transforming the normals of the mesh blend layer and a paintable terrain layer, but it obviously looks very flat on curved terrain, not to mention expensive and inconvienent. Having this kind of access would be a lifesaver for a project I'm working on!

    Leave a comment:


  • replied
    Thanks for your responses guys. Time ago I tried with PixelDepthOffset. Worked fine but ... problems in lights&shadows.

    Originally posted by RyanB View Post
    "Landscape_Manual_UVW" to help map textures to fit the landscape.
    All you need is to know the min and max XYZ coordinates of the landscape.
    Thanks for the info Ryan. I shall have a try.

    Leave a comment:


  • replied
    Originally posted by Daedalus51 View Post
    Man, I would actually really love for this to gain some momentum so it becomes something that is a native part of the core engine code in Unreal. I cant go into any details, but thats how we do it. Its a core functionality and thus its also way cheaper so we can afford to do it cross platform [MENTION=2654]6[/MENTION]0 fps. I can also say that our solution automatically picks up the terrain texture, so there is no need for custom material instances depending on where you wanna place the asset, but again...its all handled natively via the engine code to make it fast and working in all cases.

    I also think this is really something that will become more and more important to keep a high visual quality for games now and in the near future so PLS Epic...think about a native solution for this

    Cheers!
    Man, I can't really express how much this means to me . To have someone from the studio that created Battlefront, which was the impetus for my project, notice this tool is AWESOME!!

    Conveniently swapping materials is the thing I'm currently working on. I have some ideas for automatic terrain material sampling, although I have no clue how you would tackle a mesh that is is located on a transition-area between two landscape materials.

    It would be indeed way more desirable to achieve this effect by accesing the terrain-information somehow. Before I got the idea to use Distance Fields, I spent a couple of weeks pulling my hair out while trying to get some useful information out of the landscape actor .
    Last edited by OlmoPotums; 12-20-2016, 07:50 PM.

    Leave a comment:


  • replied
    Being able to sample terrain's heightmap and weightmaps from other materials would be invaluable addition. For now I've been using a downsized power of 2 copy of terrain heightmap. While technically doing so is a waste of memory, it is still good sacrifice and gives acceptable results for large and medium meshes.
    For small terrain scatters, that were placed with grass system, I've actually used slightly different approach. I've sampled terrain's normal map and used it to drive direction of gradient mask on the meshes. Eventually, the mask looked like a band around the mesh's pivot(pivots were centered for small scatter meshes), that was aligned with terrain's normal.

    Leave a comment:


  • replied
    Originally posted by Deathrey View Post
    Where distance fields are out of option, you can sample terrain's heightmap in vertex shader and apply proper math to get terrain height at mesh's vertices in order to get initial blend mask procedurally.
    PM'ed you something

    Leave a comment:


  • replied
    Its funny this just came up internally as well.

    Terrain can now influence DF, but its not a whole solution because then you have the issue about 'who writes to DF and who reads', but its one option.

    While we internally would love a more automated way to sample the heightmap texture, there are no current plans. Its much more likely (in the near term at least) that we could make a little blueprint that captures it and sets some MPC parameters for you to make it easier to set up.

    A while ago I added a function "Landscape_Manual_UVW" to help map textures to fit the landscape. A user posted an image of it here:

    https://forums.unrealengine.com/show...l=1#post639688

    All you need is to know the min and max XYZ coordinates of the landscape.

    Leave a comment:


  • replied
    True....that would be the preferred method! But I am not aware of any access to the terrain heightmap via the material editor

    Edit: [MENTION=3692]RyanB[/MENTION] or [MENTION=404]DanielW[/MENTION] would it be possible in an easy way for you guys to enable access to the landscape heightmap via materials (like lightmassAO or the DistanceField Nodes) so we could figure out a way to do this that doesnt need the overhead of DistanceFields just to achieve that specific effect?

    The rest can actually be handled quite in a smart way....like the different terrain materials etc that doesnt need code work
    Last edited by Daedalus51; 12-20-2016, 04:11 PM.

    Leave a comment:


  • replied
    Where distance fields are out of option, you can sample terrain's heightmap in vertex shader and apply proper math to get terrain height at mesh's vertices in order to get initial blend mask procedurally.

    Leave a comment:


  • replied
    Man, I would actually really love for this to gain some momentum so it becomes something that is a native part of the core engine code in Unreal. I cant go into any details, but thats how we do it. Its a core functionality and thus its also way cheaper so we can afford to do it cross platform [MENTION=2654]6[/MENTION]0 fps. I can also say that our solution automatically picks up the terrain texture, so there is no need for custom material instances depending on where you wanna place the asset, but again...its all handled natively via the engine code to make it fast and working in all cases.

    I also think this is really something that will become more and more important to keep a high visual quality for games now and in the near future so PLS Epic...think about a native solution for this

    Cheers!
    Last edited by Daedalus51; 12-20-2016, 12:49 PM.

    Leave a comment:

Working...
X