#extension GL_ARB_shader_texture_lod : require float xll_dFdx_f(float f) { return dFdx(f); } vec2 xll_dFdx_vf2(vec2 v) { return dFdx(v); } vec3 xll_dFdx_vf3(vec3 v) { return dFdx(v); } vec4 xll_dFdx_vf4(vec4 v) { return dFdx(v); } mat2 xll_dFdx_mf2x2(mat2 m) { return mat2( dFdx(m[0]), dFdx(m[1])); } mat3 xll_dFdx_mf3x3(mat3 m) { return mat3( dFdx(m[0]), dFdx(m[1]), dFdx(m[2])); } mat4 xll_dFdx_mf4x4(mat4 m) { return mat4( dFdx(m[0]), dFdx(m[1]), dFdx(m[2]), dFdx(m[3])); } float xll_dFdy_f(float f) { return dFdy(f); } vec2 xll_dFdy_vf2(vec2 v) { return dFdy(v); } vec3 xll_dFdy_vf3(vec3 v) { return dFdy(v); } vec4 xll_dFdy_vf4(vec4 v) { return dFdy(v); } mat2 xll_dFdy_mf2x2(mat2 m) { return mat2( dFdy(m[0]), dFdy(m[1])); } mat3 xll_dFdy_mf3x3(mat3 m) { return mat3( dFdy(m[0]), dFdy(m[1]), dFdy(m[2])); } mat4 xll_dFdy_mf4x4(mat4 m) { return mat4( dFdy(m[0]), dFdy(m[1]), dFdy(m[2]), dFdy(m[3])); } vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return texture2DLod( s, coord.xy, coord.w); } vec4 xll_texCUBElod(samplerCube s, vec4 coord) { return textureCubeLod( s, coord.xyz, coord.w); } mat2 xll_transpose_mf2x2(mat2 m) { return mat2( m[0][0], m[1][0], m[0][1], m[1][1]); } mat3 xll_transpose_mf3x3(mat3 m) { return mat3( m[0][0], m[1][0], m[2][0], m[0][1], m[1][1], m[2][1], m[0][2], m[1][2], m[2][2]); } mat4 xll_transpose_mf4x4(mat4 m) { return mat4( m[0][0], m[1][0], m[2][0], m[3][0], m[0][1], m[1][1], m[2][1], m[3][1], m[0][2], m[1][2], m[2][2], m[3][2], m[0][3], m[1][3], m[2][3], m[3][3]); } float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(mat3 m) { return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); } mat4 xll_saturate_mf4x4(mat4 m) { return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); } vec2 xll_matrixindex_mf2x2_i (mat2 m, int i) { vec2 v; v.x=m[0][i]; v.y=m[1][i]; return v; } vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; } vec4 xll_matrixindex_mf4x4_i (mat4 m, int i) { vec4 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; v.w=m[3][i]; return v; } #line 106 struct MySurfaceOutput { vec3 Albedo; vec3 Normal; vec3 Emission; vec3 Specular; float Reflectivity; float Roughness; float Alpha; }; #line 244 struct ContinuousSamplerLOD { float mip0; float mip1; float mipFrac; }; #line 259 struct PlanarMapping { vec4 plane; vec3 tangent; vec3 bitangent; vec2 uvOffset; }; #line 93 struct Input { vec2 uv_MainTex; vec2 uv_BumpMap; vec3 viewDir; vec3 worldPos; vec3 worldNormal; vec3 worldRefl; vec3 TtoW0; vec3 TtoW1; vec3 TtoW2; }; #line 398 struct v2f_surf { vec4 pos; vec4 pack0; vec3 worldPos; vec3 viewDir; vec4 TtoW0; vec4 TtoW1; vec4 TtoW2; vec3 lightDir; vec3 vlight; vec2 _LightCoord; }; #line 17 struct appdata_full { vec4 vertex; vec4 tangent; vec3 normal; vec4 texcoord; vec4 texcoord1; vec4 color; }; uniform vec3 _WorldSpaceCameraPos; uniform vec4 _WorldSpaceLightPos0; #line 3 uniform vec4 unity_SHAr; uniform vec4 unity_SHAg; uniform vec4 unity_SHAb; uniform vec4 unity_SHBr; #line 7 uniform vec4 unity_SHBg; uniform vec4 unity_SHBb; uniform vec4 unity_SHC; uniform mat4 glstate_matrix_mvp; #line 11 uniform mat4 glstate_matrix_modelview0; uniform mat4 _Object2World; uniform mat4 _World2Object; uniform vec4 unity_Scale; #line 15 uniform mat4 glstate_matrix_projection; uniform vec4 glstate_lightmodel_ambient; #line 27 #line 32 #line 37 #line 41 #line 46 #line 85 uniform vec4 _LightColor0; uniform vec4 _SpecColor; uniform sampler2D _LightTexture0; uniform mat4 _LightMatrix0; #line 117 uniform float _Rolloff; #line 122 #line 126 uniform float _Falloff; #line 212 uniform float _Roughness; uniform float _Roughness2; #line 220 uniform float _Reflectivity; uniform float _Refl0; uniform float _Refl90; uniform float _Metalic; uniform float _SpecOnlyIntensity; #line 224 uniform float _ReflOnlyIntensity; #line 251 #line 255 #line 267 uniform mat4 _WorldToMirrorProjMatrix; uniform sampler2D _MirrorTex; #line 293 uniform vec4 _PlanarReflection0; uniform vec4 _PlanarReflectionTangent0; uniform vec4 _PlanarReflectionBiTangent0; #line 333 uniform sampler2D _PlanarReflectionTex0; uniform vec4 _PlanarReflection1; uniform vec4 _PlanarReflectionTangent1; uniform vec4 _PlanarReflectionBiTangent1; uniform sampler2D _PlanarReflectionTex1; #line 337 uniform vec4 _PlanarReflection2; uniform vec4 _PlanarReflectionTangent2; uniform vec4 _PlanarReflectionBiTangent2; uniform sampler2D _PlanarReflectionTex2; uniform samplerCube _Cube; #line 341 uniform sampler2D _MainTex; uniform sampler2D _BumpMap; uniform sampler2D _BumpMap2; #line 373 uniform sampler2D _MainReflectivityTex; uniform sampler2D _MainRoughnessTex; uniform vec4 _BumpMap2_ST; uniform vec4 _Color; uniform vec4 _ReflColor; #line 377 uniform float _BumpMapFactor; uniform float _BumpMapFactor2; uniform vec4 _MainReflectivityTex_AddMul; uniform vec4 _MainRoughnessTex_AddMul; #line 412 uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; #line 440 #line 122 float BlinnTermWithRolloff( in vec3 normal, in vec3 halfDir ) { return (max( 0.0, (dot( normal, halfDir) + (_Rolloff * 2.0))) / (1.0 + (_Rolloff * 2.0))); } #line 132 float CTGeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH ) { #line 134 return min( 1.0, min( (((2.0 * NdotH) * NdotV) / VdotH), (((2.0 * NdotH) * NdotL) / VdotH))); } #line 136 float CTRoughnessTerm( in float roughness, in float NdotH ) { #line 138 float mSq = (roughness * roughness); float a = (1.0 / ((4.0 * mSq) * pow( NdotH, 4.0))); float b = ((NdotH * NdotH) - 1.0); float c = ((mSq * NdotH) * NdotH); #line 142 return (a * exp((b / c))); } #line 127 float FresnelTerm( in float refl0, in float refl90, in float cosA ) { float t = pow( abs((1.0 - cosA)), _Falloff); #line 130 return ((refl0 * (1.0 - t)) + (refl90 * t)); } #line 118 float LambertTermWithRolloff( in vec3 normal, in vec3 lightDir ) { return (max( 0.0, (dot( normal, lightDir) + _Rolloff)) / (1.0 + (_Rolloff * 2.0))); } #line 144 float CookTorranceTerm( in float roughness, in float refl0, in float refl90, in vec3 normal, in vec3 lightDir, in vec3 viewDir ) { #line 146 vec3 halfDir = normalize((lightDir + viewDir)); float nl = LambertTermWithRolloff( normal, lightDir); float nh = BlinnTermWithRolloff( normal, halfDir); float nv = max( 0.0, dot( normal, viewDir)); #line 150 float vh = max( 0.0, dot( viewDir, halfDir)); float F = FresnelTerm( refl0, refl90, vh); float G = CTGeometricTerm( nl, nh, nv, vh); float R = CTRoughnessTerm( roughness, nh); #line 154 R = max( 0.0, R); return max( 0.0, (((F * G) * R) / (nv * nl))); } #line 157 float OrenNayarTerm( in float roughness, in vec3 normal, in vec3 lightDir, in vec3 viewDir ) { #line 159 const float PI = 3.14159; const float INVERSE_PI = 0.3183101; const float INVERSE_PI_SQ = 0.1013213; float rSq = (roughness * roughness); #line 163 float NdotL = LambertTermWithRolloff( normal, lightDir); float NdotV = dot( normal, viewDir); float a = max( acos(NdotV), acos(NdotL)); float b = min( acos(NdotV), acos(NdotL)); #line 167 float y = dot( (viewDir - (normal * NdotV)), (lightDir - (normal * NdotL))); float K1 = (rSq / (rSq + 0.33)); float K2 = (rSq / (rSq + 0.09)); float c1 = (1.0 - (0.5 * K1)); #line 171 float c2 = (0.45 * K2); c2 *= (sin(a) - (( (y >= 0.0) ) ? ( 0.0 ) : ( pow( ((2.0 * b) * 0.3183101), 3.0) ))); float c3 = ((0.125 * K2) * pow( (((4.0 * a) * b) * 0.1013213), 2.0)); float x = ((y * c2) * tan(b)); #line 175 float e = (((1.0 - abs(y)) * c3) * tan(((a + b) / 2.0))); return ((c1 + x) + e); } #line 225 vec4 LightingOrenNayar_CookTorrance( in MySurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) { vec3 normal = normalize(s.Normal); #line 228 lightDir = normalize(lightDir); viewDir = normalize(viewDir); float nl = LambertTermWithRolloff( normal, lightDir); float diffRoughness = _Roughness2; #line 232 float specRoughness = max( 0.02, (_Roughness * s.Roughness)); float refl0 = (_Refl0 * _Reflectivity); float refl90 = (_Refl90 * _Reflectivity); float spec = (CookTorranceTerm( specRoughness, refl0, refl90, normal, lightDir, viewDir) * _SpecOnlyIntensity); #line 236 vec3 specColor = ((_LightColor0.xyz * 2.0) * mix( s.Specular, (s.Specular * s.Albedo), vec3( _Metalic))); vec3 diffColor = (_LightColor0.xyz * 2.0); float diffScatter = OrenNayarTerm( diffRoughness, normal, lightDir, viewDir); vec4 c; #line 240 c.xyz = ((mix( ((s.Albedo * diffColor) * diffScatter), (specColor * spec), vec3( s.Reflectivity)) * nl) * atten); c.w = (s.Alpha + ((((length(specColor) * spec) * s.Reflectivity) * nl) * atten)); return c; } #line 212 vec3 CombineNormals( in vec3 n1, in vec3 n2 ) { vec3 n = normalize(n1); mat3 nBasis = xll_transpose_mf3x3(mat3( vec3( n.z, n.x, (-n.y)), vec3( n.x, n.z, (-n.y)), vec3( n.x, n.y, n.z))); #line 216 return normalize((((n2.x * xll_matrixindex_mf3x3_i (nBasis, 0)) + (n2.y * xll_matrixindex_mf3x3_i (nBasis, 1))) + (n2.z * xll_matrixindex_mf3x3_i (nBasis, 2)))); } #line 194 float EvalMipLevel( in vec3 uvw, in float texResolution ) { #line 196 vec3 dxSize = xll_dFdx_vf3(uvw); vec3 dySize = xll_dFdy_vf3(uvw); float fMipLevel; float fMinTexCoordDelta; #line 200 vec3 dTexCoords; dTexCoords = ((dxSize * dxSize) + (dySize * dySize)); fMinTexCoordDelta = (max( dTexCoords.z, max( dTexCoords.x, dTexCoords.y)) * texResolution); fMipLevel = max( (0.5 * log2(fMinTexCoordDelta)), 0.0); #line 204 return fMipLevel; } #line 255 vec4 texCUBEclod( in samplerCube s, in vec3 dir, in ContinuousSamplerLOD level ) { return mix( xll_texCUBElod( s, vec4( dir, level.mip0)), xll_texCUBElod( s, vec4( dir, level.mip1)), vec4( level.mipFrac)); } #line 274 vec4 SampleCubeReflection( in samplerCube s, in vec3 rayDir, in ContinuousSamplerLOD level ) { #line 276 return texCUBEclod( s, rayDir, level); } #line 251 vec4 tex2Dclod( in sampler2D s, in vec2 uv, in ContinuousSamplerLOD level ) { return mix( xll_tex2Dlod( s, vec4( uv, 0.0, level.mip0)), xll_tex2Dlod( s, vec4( uv, 0.0, level.mip1)), vec4( level.mipFrac)); } #line 269 vec4 SampleMirrorReflection( in vec3 worldPos, in ContinuousSamplerLOD level ) { #line 271 vec4 ppos = (_WorldToMirrorProjMatrix * vec4( worldPos, 1.0)); return tex2Dclod( _MirrorTex, (ppos.xy / ppos.w), level); } #line 278 vec4 SamplePlanarReflection( in sampler2D s, in PlanarMapping p, in vec3 rayStart, in vec3 rayDir, in ContinuousSamplerLOD level ) { #line 280 float Vd = (-dot( p.plane.xyz, rayDir)); if ((Vd < 0.0001)){ return vec4( 0.0, 0.0, 0.0, 0.0); } float Vo = (dot( p.plane.xyz, rayStart) + p.plane.w); float t = (Vo / Vd); #line 284 if ((t < 0.0)){ return vec4( 0.0, 0.0, 0.0, 0.0); } vec3 Pi = (rayStart + (rayDir * t)); vec3 Po = (p.plane.xyz * p.plane.w); vec3 d = (Pi - Po); #line 288 float u = (((dot( d, p.tangent) * 0.5) + 0.5) - (p.uvOffset.x * 0.5)); float v = (((dot( d, (-p.bitangent)) * 0.5) + 0.5) + (p.uvOffset.y * 0.5)); if (((((u < 0.0) || (u > 1.0)) || (v < 0.0)) || (v > 1.0))){ return vec4( 0.0, 0.0, 0.0, 0.0); } return tex2Dclod( s, vec2( u, v), level); } #line 293 vec4 GlossyReflectionTerm( in Input IN, in samplerCube crefl, in PlanarMapping pm0, in sampler2D prefl0, in PlanarMapping pm1, in sampler2D prefl1, in PlanarMapping pm2, in sampler2D prefl2, in vec3 normal, in float Q, in float lod ) { float W = (Q / pow( 2.0, 0.5)); vec3 worldP = IN.worldPos; #line 297 vec4 o1 = vec4( 0.0); vec4 o2 = vec4( 0.0); vec3 worldRefl; worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, normal), dot( IN.TtoW1, normal), dot( IN.TtoW2, normal))); #line 301 ContinuousSamplerLOD clod; clod.mip0 = floor(lod); clod.mip1 = (clod.mip0 + 1.0); clod.mipFrac = fract(lod); #line 305 o1 = SampleMirrorReflection( worldP, clod); o1 = mix( SamplePlanarReflection( prefl0, pm0, worldP, worldRefl, clod), o1, vec4( o1.w)); o1 = mix( SamplePlanarReflection( prefl1, pm1, worldP, worldRefl, clod), o1, vec4( o1.w)); o1 = mix( SamplePlanarReflection( prefl2, pm2, worldP, worldRefl, clod), o1, vec4( o1.w)); #line 309 clod.mip0 = floor((lod * 2.0)); clod.mip1 = (clod.mip0 + 1.0); clod.mipFrac = fract((lod * 2.0)); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( Q, 0.0, 0.0))), dot( IN.TtoW1, (normal + vec3( Q, 0.0, 0.0))), dot( IN.TtoW2, (normal + vec3( Q, 0.0, 0.0))))); #line 313 o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( (-Q), 0.0, 0.0))), dot( IN.TtoW1, (normal + vec3( (-Q), 0.0, 0.0))), dot( IN.TtoW2, (normal + vec3( (-Q), 0.0, 0.0))))); o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( 0.0, (-Q), 0.0))), dot( IN.TtoW1, (normal + vec3( 0.0, (-Q), 0.0))), dot( IN.TtoW2, (normal + vec3( 0.0, (-Q), 0.0))))); #line 317 o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( 0.0, Q, 0.0))), dot( IN.TtoW1, (normal + vec3( 0.0, Q, 0.0))), dot( IN.TtoW2, (normal + vec3( 0.0, Q, 0.0))))); o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( W, W, 0.0))), dot( IN.TtoW1, (normal + vec3( W, W, 0.0))), dot( IN.TtoW2, (normal + vec3( W, W, 0.0))))); #line 321 o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( (-W), W, 0.0))), dot( IN.TtoW1, (normal + vec3( (-W), W, 0.0))), dot( IN.TtoW2, (normal + vec3( (-W), W, 0.0))))); o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( W, (-W), 0.0))), dot( IN.TtoW1, (normal + vec3( W, (-W), 0.0))), dot( IN.TtoW2, (normal + vec3( W, (-W), 0.0))))); #line 325 o2 += SampleCubeReflection( crefl, worldRefl, clod); worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, (normal + vec3( (-W), (-W), 0.0))), dot( IN.TtoW1, (normal + vec3( (-W), (-W), 0.0))), dot( IN.TtoW2, (normal + vec3( (-W), (-W), 0.0))))); o2 += SampleCubeReflection( crefl, worldRefl, clod); o2 /= 8.0; #line 329 return mix( o2, o1, vec4( o1.w)); } #line 46 vec3 ShadeSH9( in vec4 normal ) { vec3 x1; vec3 x2; vec3 x3; x1.x = dot( unity_SHAr, normal); #line 50 x1.y = dot( unity_SHAg, normal); x1.z = dot( unity_SHAb, normal); vec4 vB = (normal.xyzz * normal.yzzx); x2.x = dot( unity_SHBr, vB); #line 54 x2.y = dot( unity_SHBg, vB); x2.z = dot( unity_SHBb, vB); float vC = ((normal.x * normal.x) - (normal.y * normal.y)); x3 = (unity_SHC.xyz * vC); #line 58 return ((x1 + x2) + x3); } #line 341 vec3 GlobalIllumination( in Input IN, in MySurfaceOutput s, out vec3 spec ) { vec3 normal = normalize(s.Normal); vec3 worldRefl = normalize(reflect( IN.worldRefl, vec3( dot( IN.TtoW0, normal), dot( IN.TtoW1, normal), dot( IN.TtoW2, normal)))); #line 345 vec3 worldN = vec3( dot( IN.TtoW0, normal), dot( IN.TtoW1, normal), dot( IN.TtoW2, normal)); float roughness = (_Roughness * s.Roughness); float Q = (0.0825 * (1.0 - pow( (1.0 - max( 0.0, (roughness - 0.033))), 2.0))); float LOD = ((1.25 * (1.0 - pow( (1.0 - max( 0.0, roughness)), 2.0))) * 4.0); #line 349 PlanarMapping pm0; pm0.plane = _PlanarReflection0; pm0.tangent = _PlanarReflectionTangent0.xyz; pm0.bitangent = _PlanarReflectionBiTangent0.xyz; #line 353 pm0.uvOffset = vec2( _PlanarReflectionTangent0.w, _PlanarReflectionBiTangent0.w); PlanarMapping pm1; pm1.plane = _PlanarReflection1; pm1.tangent = _PlanarReflectionTangent1.xyz; #line 357 pm1.bitangent = _PlanarReflectionBiTangent1.xyz; pm1.uvOffset = vec2( _PlanarReflectionTangent1.w, _PlanarReflectionBiTangent1.w); PlanarMapping pm2; pm2.plane = _PlanarReflection2; #line 361 pm2.tangent = _PlanarReflectionTangent2.xyz; pm2.bitangent = _PlanarReflectionBiTangent2.xyz; pm2.uvOffset = vec2( _PlanarReflectionTangent2.w, _PlanarReflectionBiTangent2.w); LOD = max( EvalMipLevel( worldRefl, 256.0), LOD); #line 365 vec3 refl = (GlossyReflectionTerm( IN, _Cube, pm0, _PlanarReflectionTex0, pm1, _PlanarReflectionTex1, pm2, _PlanarReflectionTex2, normal, Q, LOD).xyz * _ReflOnlyIntensity); refl *= mix( s.Specular, (s.Specular * s.Albedo), vec3( _Metalic)); spec = (refl * xll_saturate_f(s.Reflectivity)); vec3 ambient = (ShadeSH9( vec4( worldN, 1.0)) * s.Albedo); #line 369 return mix( ambient, refl, vec3( xll_saturate_f(s.Reflectivity))); } #line 206 float RemapToRange( in float v, in vec4 range ) { #line 208 v *= range.y; v += range.x; return v; } #line 68 vec3 UnpackNormal( in vec4 packednormal ) { #line 70 vec3 normal; normal.xy = ((packednormal.wy * 2.0) - 1.0); normal.z = sqrt(((1.0 - (normal.x * normal.x)) - (normal.y * normal.y))); return normal; } #line 380 void surf( in Input IN, inout MySurfaceOutput o ) { #line 382 vec4 c = texture2D( _MainTex, IN.uv_MainTex); o.Albedo = (c.xyz * _Color.xyz); o.Alpha = c.w; o.Specular = _ReflColor.xyz; #line 386 vec2 uv_BumpMap2 = ((IN.uv_MainTex.xy * _BumpMap2_ST.xy) + _BumpMap2_ST.zw); vec3 up = vec3( 0.0, 0.0, 1.0); vec3 n1 = mix( up, max( vec3( -1.0, -1.0, 0.01), UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap))), vec3( _BumpMapFactor)); vec3 n2 = mix( up, max( vec3( -1.0, -1.0, 0.01), UnpackNormal( texture2D( _BumpMap2, uv_BumpMap2))), vec3( _BumpMapFactor2)); #line 390 o.Normal = CombineNormals( n1, n2); float NdotV = max( 0.0, dot( o.Normal, normalize(IN.viewDir))); float F = FresnelTerm( (_Refl0 * _Reflectivity), (_Refl90 * _Reflectivity), NdotV); o.Reflectivity = (RemapToRange( texture2D( _MainReflectivityTex, IN.uv_MainTex).x, _MainReflectivityTex_AddMul) * F); #line 394 o.Roughness = RemapToRange( texture2D( _MainRoughnessTex, IN.uv_MainTex).x, _MainRoughnessTex_AddMul); vec3 globalSpec; o.Emission = GlobalIllumination( IN, o, globalSpec); } #line 440 vec4 xlat_main( in v2f_surf IN ) { Input surfIN; surfIN.uv_MainTex = IN.pack0.xy; #line 444 surfIN.uv_BumpMap = IN.pack0.zw; surfIN.worldRefl = vec3( IN.TtoW0.w, IN.TtoW1.w, IN.TtoW2.w); surfIN.TtoW0 = IN.TtoW0.xyz; surfIN.TtoW1 = IN.TtoW1.xyz; #line 448 surfIN.TtoW2 = IN.TtoW2.xyz; surfIN.worldNormal = vec3( 0.0); surfIN.TtoW0 = IN.TtoW0.xyz; surfIN.TtoW1 = IN.TtoW1.xyz; #line 452 surfIN.TtoW2 = IN.TtoW2.xyz; surfIN.worldPos = IN.worldPos; surfIN.viewDir = IN.viewDir; MySurfaceOutput o; #line 456 o.Albedo = vec3( 0.0); o.Emission = vec3( 0.0); o.Specular = vec3( 0.0); o.Alpha = 0.0; #line 460 surf( surfIN, o); float atten = (texture2D( _LightTexture0, IN._LightCoord).w * 1.0); vec4 c = vec4( 0.0); c = LightingOrenNayar_CookTorrance( o, IN.lightDir, normalize(IN.viewDir), atten); #line 464 c.xyz += (o.Albedo * IN.vlight); c.xyz += o.Emission; c.w = 1.0; return c; } varying vec4 xlv_TEXCOORD0; varying vec3 xlv_TEXCOORD1; varying vec3 xlv_TEXCOORD2; varying vec4 xlv_TEXCOORD3; varying vec4 xlv_TEXCOORD4; varying vec4 xlv_TEXCOORD5; varying vec3 xlv_TEXCOORD6; varying vec3 xlv_TEXCOORD7; varying vec2 xlv_TEXCOORD8; void main() { vec4 xl_retval; v2f_surf xlt_IN; xlt_IN.pos = vec4(0.0); xlt_IN.pack0 = vec4(xlv_TEXCOORD0); xlt_IN.worldPos = vec3(xlv_TEXCOORD1); xlt_IN.viewDir = vec3(xlv_TEXCOORD2); xlt_IN.TtoW0 = vec4(xlv_TEXCOORD3); xlt_IN.TtoW1 = vec4(xlv_TEXCOORD4); xlt_IN.TtoW2 = vec4(xlv_TEXCOORD5); xlt_IN.lightDir = vec3(xlv_TEXCOORD6); xlt_IN.vlight = vec3(xlv_TEXCOORD7); xlt_IN._LightCoord = vec2(xlv_TEXCOORD8); xl_retval = xlat_main( xlt_IN); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _BumpMap: type 25 arrsize 0 // _BumpMap2: type 25 arrsize 0 // _BumpMap2_ST: type 12 arrsize 0 // _BumpMapFactor: type 9 arrsize 0 // _BumpMapFactor2: type 9 arrsize 0 // _Color: type 12 arrsize 0 // _Cube: type 28 arrsize 0 // _Falloff: type 9 arrsize 0 // _LightColor0: type 12 arrsize 0 // _LightTexture0: type 25 arrsize 0 // _MainReflectivityTex: type 25 arrsize 0 // _MainReflectivityTex_AddMul: type 12 arrsize 0 // _MainRoughnessTex: type 25 arrsize 0 // _MainRoughnessTex_AddMul: type 12 arrsize 0 // _MainTex: type 25 arrsize 0 // _Metalic: type 9 arrsize 0 // _MirrorTex: type 25 arrsize 0 // _PlanarReflection0: type 12 arrsize 0 // _PlanarReflection1: type 12 arrsize 0 // _PlanarReflection2: type 12 arrsize 0 // _PlanarReflectionBiTangent0: type 12 arrsize 0 // _PlanarReflectionBiTangent1: type 12 arrsize 0 // _PlanarReflectionBiTangent2: type 12 arrsize 0 // _PlanarReflectionTangent0: type 12 arrsize 0 // _PlanarReflectionTangent1: type 12 arrsize 0 // _PlanarReflectionTangent2: type 12 arrsize 0 // _PlanarReflectionTex0: type 25 arrsize 0 // _PlanarReflectionTex1: type 25 arrsize 0 // _PlanarReflectionTex2: type 25 arrsize 0 // _Refl0: type 9 arrsize 0 // _Refl90: type 9 arrsize 0 // _ReflColor: type 12 arrsize 0 // _ReflOnlyIntensity: type 9 arrsize 0 // _Reflectivity: type 9 arrsize 0 // _Rolloff: type 9 arrsize 0 // _Roughness: type 9 arrsize 0 // _Roughness2: type 9 arrsize 0 // _SpecOnlyIntensity: type 9 arrsize 0 // _WorldToMirrorProjMatrix: type 21 arrsize 0 // unity_SHAb: type 12 arrsize 0 // unity_SHAg: type 12 arrsize 0 // unity_SHAr: type 12 arrsize 0 // unity_SHBb: type 12 arrsize 0 // unity_SHBg: type 12 arrsize 0 // unity_SHBr: type 12 arrsize 0 // unity_SHC: type 12 arrsize 0