Re: Extend Online Maps to create a horizon
Here is another picture of what is happening
You are not logged in. Please login or register.
Infinity Code Forum → Tips & Tricks → Extend Online Maps to create a horizon
Here is another picture of what is happening
This is achieved by properly setting the fog (see the video in the first post) and Camera / Clipping Planes / Far.
Or you can hide the horizon border using a shader.
Hello again,
I have followed the video, the only thing that is different is that I used the skybox instead. Could this be the problem? If yes, where can I find the same skybox material used in the video?
Also, If this info is in this thread and I missed I'm sorry, but could you tell me how can I hide the horizon border using a shader?
The other thing that I think would solve my problem is limiting the rotation on x, but when I changed the maxRotationX on the Camera Orbit script it does nothing. Could you tell me what I can do to limit the rotation on x?
In this picture, I removed the Horizon 2_Bing Maps. So we can check what happens if I zoom in max 15 and also rotate to the sides. Is there a way that I can just show the rest of the map, instead cropping like is doing now?
I used these skyboxes:
https://assetstore.unity.com/packages/2 … x-one-6332
How to make horizon fade using shader:
https://www.dropbox.com/s/f0e0w8sdlgdql … e.mp4?dl=0
Tileset Fade Shader in post #4.
Horizon Fade Shader (it's just a slightly modified version of Tileset Fade Shader):
Shader "Infinity Code/Online Maps/Horizon Fade Shader"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
_OverlayBackTex("Overlay Back Texture", 2D) = "black" {}
_OverlayBackAlpha("Overlay Back Alpha", Range(0, 1)) = 1
_TrafficTex("Traffic Texture", 2D) = "black" {}
_OverlayFrontTex("Overlay Front Texture", 2D) = "black" {}
_OverlayFrontAlpha("Overlay Front Alpha", Range(0, 1)) = 1
}
SubShader
{
Tags{ "Queue" = "Transparent-200" "IgnoreProjector" = "True" "RenderType" = "Opaque" }
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 = 2600;
float fadeRange = 1024;
float3 center = float3(tilesetSizeX / -2, 0, tilesetSizeY / 2);
float3 wp = mul(unity_WorldToObject, float4(IN.worldPos, 1)).xyz;
float3 dist = center - float3(wp.x, 0, wp.z);
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"
}
Unfortunately, I did not understand why you rotated the map in post #54.
You definitely don't need to do this.
Thanks!!!!!
Hello,
I just purchased the Online Maps v3 from the Unity asset store and trying to implement the horizon. I am using version 3.9.3.1
I have a couple issues, I was not able to find the horizon scripts from the video. The only one I can find is the "HorizonWithoutElevation". Is this the script I should be using?
Next, I use the Universal Render Pipeline, and the legacy shaders are not rendering (showing magenta). What shader should I use that will work with the URP?
As a test I am using "TileSetPBRShader" but that has strange results when zooming in and out. I have added a screen clip of my map and horizon settings. Here is a link to a video demonstrating the issues with the test shader... https://app.screencast.com/fKIIWkeE4J0oA
When I used the map wizard to create the map I enabled Mapbox elevations. Could this be creating the rendering issues? Is there a way to have elevations and a horizon?
Hello.
Horizon scripts with elevations in the first post.
Thank you very much for the bug report.
The problem has been fixed.
The scripts in the first post have been updated.
If you need updated HorizonWithoutElevation script, please contact me by email (support@infinity-code.com) and I will send it to you.
Infinity Code Forum → Tips & Tricks → Extend Online Maps to create a horizon
Powered by PunBB, supported by Informer Technologies, Inc.