Topic: A copy of the the map and the horizon with flipped normals (?!)

Hello, I have a problem that I'm trying to figure out how to solve:
I'm drawing a route on the map through GPX. This route is very long, it extend on the horizon for kilometers, and several mountains.
I'm not getting waypoints elevation from GPX, but I'm getting the elevation from the map for each waypoint. Despite this, to not have route/map intersections (the route go under the map) I have to use a shader that always draw the route on top of everything else (I've tried to move each waypoint a bit over the map (10meters) but still I have route/map intersections).
My problem is that this way the route is (obviuosly) always visible, and it's not occluded by the mountains when it should be.
So, I can't use a standard shader because my route sometimes go under the map, but with this "draw-on-top" shader it is never occluded by the mountains.
So, my crazy idea would be to create a copy on fly of the map and the horizon, flip their normals, and use them to cutout in some way the route... quite weird but I can't figure out another solution.
Maybe is it possible? Or, maybe, do you have a better suggestion?
Many thanks!!

Re: A copy of the the map and the horizon with flipped normals (?!)

Hello.

I would just move Map / Drawings GameObject a little higher (position.y).
This will solve the problem that the route is under the map, and at the same time it will work correctly with the mountains.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: A copy of the the map and the horizon with flipped normals (?!)

I did it (more than 10/15 meters) but still here and there the route goes under the map.
If I increase the height to 30m it's ok, but the route fly over the map...

Re: A copy of the the map and the horizon with flipped normals (?!)

Please send me a script that draws the route and your waypoints.
I'll think about how to work around this problem.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

5 (edited by danielesuppo 2019-07-16 12:48:57)

Re: A copy of the the map and the horizon with flipped normals (?!)

WOW! Many thanks!
Actually there's a bounch of scripts that do that.
I've sent you "GPX.UnityPackage" with Wetransfer.
Just drag "GPX" prefab from "GPX" folder in the Hierarchy, press play and it will create a route and will zoom to it.
The script that do the route is "TrackLineController", that is instanciated by "TrackLineManager" (I have to manage multiple tracks).
P.S. I'm using Vectrosity to draw the route instead of LineRenderer because I want some texture on it and I don't want the route to disappear on the horizon with perspective

Re: A copy of the the map and the horizon with flipped normals (?!)

I did some tests, and I think Vectrosity is not suitable for this use.
This has some strange behavior when the camera rotates (the position of the map remains the same), and draws a line either under the map or over the map.
In addition, it has visual artifacts at close points.
I'm not saying that Vectrosity is a bad asset. Just for this use it is not suitable.

The built-in drawing api (line) looks much better, and with Drawing (GameObject) position.y = 3, the problem is completely solved.
Line may exist outside the map view:

line.checkMapBoundaries = false;

Line may have a texture for Tileset:

line.texture = myTexture;

Possible alternatives:
- LineRenderer. I do not know why you wrote that it will not be displayed outside the map. Most likely you meant the built-in Drawing API.
- Draw your route using cylinders. It will look cool, but most likely it will work slowly.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: A copy of the the map and the horizon with flipped normals (?!)

Thanks a lot!
You are right, with Vectrosity there are visual artifacts at close points, I know.
What I mean, with LineRenderer, is that the width of the line decrease due to perpective, so the width of the line is larger near the camera, and thinner on the horizon, and it's not what I want.
I definetely give a try with with the drawing api.
1) How can I update the points of the line when I zoom/pan the map? Do I have to destroy the line and create a new one? Or there's a method to just push the new points (like with vectrosity and linerenderer)?
2) Is it possible to choose to use a tiled texture or a stretched texture?

Re: A copy of the the map and the horizon with flipped normals (?!)

Using Drawing API, the line thickness will also decrease due to the perspective.

1. Just set new line.points.
http://infinity-code.com/doxygen/online … 567b781f3e
2. No.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.