Topic: Extend Online Maps to create a horizon

Example of how to extend the map area to make a beautiful horizon.
In addition, this script shows how to use elevations from Mapbox.

Post's attachments

Attachment icon Horizon2.cs 12.36 kb, 49 downloads since 2018-04-03 

Kind Regards,
Infinity Code Team

Re: Extend Online Maps to create a horizon

excellent!

Re: Extend Online Maps to create a horizon

works well so far, nice effect. however i am not using elevation at the moment.
could you explain what the inspector options do? Also, there is a noticeable line from "normal" map to horizon map, any way to blend it a little more?

Re: Extend Online Maps to create a horizon

Updated the script in the first post.
Fixed minor bugs, added description and tooltips for all public fields.

Yes, you can blend it for example in this way (Online Maps Tileset Control / Materials & Shaders / Tile Shader):

Shader "Infinity Code/Online Maps/Tileset Fade Shader"
{
    Properties
    {
        _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
    }

    SubShader
    {
        Tags{ "Queue" = "Transparent-100" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
        LOD 200

        CGPROGRAM
#pragma surface surf Lambert alpha

        sampler2D _MainTex;

        struct Input
        {
            float2 uv_MainTex;
            float3 worldPos;
        };

        void surf(Input IN, inout SurfaceOutput o)
        {
            float tilesetSizeX = 1024;
            float tilesetSizeY = 1024;
            float startFadeDist = 480;
            float fadeRange = 32;

            float3 center = float3(tilesetSizeX / -2, 0, tilesetSizeY / 2);

            float3 dist = center - IN.worldPos;
            float len = length(dist);
            float scale = (len - startFadeDist) / fadeRange;

            o.Alpha = saturate(1 - scale);

            fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb;
        }
        ENDCG
    }

    Fallback "Transparent/Cutout/Diffuse"
}
Kind Regards,
Infinity Code Team