Announcement

Collapse
No announcement yet.

Blending meshes with landscapes with no seams: how?

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

  • replied
    I did a simple-ish slope-blend material for the mesh to blend the terrain texture to the mesh, combining that with a type of world normal blend may help achieve what you're trying to achieve.


    Leave a comment:


  • replied
    [MENTION=37296]EdWasHere[/MENTION] : Yes, this is a static mesh (and a crappy low-poly one at that). But in 4.12 i think it should work with landscape as well, since it now contributes to global distance fields.
    [MENTION=2525]jwatte[/MENTION] : Not sure if i understand exactly what you mean, but i did try PDO with DitherTemporalAA node (so, like, the simplest variant). It looks really good unless you want your object to cast shadows. And i'm not sure, is it THAT expensive?

    Leave a comment:


  • replied
    No :-( I did this in another engine (for military simulation) many years ago. (With programmer art :-) (The artists made good use of it, though, so it worked!)

    Leave a comment:


  • replied
    [MENTION=2525]jwatte[/MENTION]: do you have a screenshot of the result, from your own work?

    Leave a comment:


  • replied
    If you're OK modeling a little bit of ground around your rock/stump (as in your mesh view) then another option would be to use per-pixel depth offset, and make the blades of grass be very "near" and anything below them be very "far" in that offset. When you align the mesh with the terrain, set it so the "near" of the grass in your mesh is above the terrain level, but the "far" of the grass bottom in your mesh is below the terrain level.
    This gives you a different kind of natural -- it makes the "seam" follow the contour of your grass blades, and thus not be particularly jarring.
    The good news is that it's very easy to author and reasonably easy to align. The bad news is that per-pixel depth offset is expensive. You only need it on the "flat skirt" of grass, though. And if you do parallax mapping, then this is no additional cost.

    Leave a comment:


  • replied
    Cool! Thanks, I'll test it. Is your ground an other static mesh or a landscape?

    Leave a comment:


  • replied
    Hey guys!
    Wanted to show you all my solution. It is not perfect, and requires more steps than i would like to give our artists, but at least it works.
    So i'm using DistanceToNearestSurface material node to mask lower part of the object, as well as World Projected textures for ground. I also transform normals to Tangent/World space (did it differently for ground and objects for some reason, just noticed that). So objects have Tangent-Space Normals turned off and then their own normal is transformed to world. Ground is reverse, it transforms normal from World to Tangent and that's it. Probably gonna fix that soon.
    There's also vertex paint i'm using on ground to paint an area where and object should be blended in, which is my main bugbear with this whole system. Ideally it should be the same principle that objects use but distance fields just don't work like that, sadly.
    So here's a screenshot of a blended mesh:
    Click image for larger version

Name:	Stump1.jpg
Views:	1
Size:	377.3 KB
ID:	1107541

    And here how mesh looks with ground hidden in main pass:
    Click image for larger version

Name:	Stump2.jpg
Views:	1
Size:	194.4 KB
ID:	1107542

    And here's my materials:
    Ground -
    Click image for larger version

Name:	GroundMat.jpg
Views:	1
Size:	230.0 KB
ID:	1107543

    Object -
    Click image for larger version

Name:	RockMat.jpg
Views:	1
Size:	262.8 KB
ID:	1107544

    Don't forget to turn off Affect Distance Field Lighting for your objects (but not for ground!). And of course Generate Mesh Distance Fields in you Projects Settings should be turned on as well.
    Last edited by Elocater; 06-15-2016, 10:41 AM.

    Leave a comment:


  • replied
    I'm sorry guys, I barely have time. Once you have the normal map you have to use worldposition.XY as the UV coordinates of said texture.
    You need to make sure it's scaled and positioned correctly.

    Leave a comment:


  • replied
    [MENTION=13213]Jak Carver[/MENTION]: I'd be really interested too in a tutorial about these techniques to blend between landscape and meshes diffuse textures. [MENTION=47093]Norman3D[/MENTION]: so, about blending between normals to avoid hard edges (which is indeed required to achieve the effect) , I have to make a normal map of the whole landscape geometry, right? Ok, but when I have this normal map, how do I use it? By blending it with the rock's normals" as you said? This part is still unclear to me.

    EDIT: I posted this just after divi and didn't read it's post discribing how to blend normals. I'll start experimenting with all these indications but a screenshot of the nodes setup would be great.
    Last edited by EdWasHere; 06-01-2016, 04:23 PM.

    Leave a comment:


  • replied
    Originally posted by Barzum View Post
    Could you please do some example, no need to do it with actual assets, I am interested only in material side, how to build nodes for this stuff
    once you have the terrain normal map you pretty much just lerp between that(normal map texture) and the vertex normals(vertexNormal(WS)) of your rock assets based on the vertex color mask. you'll possibly want to turn off tangent space normals for the rock asset material.

    Leave a comment:


  • replied
    Originally posted by Jak Carver View Post
    I could do a tutorial showing both the vertex painting method and Substance, if people are interested?
    I second this! Please do one.

    Leave a comment:


  • replied
    Originally posted by Norman3D View Post
    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.
    Could you please do some example, no need to do it with actual assets, I am interested only in material side, how to build nodes for this stuff

    Leave a comment:


  • replied
    Yes, very interesting!

    Leave a comment:


  • replied
    Originally posted by Jak Carver View Post
    I could do a tutorial showing both the vertex painting method and Substance, if people are interested?
    +1 Yes please...

    Leave a comment:


  • replied
    Originally posted by Jak Carver View Post
    All this is doing is allowing you to do is vertex paint a mask that reveals a "blend" material across the verts of the meshes. We used similar techniques in Halo; we created "dirt skirts" using Houdini and Maya, then vertex painted the mask in maya. Once in engine you can just apply the material you want (i.e. sand) and since the vertex colors already export with your meshes, the material will automatically blend in with everything.

    You can do the same thing in UE4. You can setup a material with 2 layers (i.e. rock and sand), then just paint vertex colors (in UE4, no need for maya) to mask which parts will be rock or sand, they will blend in and that's that. If you want to get fancy, you can generate a mask in Substance Designer so it's more realistic then vert colors, and get some more believable blending between the two objects.

    I could do a tutorial showing both the vertex painting method and Substance, if people are interested?
    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.

    Originally posted by EdWasHere View Post
    I don't get it. How do you do that? What's the nodes setup?
    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.

    Leave a comment:

Working...
X