Commit f4e5cbd1 authored by Kenneth Graunke's avatar Kenneth Graunke

Import Unity 5.0 built-in shaders.

The Unity 3D engine ships with a number of built-in shaders, which will
likely be used by many games.  These were originally written in HLSL,
but translated via a bunch of software.

Thanks to Aras Pranckevičius <aras@unity3d.com> for giving us a copy of
these shaders under the MIT license.
parent c6a13041
......@@ -152,3 +152,26 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
shaders/unity/*
Copyright © 2014 Unity Technologies
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Built-in shader from Unity 5.0.0b19:
# Surface/WorldNormalReflBump
# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_OFF
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 unity_SHAr;
uniform vec4 unity_SHAg;
uniform vec4 unity_SHAb;
uniform vec4 unity_SHBr;
uniform vec4 unity_SHBg;
uniform vec4 unity_SHBb;
uniform vec4 unity_SHC;
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 _BumpMap_ST;
attribute vec4 TANGENT;
varying vec2 xlv_TEXCOORD0;
varying vec4 xlv_TEXCOORD1;
varying vec4 xlv_TEXCOORD2;
varying vec4 xlv_TEXCOORD3;
varying vec3 xlv_TEXCOORD4;
void main ()
{
vec3 tmpvar_1;
tmpvar_1 = (_Object2World * gl_Vertex).xyz;
vec4 v_2;
v_2.x = _World2Object[0].x;
v_2.y = _World2Object[1].x;
v_2.z = _World2Object[2].x;
v_2.w = _World2Object[3].x;
vec4 v_3;
v_3.x = _World2Object[0].y;
v_3.y = _World2Object[1].y;
v_3.z = _World2Object[2].y;
v_3.w = _World2Object[3].y;
vec4 v_4;
v_4.x = _World2Object[0].z;
v_4.y = _World2Object[1].z;
v_4.z = _World2Object[2].z;
v_4.w = _World2Object[3].z;
vec3 tmpvar_5;
tmpvar_5 = normalize(((
(v_2.xyz * gl_Normal.x)
+
(v_3.xyz * gl_Normal.y)
) + (v_4.xyz * gl_Normal.z)));
mat3 tmpvar_6;
tmpvar_6[0] = _Object2World[0].xyz;
tmpvar_6[1] = _Object2World[1].xyz;
tmpvar_6[2] = _Object2World[2].xyz;
vec3 tmpvar_7;
tmpvar_7 = normalize((tmpvar_6 * TANGENT.xyz));
vec3 tmpvar_8;
tmpvar_8 = (((tmpvar_5.yzx * tmpvar_7.zxy) - (tmpvar_5.zxy * tmpvar_7.yzx)) * TANGENT.w);
vec4 tmpvar_9;
tmpvar_9.x = tmpvar_7.x;
tmpvar_9.y = tmpvar_8.x;
tmpvar_9.z = tmpvar_5.x;
tmpvar_9.w = tmpvar_1.x;
vec4 tmpvar_10;
tmpvar_10.x = tmpvar_7.y;
tmpvar_10.y = tmpvar_8.y;
tmpvar_10.z = tmpvar_5.y;
tmpvar_10.w = tmpvar_1.y;
vec4 tmpvar_11;
tmpvar_11.x = tmpvar_7.z;
tmpvar_11.y = tmpvar_8.z;
tmpvar_11.z = tmpvar_5.z;
tmpvar_11.w = tmpvar_1.z;
vec4 tmpvar_12;
tmpvar_12.w = 1.0;
tmpvar_12.xyz = tmpvar_5;
vec3 x2_13;
vec3 x1_14;
x1_14.x = dot (unity_SHAr, tmpvar_12);
x1_14.y = dot (unity_SHAg, tmpvar_12);
x1_14.z = dot (unity_SHAb, tmpvar_12);
vec4 tmpvar_15;
tmpvar_15 = (tmpvar_5.xyzz * tmpvar_5.yzzx);
x2_13.x = dot (unity_SHBr, tmpvar_15);
x2_13.y = dot (unity_SHBg, tmpvar_15);
x2_13.z = dot (unity_SHBb, tmpvar_15);
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
xlv_TEXCOORD1 = tmpvar_9;
xlv_TEXCOORD2 = tmpvar_10;
xlv_TEXCOORD3 = tmpvar_11;
xlv_TEXCOORD4 = ((x1_14 + x2_13) + (unity_SHC.xyz * (
(tmpvar_5.x * tmpvar_5.x)
-
(tmpvar_5.y * tmpvar_5.y)
)));
}
[fragment shader]
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform samplerCube _Cube;
uniform sampler2D _BumpMap;
uniform samplerCube _ReflCube;
varying vec2 xlv_TEXCOORD0;
varying vec4 xlv_TEXCOORD1;
varying vec4 xlv_TEXCOORD2;
varying vec4 xlv_TEXCOORD3;
varying vec3 xlv_TEXCOORD4;
void main ()
{
vec3 worldN_1;
vec4 c_2;
vec3 tmpvar_3;
tmpvar_3.x = xlv_TEXCOORD1.w;
tmpvar_3.y = xlv_TEXCOORD2.w;
tmpvar_3.z = xlv_TEXCOORD3.w;
vec3 tmpvar_4;
tmpvar_4 = -(normalize((_WorldSpaceCameraPos - tmpvar_3)));
vec3 normal_5;
normal_5.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0).wy * 2.0) - 1.0);
normal_5.z = sqrt((1.0 - clamp (
dot (normal_5.xy, normal_5.xy)
, 0.0, 1.0)));
vec3 tmpvar_6;
tmpvar_6.x = dot (xlv_TEXCOORD1.xyz, normal_5);
tmpvar_6.y = dot (xlv_TEXCOORD2.xyz, normal_5);
tmpvar_6.z = dot (xlv_TEXCOORD3.xyz, normal_5);
vec3 tmpvar_7;
tmpvar_7.x = dot (xlv_TEXCOORD1.xyz, normal_5);
tmpvar_7.y = dot (xlv_TEXCOORD2.xyz, normal_5);
tmpvar_7.z = dot (xlv_TEXCOORD3.xyz, normal_5);
vec3 tmpvar_8;
tmpvar_8 = ((textureCube (_Cube, tmpvar_6).xyz * 0.5) + (textureCube (_ReflCube, (tmpvar_4 -
(2.0 * (dot (tmpvar_7, tmpvar_4) * tmpvar_7))
)).xyz * 0.3));
c_2.w = 0.0;
c_2.xyz = (tmpvar_8 * xlv_TEXCOORD4);
worldN_1.x = dot (xlv_TEXCOORD1.xyz, normal_5);
worldN_1.y = dot (xlv_TEXCOORD2.xyz, normal_5);
worldN_1.z = dot (xlv_TEXCOORD3.xyz, normal_5);
vec4 c_9;
c_9.xyz = ((tmpvar_8 * _LightColor0.xyz) * (max (0.0,
dot (worldN_1, _WorldSpaceLightPos0.xyz)
) * 2.0));
c_9.w = 0.0;
c_2.xyz = (c_2 + c_9).xyz;
c_2.w = 1.0;
gl_FragData[0] = c_2;
}
# Built-in shader from Unity 5.0.0b19:
# Surface/Diffuse Wrapped
# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_OFF
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 unity_SHAr;
uniform vec4 unity_SHAg;
uniform vec4 unity_SHAb;
uniform vec4 unity_SHBr;
uniform vec4 unity_SHBg;
uniform vec4 unity_SHBb;
uniform vec4 unity_SHC;
uniform mat4 _World2Object;
uniform vec4 _MainTex_ST;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 v_1;
v_1.x = _World2Object[0].x;
v_1.y = _World2Object[1].x;
v_1.z = _World2Object[2].x;
v_1.w = _World2Object[3].x;
vec4 v_2;
v_2.x = _World2Object[0].y;
v_2.y = _World2Object[1].y;
v_2.z = _World2Object[2].y;
v_2.w = _World2Object[3].y;
vec4 v_3;
v_3.x = _World2Object[0].z;
v_3.y = _World2Object[1].z;
v_3.z = _World2Object[2].z;
v_3.w = _World2Object[3].z;
vec3 tmpvar_4;
tmpvar_4 = normalize(((
(v_1.xyz * gl_Normal.x)
+
(v_2.xyz * gl_Normal.y)
) + (v_3.xyz * gl_Normal.z)));
vec4 tmpvar_5;
tmpvar_5.w = 1.0;
tmpvar_5.xyz = tmpvar_4;
vec3 x2_6;
vec3 x1_7;
x1_7.x = dot (unity_SHAr, tmpvar_5);
x1_7.y = dot (unity_SHAg, tmpvar_5);
x1_7.z = dot (unity_SHAb, tmpvar_5);
vec4 tmpvar_8;
tmpvar_8 = (tmpvar_4.xyzz * tmpvar_4.yzzx);
x2_6.x = dot (unity_SHBr, tmpvar_8);
x2_6.y = dot (unity_SHBg, tmpvar_8);
x2_6.z = dot (unity_SHBb, tmpvar_8);
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
xlv_TEXCOORD1 = tmpvar_4;
xlv_TEXCOORD2 = ((x1_7 + x2_6) + (unity_SHC.xyz * (
(tmpvar_4.x * tmpvar_4.x)
-
(tmpvar_4.y * tmpvar_4.y)
)));
}
[fragment shader]
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform sampler2D _MainTex;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 c_1;
vec4 tmpvar_2;
tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
c_1.w = 0.0;
c_1.xyz = (tmpvar_2.xyz * xlv_TEXCOORD2);
vec4 c_3;
c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * ((
(dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz) * 0.5)
+ 0.5) * 2.0));
c_3.w = 0.0;
c_1.xyz = (c_1 + c_3).xyz;
c_1.w = 1.0;
gl_FragData[0] = c_1;
}
# Built-in shader from Unity 5.0.0b19:
# Surface/Colored Specular
# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_OFF
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 unity_SHAr;
uniform vec4 unity_SHAg;
uniform vec4 unity_SHAb;
uniform vec4 unity_SHBr;
uniform vec4 unity_SHBg;
uniform vec4 unity_SHBb;
uniform vec4 unity_SHC;
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 _MainTex_ST;
uniform vec4 _SpecMap_ST;
varying vec4 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
varying vec3 xlv_TEXCOORD3;
void main ()
{
vec4 tmpvar_1;
tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _SpecMap_ST.xy) + _SpecMap_ST.zw);
vec4 v_2;
v_2.x = _World2Object[0].x;
v_2.y = _World2Object[1].x;
v_2.z = _World2Object[2].x;
v_2.w = _World2Object[3].x;
vec4 v_3;
v_3.x = _World2Object[0].y;
v_3.y = _World2Object[1].y;
v_3.z = _World2Object[2].y;
v_3.w = _World2Object[3].y;
vec4 v_4;
v_4.x = _World2Object[0].z;
v_4.y = _World2Object[1].z;
v_4.z = _World2Object[2].z;
v_4.w = _World2Object[3].z;
vec3 tmpvar_5;
tmpvar_5 = normalize(((
(v_2.xyz * gl_Normal.x)
+
(v_3.xyz * gl_Normal.y)
) + (v_4.xyz * gl_Normal.z)));
vec4 tmpvar_6;
tmpvar_6.w = 1.0;
tmpvar_6.xyz = tmpvar_5;
vec3 x2_7;
vec3 x1_8;
x1_8.x = dot (unity_SHAr, tmpvar_6);
x1_8.y = dot (unity_SHAg, tmpvar_6);
x1_8.z = dot (unity_SHAb, tmpvar_6);
vec4 tmpvar_9;
tmpvar_9 = (tmpvar_5.xyzz * tmpvar_5.yzzx);
x2_7.x = dot (unity_SHBr, tmpvar_9);
x2_7.y = dot (unity_SHBg, tmpvar_9);
x2_7.z = dot (unity_SHBb, tmpvar_9);
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
xlv_TEXCOORD0 = tmpvar_1;
xlv_TEXCOORD1 = tmpvar_5;
xlv_TEXCOORD2 = (_Object2World * gl_Vertex).xyz;
xlv_TEXCOORD3 = ((x1_8 + x2_7) + (unity_SHC.xyz * (
(tmpvar_5.x * tmpvar_5.x)
-
(tmpvar_5.y * tmpvar_5.y)
)));
}
[fragment shader]
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform sampler2D _MainTex;
uniform sampler2D _SpecMap;
varying vec4 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
varying vec3 xlv_TEXCOORD3;
void main ()
{
vec4 c_1;
vec3 tmpvar_2;
tmpvar_2 = (texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz * 0.3);
c_1.w = 0.0;
c_1.xyz = (tmpvar_2 * xlv_TEXCOORD3);
vec4 c_3;
c_3.xyz = (((
(tmpvar_2 * _LightColor0.xyz)
*
max (0.0, dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz))
) + (_LightColor0.xyz *
(pow (max (0.0, dot (xlv_TEXCOORD1,
normalize((_WorldSpaceLightPos0.xyz + normalize((_WorldSpaceCameraPos - xlv_TEXCOORD2))))
)), 32.0) * texture2D (_SpecMap, xlv_TEXCOORD0.zw).xyz)
)) * 2.0);
c_3.w = 0.0;
c_1.xyz = (c_1 + c_3).xyz;
c_1.w = 1.0;
gl_FragData[0] = c_1;
}
# Built-in shader from Unity 5.0.0b19:
# Surface/ScreenPos
# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_OFF
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 _ProjectionParams;
uniform vec4 unity_SHAr;
uniform vec4 unity_SHAg;
uniform vec4 unity_SHAb;
uniform vec4 unity_SHBr;
uniform vec4 unity_SHBg;
uniform vec4 unity_SHBb;
uniform vec4 unity_SHC;
uniform mat4 _World2Object;
varying vec3 xlv_TEXCOORD0;
varying vec4 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 tmpvar_1;
tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
vec4 v_2;
v_2.x = _World2Object[0].x;
v_2.y = _World2Object[1].x;
v_2.z = _World2Object[2].x;
v_2.w = _World2Object[3].x;
vec4 v_3;
v_3.x = _World2Object[0].y;
v_3.y = _World2Object[1].y;
v_3.z = _World2Object[2].y;
v_3.w = _World2Object[3].y;
vec4 v_4;
v_4.x = _World2Object[0].z;
v_4.y = _World2Object[1].z;
v_4.z = _World2Object[2].z;
v_4.w = _World2Object[3].z;
vec3 tmpvar_5;
tmpvar_5 = normalize(((
(v_2.xyz * gl_Normal.x)
+
(v_3.xyz * gl_Normal.y)
) + (v_4.xyz * gl_Normal.z)));
vec4 o_6;
vec4 tmpvar_7;
tmpvar_7 = (tmpvar_1 * 0.5);
vec2 tmpvar_8;
tmpvar_8.x = tmpvar_7.x;
tmpvar_8.y = (tmpvar_7.y * _ProjectionParams.x);
o_6.xy = (tmpvar_8 + tmpvar_7.w);
o_6.zw = tmpvar_1.zw;
vec4 tmpvar_9;
tmpvar_9.w = 1.0;
tmpvar_9.xyz = tmpvar_5;
vec3 x2_10;
vec3 x1_11;
x1_11.x = dot (unity_SHAr, tmpvar_9);
x1_11.y = dot (unity_SHAg, tmpvar_9);
x1_11.z = dot (unity_SHAb, tmpvar_9);
vec4 tmpvar_12;
tmpvar_12 = (tmpvar_5.xyzz * tmpvar_5.yzzx);
x2_10.x = dot (unity_SHBr, tmpvar_12);
x2_10.y = dot (unity_SHBg, tmpvar_12);
x2_10.z = dot (unity_SHBb, tmpvar_12);
gl_Position = tmpvar_1;
xlv_TEXCOORD0 = tmpvar_5;
xlv_TEXCOORD1 = o_6;
xlv_TEXCOORD2 = ((x1_11 + x2_10) + (unity_SHC.xyz * (
(tmpvar_5.x * tmpvar_5.x)
-
(tmpvar_5.y * tmpvar_5.y)
)));
}
[fragment shader]
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform sampler2D _MainTex;
varying vec3 xlv_TEXCOORD0;
varying vec4 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 c_1;
c_1.w = 0.0;
c_1.xyz = (vec3(0.5, 0.5, 0.5) * xlv_TEXCOORD2);
vec4 c_2;
c_2.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * (max (0.0,
dot (xlv_TEXCOORD0, _WorldSpaceLightPos0.xyz)
) * 2.0));
c_2.w = 0.0;
c_1.xyz = ((c_1 + c_2).xyz + (texture2D (_MainTex, (
(xlv_TEXCOORD1.xy / xlv_TEXCOORD1.w)
* vec2(2.0, 1.0))).xyz * 0.5));
c_1.w = 1.0;
gl_FragData[0] = c_1;
}
# Built-in shader from Unity 5.0.0b19:
# Standard
# internal variant: SHADOWS_DEPTH _ALPHATEST_ON shadow caster pass
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 unity_LightShadowBias;
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform mat4 unity_MatrixVP;
uniform vec4 _MainTex_ST;
varying vec2 xlv_TEXCOORD1;
void main ()
{
vec3 vertex_1;
vertex_1 = gl_Vertex.xyz;
vec4 clipPos_2;
if ((unity_LightShadowBias.z != 0.0)) {
vec4 tmpvar_3;
tmpvar_3.w = 1.0;
tmpvar_3.xyz = vertex_1;
vec3 tmpvar_4;
tmpvar_4 = (_Object2World * tmpvar_3).xyz;
vec4 v_5;
v_5.x = _World2Object[0].x;
v_5.y = _World2Object[1].x;
v_5.z = _World2Object[2].x;
v_5.w = _World2Object[3].x;
vec4 v_6;
v_6.x = _World2Object[0].y;
v_6.y = _World2Object[1].y;
v_6.z = _World2Object[2].y;
v_6.w = _World2Object[3].y;
vec4 v_7;
v_7.x = _World2Object[0].z;
v_7.y = _World2Object[1].z;
v_7.z = _World2Object[2].z;
v_7.w = _World2Object[3].z;
vec3 tmpvar_8;
tmpvar_8 = normalize(((
(v_5.xyz * gl_Normal.x)
+
(v_6.xyz * gl_Normal.y)
) + (v_7.xyz * gl_Normal.z)));
float tmpvar_9;
tmpvar_9 = dot (tmpvar_8, normalize((_WorldSpaceLightPos0.xyz -
(tmpvar_4 * _WorldSpaceLightPos0.w)
)));
vec4 tmpvar_10;
tmpvar_10.w = 1.0;
tmpvar_10.xyz = (tmpvar_4 - (tmpvar_8 * (unity_LightShadowBias.z *
sqrt((1.0 - (tmpvar_9 * tmpvar_9)))
)));
clipPos_2 = (unity_MatrixVP * tmpvar_10);
} else {
vec4 tmpvar_11;
tmpvar_11.w = 1.0;
tmpvar_11.xyz = vertex_1;
clipPos_2 = (gl_ModelViewProjectionMatrix * tmpvar_11);
};
vec4 clipPos_12;
clipPos_12.xyw = clipPos_2.xyw;
clipPos_12.z = (clipPos_2.z + clamp ((unity_LightShadowBias.x / clipPos_2.w), 0.0, 1.0));
clipPos_12.z = mix (clipPos_12.z, max (clipPos_12.z, -(clipPos_2.w)), unity_LightShadowBias.y);
xlv_TEXCOORD1 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
gl_Position = clipPos_12;
}
[fragment shader]
uniform vec4 _Color;
uniform float _Cutoff;
uniform sampler2D _MainTex;
varying vec2 xlv_TEXCOORD1;
void main ()
{
float x_1;
x_1 = ((texture2D (_MainTex, xlv_TEXCOORD1).w * _Color.w) - _Cutoff);
if ((x_1 < 0.0)) {
discard;
};
gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
}
# Built-in shader from Unity 5.0.0b19:
# Surface/Slices
# internal variant: DIRECTIONAL
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 _MainTex_ST;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 v_1;
v_1.x = _World2Object[0].x;
v_1.y = _World2Object[1].x;
v_1.z = _World2Object[2].x;
v_1.w = _World2Object[3].x;
vec4 v_2;
v_2.x = _World2Object[0].y;
v_2.y = _World2Object[1].y;
v_2.z = _World2Object[2].y;
v_2.w = _World2Object[3].y;
vec4 v_3;
v_3.x = _World2Object[0].z;
v_3.y = _World2Object[1].z;
v_3.z = _World2Object[2].z;
v_3.w = _World2Object[3].z;
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
xlv_TEXCOORD1 = normalize(((
(v_1.xyz * gl_Normal.x)
+
(v_2.xyz * gl_Normal.y)
) + (v_3.xyz * gl_Normal.z)));
xlv_TEXCOORD2 = (_Object2World * gl_Vertex).xyz;
}
[fragment shader]
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform sampler2D _MainTex;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
void main ()
{
vec4 c_1;
float x_2;
x_2 = (fract((
(xlv_TEXCOORD2.y + (xlv_TEXCOORD2.z * 0.1))
* 5.0)) - 0.5);
if ((x_2 < 0.0)) {
discard;
};
vec4 c_3;
c_3.xyz = ((texture2D (_MainTex, xlv_TEXCOORD0).xyz * _LightColor0.xyz) * (max (0.0,
dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz)
) * 2.0));
c_3.w = 0.0;
c_1.xyz = c_3.xyz;
c_1.w = 1.0;
gl_FragData[0] = c_1;
}
# Built-in shader from Unity 5.0.0b19:
# Surface/Rim
# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_OFF
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform vec4 unity_SHAr;
uniform vec4 unity_SHAg;
uniform vec4 unity_SHAb;
uniform vec4 unity_SHBr;
uniform vec4 unity_SHBg;
uniform vec4 unity_SHBb;
uniform vec4 unity_SHC;
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 _MainTex_ST;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
varying vec3 xlv_TEXCOORD3;
void main ()
{
vec4 v_1;
v_1.x = _World2Object[0].x;
v_1.y = _World2Object[1].x;
v_1.z = _World2Object[2].x;
v_1.w = _World2Object[3].x;
vec4 v_2;
v_2.x = _World2Object[0].y;
v_2.y = _World2Object[1].y;
v_2.z = _World2Object[2].y;
v_2.w = _World2Object[3].y;
vec4 v_3;
v_3.x = _World2Object[0].z;
v_3.y = _World2Object[1].z;
v_3.z = _World2Object[2].z;
v_3.w = _World2Object[3].z;
vec3 tmpvar_4;
tmpvar_4 = normalize(((
(v_1.xyz * gl_Normal.x)
+
(v_2.xyz * gl_Normal.y)
) + (v_3.xyz * gl_Normal.z)));
vec4 tmpvar_5;
tmpvar_5.w = 1.0;
tmpvar_5.xyz = tmpvar_4;
vec3 x2_6;
vec3 x1_7;
x1_7.x = dot (unity_SHAr, tmpvar_5);
x1_7.y = dot (unity_SHAg, tmpvar_5);
x1_7.z = dot (unity_SHAb, tmpvar_5);
vec4 tmpvar_8;
tmpvar_8 = (tmpvar_4.xyzz * tmpvar_4.yzzx);
x2_6.x = dot (unity_SHBr, tmpvar_8);
x2_6.y = dot (unity_SHBg, tmpvar_8);
x2_6.z = dot (unity_SHBb, tmpvar_8);
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
xlv_TEXCOORD1 = tmpvar_4;
xlv_TEXCOORD2 = (_Object2World * gl_Vertex).xyz;
xlv_TEXCOORD3 = ((x1_7 + x2_6) + (unity_SHC.xyz * (
(tmpvar_4.x * tmpvar_4.x)
-
(tmpvar_4.y * tmpvar_4.y)
)));
}
[fragment shader]
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 _LightColor0;
uniform sampler2D _MainTex;
uniform vec4 _RimColor;
uniform float _RimPower;
varying vec2 xlv_TEXCOORD0;
varying vec3 xlv_TEXCOORD1;
varying vec3 xlv_TEXCOORD2;
varying vec3 xlv_TEXCOORD3;
void main ()
{
vec4 c_1;
vec4 tmpvar_2;
tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
c_1.w = 0.0;
c_1.xyz = (tmpvar_2.xyz * xlv_TEXCOORD3);
vec4 c_3;
c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0,
dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz)
) * 2.0));
c_3.w = 0.0;
c_1.xyz = ((c_1 + c_3).xyz + (_RimColor.xyz * pow (
(1.0 - clamp (dot (normalize(
normalize((_WorldSpaceCameraPos - xlv_TEXCOORD2))
), xlv_TEXCOORD1), 0.0, 1.0))
, _RimPower)));
c_1.w = 1.0;
gl_FragData[0] = c_1;
}
# Built-in shader from Unity 5.0.0b19:
# Surface/Rim Bump
# internal variant: DIRECTIONAL
# This shader GLSL dump is put under MIT license
[require]
GLSL >= 1.10
[vertex shader]
uniform mat4 _Object2World;
uniform mat4 _World2Object;
uniform vec4 _BumpMap_ST;