<?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 — Load and overlay images over tiles with zoom scale and color fade]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2321</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2321&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Load and overlay images over tiles with zoom scale and color fade.]]></description>
		<lastBuildDate>Mon, 30 Dec 2024 07:50:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9749#p9749</link>
			<description><![CDATA[<p>If you have an amount number of textures, you cannot use the shader way.<br />In that case you need to use this way:<br /><a href="https://forum.infinity-code.com/viewtopic.php?pid=6419#p6419">https://forum.infinity-code.com/viewtop … 6419#p6419</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 30 Dec 2024 07:50:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9749#p9749</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9748#p9748</link>
			<description><![CDATA[<p>Thanks Alex.</p><p>You mean like the TilesetWithOverlay7.shader example for 7 property block from _OverlayTex? <br />See Thread: <a href="https://forum.infinity-code.com/viewtopic.php?id=2185">https://forum.infinity-code.com/viewtopic.php?id=2185</a></p><p>In my case I have an unknown amount of textures which I need to placed as an overlay over those tiles (Lon, Lat) as it already works with this examples you provided? </p><p>I hope this makes it clearer. Thanks again for all your help.</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Sun, 29 Dec 2024 20:15:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9748#p9748</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9747#p9747</link>
			<description><![CDATA[<p>You need to modify both the shader and the script.<br />In the shader you need to copy-paste the property block from _OverlayTex and below, with new names.<br />Add the use of the new properties to the surf method.<br />Then modify the script to use the new properties.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 28 Dec 2024 21:00:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9747#p9747</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9745#p9745</link>
			<description><![CDATA[<p>Hi Alex,</p><p>I was just wondering what you meant with &quot;The second example that uses shaders is actually for a single texture, but this can be modified for multiple textures.&quot;</p><p>A. To directly modifiy the shader for multiple textures?<br />or<br />B. Modify the script to user multiple textures with the shader?</p><p>And is there an example for that?</p><p>Many thanks!</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Fri, 27 Dec 2024 03:53:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9745#p9745</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9697#p9697</link>
			<description><![CDATA[<p>You need to modify the shader to add color support. Something like:<br /></p><div class="codebox"><pre><code>Shader &quot;Infinity Code/Online Maps/Tileset With Overlay&quot; 
{
    Properties 
    {
        _Color(&quot;Main Color&quot;, Color) = (1,1,1,1)
        _MainTex(&quot;Base (RGB) Trans (A)&quot;, 2D) = &quot;white&quot; {}
        _OverlayBackTex(&quot;Overlay Back Texture&quot;, 2D) = &quot;black&quot; {}
        _OverlayBackAlpha(&quot;Overlay Back Alpha&quot;, Range(0, 1)) = 1
        _TrafficTex(&quot;Traffic Texture&quot;, 2D) = &quot;black&quot; {}
        _OverlayFrontTex(&quot;Overlay Front Texture&quot;, 2D) = &quot;black&quot; {}
        _OverlayFrontAlpha(&quot;Overlay Front Alpha&quot;, Range(0, 1)) = 1
        
        _OverlayTex(&quot;Overlay Texture&quot;, 2D) = &quot;black&quot; {}
        _OverlayColor(&quot;Overlay Color&quot;, Color) = (1,1,1,1)
        _OverlayAlpha(&quot;Overlay Alpha&quot;, Range(0, 1)) = 1
        _OverlayTL(&quot;Overlay Top Left&quot;, Vector) = (0, 0, 0, 0)
        _OverlayBR(&quot;Overlay Bottom Right&quot;, Vector) = (1, 1, 0, 0)
    }

    SubShader 
    {
        Tags {&quot;Queue&quot;=&quot;AlphaTest-300&quot; &quot;IgnoreProjector&quot;=&quot;True&quot; &quot;RenderType&quot;=&quot;TransparentCutout&quot;}
        LOD 200

        CGPROGRAM
        #pragma surface surf Lambert alphatest:_Cutoff 

        sampler2D _MainTex;
        sampler2D _OverlayBackTex;
        half _OverlayBackAlpha;
        sampler2D _TrafficTex;
        sampler2D _OverlayFrontTex;
        half _OverlayFrontAlpha;
        fixed4 _Color;

        sampler2D _OverlayTex;
        fixed4 _OverlayColor;
        half _OverlayAlpha;
        float4 _OverlayTL;
        float4 _OverlayBR;

        struct Input
        {
            float2 uv_MainTex;
            float2 uv_OverlayBackTex;
            float2 uv_TrafficTex;
            float2 uv_OverlayFrontTex;
            float3 worldPos;
        };

        void surf(Input IN, inout SurfaceOutput o)
        {
            fixed4 c = tex2D(_MainTex, IN.uv_MainTex);

            fixed4 t = tex2D(_OverlayBackTex, IN.uv_OverlayBackTex);
            fixed3 ct = lerp(c.rgb, t.rgb, t.a * _OverlayBackAlpha);

            t = tex2D(_TrafficTex, IN.uv_TrafficTex);
            ct = lerp(ct, t.rgb, t.a);

            t = tex2D(_OverlayFrontTex, IN.uv_OverlayFrontTex);
            ct = lerp(ct, t.rgb, t.a * _OverlayFrontAlpha);

            ct = ct * _Color;
            
            o.Albedo = ct;
            o.Alpha = c.a * _Color.a;

            float3 wp = IN.worldPos;
            
            float uvx = (wp.x - _OverlayTL.x) / (_OverlayBR.x - _OverlayTL.x);
            float uvy = (wp.z - _OverlayBR.z) / (_OverlayTL.z - _OverlayBR.z);

            if (uvx &gt;= 0 &amp;&amp; uvx &lt;= 1 &amp;&amp; uvy &gt;= 0 &amp;&amp; uvy &lt;= 1)
            {
                t = tex2D(_OverlayTex, float2(uvx, uvy));
                fixed3 ct2 = lerp(t.rgb, _OverlayColor.rgb, _OverlayColor.a);
                o.Albedo = lerp(ct, ct2, t.a * _OverlayAlpha);
            }
        }
        ENDCG
    }

    Fallback &quot;Transparent/Cutout/Diffuse&quot;
}</code></pre></div><p>P.S. I haven&#039;t tested this change in the shader, but it&#039;s very likely to work.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 01 Nov 2024 17:47:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9697#p9697</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9695#p9695</link>
			<description><![CDATA[<p>Thanks Alex.</p><p>With those examples I am not able to change the colors at the moment, but the alpha update works. </p><p>I have tried with TilesetWithOverlay.shader and TilesetWithOverlay2.shader:</p><p>&nbsp; &nbsp; &nbsp;tilesetOverlay.material.SetColor(&quot;_Color&quot;, color);<br />&nbsp; &nbsp; &nbsp;tilesetOverlay.material.SetColor(&quot;_OverlayColor&quot;, color);</p><p>Any suggestions?</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Fri, 01 Nov 2024 10:31:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9695#p9695</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9677#p9677</link>
			<description><![CDATA[<p>Hi.</p><p>Examples:<br /><a href="https://forum.infinity-code.com/viewtopic.php?pid=9223#p9223">https://forum.infinity-code.com/viewtop … 9223#p9223</a><br /><a href="https://forum.infinity-code.com/viewtopic.php?id=2142">https://forum.infinity-code.com/viewtopic.php?id=2142</a></p><p>The second example that uses shaders is actually for a single texture, but this can be modified for multiple textures.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 18 Oct 2024 19:58:21 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9677#p9677</guid>
		</item>
		<item>
			<title><![CDATA[Load and overlay images over tiles with zoom scale and color fade]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9676#p9676</link>
			<description><![CDATA[<p>Hi Alex,</p><p>I am not sure if there is an example or solution for this requirements.</p><p>1. We need to load multiple images and overlay those images over tiles (1 degree long and lat).<br />2. Those need to also zoom in and out accordingly when we zoom the map in and out.<br />3. And finally we need be able to change color and fade the alpha value as well.</p><p>Is all this possible?</p><p>Thanks again!</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Thu, 17 Oct 2024 23:55:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9676#p9676</guid>
		</item>
	</channel>
</rss>
