Announcement

Collapse
No announcement yet.

Blending meshes with landscapes with no seams: how?

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

    #16
    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.

    Comment


      #17
      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.

      Comment


        #18
        Cool! Thanks, I'll test it. Is your ground an other static mesh or a landscape?
        GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

        Comment


          #19
          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.

          Comment


            #20
            [MENTION=2525]jwatte[/MENTION]: do you have a screenshot of the result, from your own work?
            GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

            Comment


              #21
              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!)

              Comment


                #22
                [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?

                Comment


                  #23
                  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.


                  Comment


                    #24
                    [MENTION=25181]hippowombat[/MENTION]: Nice, but you still have that hard edge between "floor" and rock mesh (whether it's a rock side or grass side of the mesh). It would be nice to eliminate that, unless you want it to be that way.

                    Comment


                      #25
                      Could use a noise texture to eliminate the harshness of the edges, takes away a bit of control from the artists though.

                      Comment


                        #26
                        this is what i came up with, this might not be perfect but im realy happy withthe results

                        here is .gif that shows how it looks:

                        https://i.gyazo.com/bb5a25f93cee022f...421321a05b.gif



                        Click image for larger version

Name:	1e836c7fadcf93b69422e1f0c8311220.png
Views:	1
Size:	507.4 KB
ID:	1107795

                        Comment


                          #27
                          Ah, that's sweet! (but 100 instructions?!)

                          So, what's the workflow?

                          Could you please explain worflow? (I see you have red channel and alpha used in vertex color; what do you paint with those?)

                          What's "MaterialExpressionTextureObjectParameter* " ?

                          Thanks

                          Comment


                            #28
                            Originally posted by motorsep View Post
                            Ah, that's sweet! (but 100 instructions?!)

                            So, what's the workflow?

                            Could you please explain worflow? (I see you have red channel and alpha used in vertex color; what do you paint with those?)

                            What's "MaterialExpressionTextureObjectParameter* " ?

                            Thanks


                            honestly man i dont realy know sory :/

                            i just put something together and it worked

                            i put that up here so people can see what i came up with, and try to get some new ideas out of it, also i hope someone will (optimize?) it and let me know if he does

                            again sory but i dont real understand what i did xD there might be some extra unnecesary nodes which dont do anything, but i didnt want to mess with it and jut let it be


                            edit:
                            i made a video that shows my problem,if anyone knows how to fix that please let me know
                            https://www.youtube.com/watch?v=FDqsvABKjrE
                            Last edited by jakaa; 06-06-2016, 05:46 PM.

                            Comment


                              #29
                              [MENTION=7998]jakka[/MENTION] :
                              That's basically the material i've posted earlier, but it only does world aligned Base Color texture. So when you will build lighting on this it will look incorrect, your normals still don't blend. I wouldn't even worry about vertex paint, since the principle is wrong. Notice the seam between your object and ground - that's not going anywhere with your setup.
                              Btw, it seems that your object doesn't have correct UVs in it's first (0) channel. World aligned texture doesn't care, it planar projects itself, but your rock texture actually needs them.

                              [MENTION=25181]hippowombat[/MENTION] :
                              This seems promising, gonna try this with my mat. The problem i see is it still won't help me to automatically blend to world space normals on my landscape, which is the only thing i actually have left to do for this.
                              Last edited by Elocater; 06-07-2016, 05:05 AM.

                              Comment


                                #30
                                @elocater
                                true i did use ur setup as refrence, like i said im no pro at this at all. ive build lighting and it look fine to me, dont realy see see the diference(im not using directional light,only skylight and ill stick to that).you said normals dont blend, maybe but i dont even know how to fix that,as for the seam between ground and object i dont realy see the problem
                                thanks for the heads up on the object UVs ill try to figure that out, or maybe if you know what to do that would be great, also im here just to get a simple solution for my "project"

                                Comment

                                Working...
                                X