Announcement

Collapse
No announcement yet.

How can I "blend" a mesh (static or animated) into the sky ?

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

    How can I "blend" a mesh (static or animated) into the sky ?

    Here is the gist of the setup I am after. Imagine a sky sphere that is basically sky and the ocean, and actual ocean mesh on the level. How can I make ocean mesh gradually blend into the sky sphere so that the scene looks seamless ? (sky sphere could be a a desert and sky, with patch of desert landscape mesh; same idea - make scene look seamless)

    Thanks!

    #2
    I would use fog to blend the horizon

    Comment


      #3
      You could render sky sphere with transparency and fade alpha based on scene depth.

      Comment


        #4
        That's not really a good idea, because I need to create fake wide open space, without fog.

        Even having fog will show the edge of the mesh against sky sphere. Probably even more defined than without fog.

        In one of the older game engines, I could paint edge of the mesh with vertex color and have 2 layer material on it - one would be for the ocean (or desert) and one would be sky box material (the edge part of the mesh). That would make mesh dissolve/blend into sky box seamlessly. Is something like that possible with UE4 ?

        Comment


          #5
          Originally posted by Kalle_H View Post
          You could render sky sphere with transparency and fade alpha based on scene depth.
          I prefer not to have any transparency since it's for mobile VR platform.

          Comment


            #6
            Originally posted by motorsep View Post
            I prefer not to have any transparency since it's for mobile VR platform.
            It's better to have single cheap fullscreen transparent mesh(and most are occluded anyway by opaque meshes) than have every other material to have complex fade logic.

            Comment


              #7
              Oculus basically forbids usage of transparent surfaces for mobile VR.

              Comment


                #8
                With all those mobile vr limiations you can just raise your hands up and stop caring about visuals.

                You have couple options.
                1. Make distant object transparent and fade them to background. Too expensive. Multiple materials. Visual difference when swapping from opaque to transparent.
                2. Dither fade distant object. Look bad. Need alpha testing. Multiple materials needed.
                3. Replicate skybox material perfectly in every distant material. You also need to tune down albedo and specular for distant objects to make it look smooth.
                4. Use transparent sky sphere.

                Comment


                  #9
                  Try Height Fog. You will see the sky, but not the horizon. And it has a nice performance optimization.

                  https://docs.unrealengine.com/latest...Fog/index.html

                  Comment


                    #10
                    HeightFog doesn't work on mobile, especially not suitable in mobile VR.

                    I'll make a test case in my old engine and show what I am after exactly. If UE4 can't do that, it's pretty sad.

                    Comment


                      #11
                      So, to avoid further confusion I made a test case using old engine:

                      What it looks like in-game:


                      This is how it was made:


                      Does it make more sense? Basically there is no transparency/translucency, no alpha testing, no fog of any kind. The terrain surface casts shadow / receives shadow. There is no performance loss at all (between non-blending terrain and bending terrain you see on video).

                      I want to achieve the same with UE4 (but not sure how).

                      Any thoughts ?
                      Last edited by motorsep; 03-31-2016, 09:09 AM.

                      Comment


                        #12
                        Folks, so is it achievable or not ?

                        Comment


                          #13
                          Well without doing tests it seems you would be able to use the same technique in UE4 unless you are trying to blend into the default dynamic Sky blueprint which sounds like a pain. And by same technique I would mean vertex paint a transition or mask it in with a Linear Interpolate. If you are using your own skybox I assume any of these would do.

                          Comment


                            #14
                            Originally posted by Hadrian View Post
                            Well without doing tests it seems you would be able to use the same technique in UE4 unless you are trying to blend into the default dynamic Sky blueprint which sounds like a pain. And by same technique I would mean vertex paint a transition or mask it in with a Linear Interpolate. If you are using your own skybox I assume any of these would do.
                            Yeah, I am blending static sky box (cubemap). Are there any tutorials about basics of texture blending via vertex color in UE 4 ?

                            Comment


                              #15
                              Vertex Color is rather easy and straightforward. Unreal Documentation has a few tips.

                              https://docs.unrealengine.com/latest...tup/index.html

                              If you like to follow by example Youtube has various tutorials here is one of them.

                              https://www.youtube.com/watch?v=p6O4AgSwTmQ

                              Comment

                              Working...
                              X