Shader "Amplify Texture/Legacy Shaders/Parallax Diffuse" {
Properties {
	_Color ("Main Color", Color) = (1,1,1,1)
	_Parallax ("Height", Range (0.005, 0.08)) = 0.02
	_MainTex ("Base (RGB)", 2D) = "white" {}
	_BumpMap ("Normalmap", 2D) = "bump" {}
	_ParallaxMap ("Heightmap (A)", 2D) = "black" {}
	[HideInInspector] _VTInfoBlock( "VT (auto)", Vector ) = ( 0, 0, 0, 0 )
}

CGINCLUDE
#pragma target 3.0
#pragma glsl
#pragma multi_compile _ _VT_SINGLE_MODE
#include "Shared.cginc"

sampler2D _MainTex;
sampler2D _ParallaxMap;
fixed4 _Color;
float _Parallax;

struct Input {
	float2 uv_MainTex;
	float3 viewDir;
};

void surf (Input IN, inout SurfaceOutput o) {
	half h = tex2D (_ParallaxMap, IN.uv_MainTex.xy).w;
	float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);
	IN.uv_MainTex += offset;

	VirtualCoord vcoord = VTComputeVirtualCoord( IN.uv_MainTex.xy );
	fixed4 c = VTSampleAlbedo( vcoord ) * _Color;
	o.Albedo = c.rgb;
	o.Alpha = c.a;
	o.Normal = UnpackNormal(VTSampleNormal( vcoord ));
}
ENDCG

SubShader {
	Tags { "RenderType"="Opaque" "Amplify"="True" }
	LOD 500

	CGPROGRAM
	#pragma surface surf Lambert
	#pragma target 3.0
	ENDCG
}

SubShader {
	Tags { "RenderType"="Opaque" "Amplify"="True" }
	LOD 500

	CGPROGRAM
	#pragma surface surf Lambert nodynlightmap
	ENDCG
}

FallBack "Amplify Texture/Legacy Shaders/Bumped Diffuse"
CustomEditor "VirtualMaterialEditor"
}
