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)
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 ?
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.
With all those mobile vr limiations you can just raise your hands up and stop caring about visuals.
You have couple options.
Make distant object transparent and fade them to background. Too expensive. Multiple materials. Visual difference when swapping from opaque to transparent.
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.
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).
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.
I was experimenting with this past weekend and I kinda got results I needed (similar to my video made with old engine).
However, the issue now that my sky sphere is unlit material, while same sky sphere image blended with terrain material is Default Lit. With that, you can still see the edge of the mesh, even though it looks like terrain blends gradually into sky.
Having default lit material, is it possible to make one of the several textures being blended via vertex colors to appear unlit? (this way it will match perfectly with unlit sky material material)
You should be able to simply lerp to your emissive cubemap while lerping to 0 for basecolor and specular on that material and it should just work. Just use worldposition for the UVs of the cubemap. Paragon used something similar to have tall rock spires disappear up into the sky.
Did that too, but hue of the blended sky sphere doesn’t match hue of the actual sky sphere. Blender sky sphere is more vivid for no apparent reason (except maybe due to lightmaps).
If the sky itself is also the same cubemap then I am not sure what the issue would be, other than perhaps different values of fog being written for each surface. Try disabling all fog for now.