Not really sure what the problem is...

Sorry for the undescriptive title :frowning:

I’m just going to post this shader, and hope someone can tell me what I’m doing wrong…

Shader "Custom/CursorRenderer" {
	Properties {
		_Texture0("Layer 0 Texture",2D)=""{}
		_Texture1("Layer 1 Texture",2D)=""{}
		_Texture2("Layer 2 Texture",2D)=""{}
		_Texture3("Layer 3 Texture",2D)=""{}
		_Scale("Texture Scaling",Float)=1
		_Mixture("Mixture",Color)=(0,0,0,0)
	}
	SubShader {
		Tags { "RenderType" = "Opaque" }
		CGPROGRAM
		#pragma surface Surf Lambert

		float4 _Mixture;
		sampler2D _Texture0;
		sampler2D _Texture1;
		sampler2D _Texture2;
		sampler2D _Texture3;
		float _Scale;
		struct Input {
			float2 Texture_uv;
		};
			
		void Surf(Input IN,inout SurfaceOutput o) {
			fixed4 col0=tex2D(_Texture0,IN.Texture_uv/_Scale);
			fixed4 col1=tex2D(_Texture1,IN.Texture_uv/_Scale);
			fixed4 col2=tex2D(_Texture2,IN.Texture_uv/_Scale);
			fixed4 col3=tex2D(_Texture3,IN.Texture_uv/_Scale);
			col0.r*=_Mixture.r;
			col0.g*=_Mixture.r;
			col0.b*=_Mixture.r;
			col1.r*=_Mixture.g;
			col1.g*=_Mixture.g;
			col1.b*=_Mixture.g;
			col2.r*=_Mixture.b;
			col2.g*=_Mixture.b;
			col2.b*=_Mixture.b;
			col3.r*=_Mixture.a;
			col3.g*=_Mixture.a;
			col3.b*=_Mixture.a;
			col0+=col1;
			col0+=col2;
			col0+=col3;
			o.Albedo=col0;
			o.Alpha=1.0;
		}
		ENDCG
	} 
}

The errors right now are saying things don’t have a property called ‘…’ basically list every property which is in there…

When I fix that I get other errors including one nasty one which starts with an X followed by 4 more digits…

It doesn’t seem to matter what I do, I go through a list of about 6 different errors - I fix one - get to the next - and when I reach the end of the list, I arrive back at the first one… while I’m probably just unlucky, I can’t seem to break the cyclic redundancies of google…

Edit: the nasty error is X5204 Read of uninitialized components in r0, r1 and r2…I get that by changing from fixed point to float4 in the first 4 lines of Surf…

Can’t be too sure, maybe to do with:

float2 Texture_uv;

As there is no texture in the properties called Texture, try:

float2 Texture0_uv;
...
 fixed4 col0=tex2D(_Texture0,IN.Texture0_uv/_Scale);

Obviously, this will only use the texture UVs from the inspector of the first Texture0 for all the other textures, but if they all use the same tiling/UV offsets it should be okay.

Shader "Custom/Blend" {
	Properties {
		_Tex0 ("Texture Layer 0", 2D) = "white" {}
		_Tex1 ("Texture Layer 1", 2D) = "white" {}
		_Tex2 ("Texture Layer 2", 2D) = "white" {}
		_Tex3 ("Texture Layer 3", 2D) = "white" {}
		_Scle ("Scale",Float)=1
		_Mixt ("Mixture",Vector)=(0,0,0,0)
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		
		CGPROGRAM
		#pragma surface surf Lambert

		sampler2D _Tex0;
		sampler2D _Tex1;
		sampler2D _Tex2;
		sampler2D _Tex3;
		float _Scle;
		float4 _Mixt;

		struct Input {
			float2 uv_Tex : TEXCOORD;
		};

		void surf (Input IN, inout SurfaceOutput o) {
			float2 uvs=IN.uv_Tex;
			uvs/=_Scle;
			float4 c0=tex2D(_Tex0,uvs);
			float4 c1=tex2D(_Tex1,uvs);
			float4 c2=tex2D(_Tex2,uvs);
			float4 c3=tex2D(_Tex3,uvs);
			c0*=_Mixt.x;
			c1*=_Mixt.y;
			c2*=_Mixt.z;
			c3*=_Mixt.w;
			float4 c=c0+c1+c2+c3;
			o.Albedo = c.rgb;
			o.Alpha = 1.0;
		}
		ENDCG
	} 
	FallBack Off
}

It doesn’t error, but rather than copying and blending the textures, it is only taking one pixel and setting the color of the whole output…

How do I render the whole texture?

I figured it out…

I am now using the following code which is working…

Shader "Custom/Blend" {
	Properties {
		_Tex0 ("Texture Layer 0", 2D) = "white" {}
		_Tex1 ("Texture Layer 1", 2D) = "white" {}
		_Tex2 ("Texture Layer 2", 2D) = "white" {}
		_Tex3 ("Texture Layer 3", 2D) = "white" {}
		_Scle ("Scale",Float)=1
		_Mixt ("Mixture",Vector)=(0,0,0,0)
	}
	SubShader {
		Pass {
				
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag

			uniform sampler2D _Tex0;
			uniform sampler2D _Tex1;
			uniform sampler2D _Tex2;
			uniform sampler2D _Tex3;
			float _Scle;
			float4 _Mixt;

			struct Input {
				float4 vertex : POSITION;
				float4 uv_tex : TEXCOORD0;
			};
			struct Output {
				float4 pos : SV_POSITION;
				float4 tex: TEXCOORD0;
			};

			Output vert(Input input) {
				Output output;
				output.tex=input.uv_tex;
				output.pos=mul(UNITY_MATRIX_MVP, input.vertex);
				return output;
			}
	
			float4 frag (Output uvs) : COLOR {
				uvs.tex/=_Scle;
				float4 c0=tex2D(_Tex0,(float2)uvs.tex);
				float4 c1=tex2D(_Tex1,(float2)uvs.tex);
				float4 c2=tex2D(_Tex2,(float2)uvs.tex);
				float4 c3=tex2D(_Tex3,(float2)uvs.tex);
				c0*=_Mixt.x;
				c1*=_Mixt.y;
				c2*=_Mixt.z;
				c3*=_Mixt.w;
				return c0+c1+c2+c3;
			}
			ENDCG
		} 
	}
}

There were a few problems, the main reason I had my first problem was that I was not assigning a default texture to the textures… such as “White”…

EDIT:
Further more - case it helps someone else - you have to feed the UVs from the vertex shader to the fragment shader, else the fragment shader don’t know where its plotting the pixels…