<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Bounds for a texture overlay ?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2050</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2050&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Bounds for a texture overlay ?.]]></description>
		<lastBuildDate>Tue, 25 Oct 2022 16:47:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8700#p8700</link>
			<description><![CDATA[<p>Hmm... interesting.</p><p>This can be done in this way:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class SetRenderQueueOffset : MonoBehaviour
{
    public int renderQueueOffset = 100;

    private void Start()
    {
        foreach (OnlineMapsDrawingElement el in OnlineMapsDrawingElementManager.instance)
        {
            el.renderQueueOffset = renderQueueOffset;
        }
        OnlineMapsDrawingElementManager.OnAddItem += OnAddItem;
    }

    private void OnAddItem(OnlineMapsDrawingElement element)
    {
        element.renderQueueOffset = renderQueueOffset;
    }
}</code></pre></div><p>On my side this way works well.<br />The overlay and drawing element used a TilesetDrawingElement shader.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 25 Oct 2022 16:47:25 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8700#p8700</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8698#p8698</link>
			<description><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>The package contains TilesetDrawingElementZTestAlways and TilesetDrawingElementZOffset.<br />Just use select one of them in Tileset / Material &amp; Shaders / Drawing Shader.</p></blockquote></div><p>Hello, the same with both shaders, the overlay is still over - and masking - the drawing element (tested with a map without elevation).</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Tue, 25 Oct 2022 16:04:07 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8698#p8698</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8697#p8697</link>
			<description><![CDATA[<p>The package contains TilesetDrawingElementZTestAlways and TilesetDrawingElementZOffset.<br />Just use select one of them in Tileset / Material &amp; Shaders / Drawing Shader.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 25 Oct 2022 09:18:19 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8697#p8697</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8695#p8695</link>
			<description><![CDATA[<p>Hello,</p><div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>You can adjust the drawing order using the Z Offset shader.<br /><a href="https://docs.unity3d.com/Manual/SL-Offset.html">https://docs.unity3d.com/Manual/SL-Offset.html</a></p></blockquote></div><p>I absolutely don&#039;t know anything about shaders, so I added these lines to the TilesetDrawingElement shader <br />(the shader used by the drawed line)<br />______________________<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Pass</p><p>&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Sets the depth offset for this geometry so that the GPU draws this geometry closer to the camera<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // You would typically do this to avoid z-fighting<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Offset - 1, 1</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // The rest of the code that defines the Pass goes here.<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />_______________</p><p>It works fine in the editor, but when I try to build I get these 2 errors :</p><p>Shader error in &#039;&#039;: Parse error: syntax error, unexpected &#039;-&#039;, expecting TVAL_VARREF or TVAL_NUMBER at line 45</p><p>Error building Player: Shader error in &#039;&#039;: Parse error: syntax error, unexpected &#039;-&#039;, expecting TVAL_VARREF or TVAL_NUMBER at line 45</p><p>I get the same error message in the inspector.<br />Ths modified shader is attached.</p><div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Set the desired OnlineMapsDrawingLine.width or OnlineMapsDrawingPoly.borderWidth, depending on whether it&#039;s a line or a polygon, and invoke a map redraw.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsDrawingLine.html#a5b1bd790eb30c32208063b840ed4c5aa">https://infinity-code.com/doxygen/onlin … 840ed4c5aa</a><br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsDrawingPoly.html#aa3d012bd6369de9d147ade1c8ee80456">https://infinity-code.com/doxygen/onlin … 1c8ee80456</a></p></blockquote></div><p>I found a workaround calculating the thickness with the zoom level and drawing each time the zoom is changed.</p><p>Best regards, Philippe</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Mon, 24 Oct 2022 21:51:52 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8695#p8695</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8691#p8691</link>
			<description><![CDATA[<p>You can adjust the drawing order using the Z Offset shader.<br /><a href="https://docs.unity3d.com/Manual/SL-Offset.html">https://docs.unity3d.com/Manual/SL-Offset.html</a></p><p>Set the desired OnlineMapsDrawingLine.width or OnlineMapsDrawingPoly.borderWidth, depending on whether it&#039;s a line or a polygon, and invoke a map redraw.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsDrawingLine.html#a5b1bd790eb30c32208063b840ed4c5aa">https://infinity-code.com/doxygen/onlin … 840ed4c5aa</a><br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsDrawingPoly.html#aa3d012bd6369de9d147ade1c8ee80456">https://infinity-code.com/doxygen/onlin … 1c8ee80456</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 24 Oct 2022 09:15:08 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8691#p8691</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8686#p8686</link>
			<description><![CDATA[<p>Thanks Alex, I will try, but for now as it works with a single texture, I prefer to disable the elevation.<br />I display a drawed spline (generated with DrawText) and when the overlay is displayed too, the spline remains behind. Is there a way to show the spline over the overlay ?<br />Here a 7 seconds video : <a href="https://youtu.be/IgR49Ibw3qs">https://youtu.be/IgR49Ibw3qs</a></p><p>Is there a way to manage the thickness of such a a drawed spline when the zoom level is changed ? I can draw it again everytime the zoom is changed, but maybe there is faster way ?</p><p>Best regards, Phil</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Sun, 23 Oct 2022 17:25:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8686#p8686</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8683#p8683</link>
			<description><![CDATA[<p>This example will not work with elevations.<br />When you use elevations you need to split your overlay texture into tiles (using MapTiler for example) and use this way:<br /><a href="https://infinity-code.com/atlas/online-maps/pages/TilesetMapTilerOverlayExample.html">https://infinity-code.com/atlas/online- … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sun, 23 Oct 2022 11:44:40 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8683#p8683</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8681#p8681</link>
			<description><![CDATA[<p>Hello, thanks for the answer, I solved the issue !<br />It was because I used elevations, so the texture overlay was only visible with low zoom levels, when elevation were not used. So my question is : anyway to display the texture over a 3D OLMap ?<br />Philippe</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Sat, 22 Oct 2022 18:56:34 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8681#p8681</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8677#p8677</link>
			<description><![CDATA[<p>Hello.</p><p>I just tested this example and it works well on my side.<br />Please explain in detail what exactly you are doing and what is not working.<br />I think screenshots here will be very helpful.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 21 Oct 2022 19:19:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8677#p8677</guid>
		</item>
		<item>
			<title><![CDATA[Bounds for a texture overlay ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8672#p8672</link>
			<description><![CDATA[<p>Hello, I am trying to display an texture overlay over a specific region of an OLMap using the TilesetOverlayExample.cs, but I don’t understand how I can set the bounds so that it matches the map, as this is not a &quot;fullworld&quot; overlay.</p><p>I found in this topic <a href="https://forum.infinity-code.com/viewtopic.php?pid=6419#p6419">https://forum.infinity-code.com/viewtop … 6419#p6419</a> a script that contains bounds for lat and lng, but it seems that it doesn’t work (TilesetOverlayExample2.cs)</p><p>Maybe I am wrong somewhere ?</p><p>Best regards, Philippe</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Fri, 21 Oct 2022 16:28:44 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8672#p8672</guid>
		</item>
	</channel>
</rss>
