Hello,
I’ve bought SpriterLamp and I want to try it with Unity. I’ve downloaded the shaders from the website here and it seems that the tiling is not enabled. I know nothing about shaders (just the theory of how it works) but after researches, I found how to include the tilling in the shader so I turn this :
struct VertexInput
{
float4 vertex : POSITION;
float4 color : COLOR;
float4 uv : TEXCOORD0;
};
struct VertexOutput
{
float4 pos : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
float4 posWorld : TEXCOORD1;
float4 posLight : TEXCOORD2;
};
VertexOutput vert(VertexInput input)
{
VertexOutput output;
output.pos = mul(UNITY_MATRIX_MVP, input.vertex);
output.posWorld = mul(_Object2World, input.vertex);
output.uv = input.uv.xy;
output.color = input.color;
output.posLight = mul(_LightMatrix0, output.posWorld);
return output;
}
into this :
struct VertexInput
{
float4 vertex : POSITION;
float4 color : COLOR;
float4 uv : TEXCOORD0;
};
struct VertexOutput
{
float4 pos : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
float4 posWorld : TEXCOORD1;
float4 posLight : TEXCOORD2;
};
VertexOutput vert(VertexInput input)
{
VertexOutput output;
output.pos = mul(UNITY_MATRIX_MVP, input.vertex);
output.posWorld = mul(_Object2World, input.vertex);
output.uv = input.uv.xy * _MainTex_ST.xy + _MainTex_ST.zw;
output.color = input.color;
output.posLight = mul(_LightMatrix0, output.posWorld);
return output;
}
Unfortunately it is not so simple and the result is this :
The goal is to use a big quad for the background instead of many little quads but the texture is not repeated. Do you have any clue t oresolve this problem?