In my surf() method how can I get Tiling information about the material?
Shader "mrpmorris/Scrolling shader" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_NormalTex("Normap map", 2D) = "bump" {}
_ScrollXSpeed("X scroll speed", Range(-10, 10)) = 0
_ScrollYSpeed("Y scroll speed", Range(-10, 10)) = -0.4
_NormalMapIntensity("Normal map intensity", Range(0, 1)) = 1
}
SubShader{
Tags{ "RenderType" = "Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
sampler2D _NormalTex;
//uniform float4 _NormalTex_ST;
fixed _ScrollXSpeed;
fixed _ScrollYSpeed;
fixed _NormalMapIntensity;
struct Input {
float2 uv_MainTex;
float2 uv_NormalTex;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
void surf(Input IN, inout SurfaceOutputStandard o) {
fixed offsetX = _ScrollXSpeed * _Time;
fixed offsetY = _ScrollYSpeed * _Time;
fixed2 mainUV = IN.uv_MainTex + fixed2(offsetX, offsetY);
offsetX = _ScrollXSpeed * _Time * _NormalTex_ST.x;
offsetY = _ScrollYSpeed * _Time * _NormalTex_ST.y;
fixed2 normalUV = IN.uv_NormalTex + fixed2(offsetX, offsetY);
// Albedo comes from a texture tinted by color
fixed4 c = tex2D(_MainTex, mainUV) * _Color;
o.Albedo = c.rgb;
float4 normalPixel = tex2D(_NormalTex, normalUV);
float3 n = UnpackNormal(normalPixel);
n.x *= _NormalMapIntensity;
n.y *= _NormalMapIntensity;
o.Normal = n.xyz;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}