summaryrefslogtreecommitdiff
path: root/shaders/unity/42.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/unity/42.shader_test')
-rw-r--r--shaders/unity/42.shader_test272
1 files changed, 272 insertions, 0 deletions
diff --git a/shaders/unity/42.shader_test b/shaders/unity/42.shader_test
new file mode 100644
index 0000000..73dddde
--- /dev/null
+++ b/shaders/unity/42.shader_test
@@ -0,0 +1,272 @@
+# Built-in shader from Unity 5.0.0b19:
+# Standard (Specular setup)
+# internal variant: SHADOWS_DEPTH SHADOWS_NATIVE SHADOWS_SOFT SPOT _DETAIL_MULX2 _NORMALMAP _SPECGLOSSMAP
+# This shader GLSL dump is put under MIT license
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform vec3 _WorldSpaceCameraPos;
+uniform vec4 _WorldSpaceLightPos0;
+uniform mat4 unity_World2Shadow[4];
+
+uniform mat4 _Object2World;
+uniform mat4 _World2Object;
+uniform vec4 _MainTex_ST;
+uniform vec4 _DetailAlbedoMap_ST;
+uniform float _UVSec;
+uniform mat4 _LightMatrix0;
+attribute vec4 TANGENT;
+varying vec4 xlv_TEXCOORD0;
+varying vec3 xlv_TEXCOORD1;
+varying vec4 xlv_TEXCOORD2;
+varying vec4 xlv_TEXCOORD2_1;
+varying vec4 xlv_TEXCOORD2_2;
+varying vec4 xlv_TEXCOORD5;
+varying vec4 xlv_TEXCOORD6;
+void main ()
+{
+ vec2 tmpvar_1;
+ tmpvar_1 = gl_MultiTexCoord0.xy;
+ vec2 tmpvar_2;
+ tmpvar_2 = gl_MultiTexCoord1.xy;
+ vec4 tmpvar_3;
+ vec4 tmpvar_4;
+ vec4 tmpvar_5;
+ vec4 tmpvar_6;
+ tmpvar_6 = (_Object2World * gl_Vertex);
+ vec4 tmpvar_7;
+ tmpvar_7 = (gl_ModelViewProjectionMatrix * gl_Vertex);
+ vec4 texcoord_8;
+ texcoord_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
+ vec2 tmpvar_9;
+ if ((_UVSec == 0.0)) {
+ tmpvar_9 = tmpvar_1;
+ } else {
+ tmpvar_9 = tmpvar_2;
+ };
+ texcoord_8.zw = ((tmpvar_9 * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw);
+ vec4 v_10;
+ v_10.x = _World2Object[0].x;
+ v_10.y = _World2Object[1].x;
+ v_10.z = _World2Object[2].x;
+ v_10.w = _World2Object[3].x;
+ vec4 v_11;
+ v_11.x = _World2Object[0].y;
+ v_11.y = _World2Object[1].y;
+ v_11.z = _World2Object[2].y;
+ v_11.w = _World2Object[3].y;
+ vec4 v_12;
+ v_12.x = _World2Object[0].z;
+ v_12.y = _World2Object[1].z;
+ v_12.z = _World2Object[2].z;
+ v_12.w = _World2Object[3].z;
+ vec3 tmpvar_13;
+ tmpvar_13 = normalize(((
+ (v_10.xyz * gl_Normal.x)
+ +
+ (v_11.xyz * gl_Normal.y)
+ ) + (v_12.xyz * gl_Normal.z)));
+ mat3 tmpvar_14;
+ tmpvar_14[0] = _Object2World[0].xyz;
+ tmpvar_14[1] = _Object2World[1].xyz;
+ tmpvar_14[2] = _Object2World[2].xyz;
+ vec4 tmpvar_15;
+ tmpvar_15.xyz = normalize((tmpvar_14 * TANGENT.xyz));
+ tmpvar_15.w = TANGENT.w;
+ vec3 tmpvar_16;
+ vec3 tmpvar_17;
+ tmpvar_16 = tmpvar_15.xyz;
+ tmpvar_17 = (((tmpvar_13.yzx * tmpvar_15.zxy) - (tmpvar_13.zxy * tmpvar_15.yzx)) * TANGENT.www);
+ vec3 tmpvar_18;
+ vec3 tmpvar_19;
+ vec3 tmpvar_20;
+ tmpvar_18.x = tmpvar_16.x;
+ tmpvar_18.y = tmpvar_17.x;
+ tmpvar_18.z = tmpvar_13.x;
+ tmpvar_19.x = tmpvar_16.y;
+ tmpvar_19.y = tmpvar_17.y;
+ tmpvar_19.z = tmpvar_13.y;
+ tmpvar_20.x = tmpvar_16.z;
+ tmpvar_20.y = tmpvar_17.z;
+ tmpvar_20.z = tmpvar_13.z;
+ vec3 v_21;
+ v_21.x = tmpvar_18.x;
+ v_21.y = tmpvar_19.x;
+ v_21.z = tmpvar_20.x;
+ tmpvar_3.xyz = v_21;
+ vec3 v_22;
+ v_22.x = tmpvar_18.y;
+ v_22.y = tmpvar_19.y;
+ v_22.z = tmpvar_20.y;
+ tmpvar_4.xyz = v_22;
+ vec3 v_23;
+ v_23.x = tmpvar_18.z;
+ v_23.y = tmpvar_19.z;
+ v_23.z = tmpvar_20.z;
+ tmpvar_5.xyz = v_23;
+ vec3 tmpvar_24;
+ tmpvar_24 = (_WorldSpaceLightPos0.xyz - (tmpvar_6.xyz * _WorldSpaceLightPos0.w));
+ tmpvar_3.w = tmpvar_24.x;
+ tmpvar_4.w = tmpvar_24.y;
+ tmpvar_5.w = tmpvar_24.z;
+ gl_Position = tmpvar_7;
+ xlv_TEXCOORD0 = texcoord_8;
+ xlv_TEXCOORD1 = (tmpvar_6.xyz - _WorldSpaceCameraPos);
+ xlv_TEXCOORD2 = tmpvar_3;
+ xlv_TEXCOORD2_1 = tmpvar_4;
+ xlv_TEXCOORD2_2 = tmpvar_5;
+ vec4 cse_25;
+ cse_25 = (_Object2World * gl_Vertex);
+ xlv_TEXCOORD5 = (_LightMatrix0 * cse_25);
+ xlv_TEXCOORD6 = (unity_World2Shadow[0] * cse_25);
+}
+
+[fragment shader]
+uniform vec4 _LightShadowData;
+uniform vec4 unity_ColorSpaceDouble;
+uniform vec4 _LightColor0;
+uniform vec4 _Color;
+uniform sampler2D _MainTex;
+uniform sampler2D _DetailAlbedoMap;
+uniform sampler2D _BumpMap;
+uniform float _BumpScale;
+uniform sampler2D _DetailMask;
+uniform sampler2D _DetailNormalMap;
+uniform float _DetailNormalMapScale;
+uniform sampler2D _SpecGlossMap;
+uniform sampler2DShadow _ShadowMapTexture;
+uniform vec4 _ShadowOffsets[4];
+uniform sampler2D _LightTexture0;
+uniform sampler2D _LightTextureB0;
+varying vec4 xlv_TEXCOORD0;
+varying vec3 xlv_TEXCOORD1;
+varying vec4 xlv_TEXCOORD2;
+varying vec4 xlv_TEXCOORD2_1;
+varying vec4 xlv_TEXCOORD2_2;
+varying vec4 xlv_TEXCOORD5;
+varying vec4 xlv_TEXCOORD6;
+void main ()
+{
+ vec3 tmpvar_1;
+ vec3 tmpvar_2;
+ vec3 tmpvar_3;
+ tmpvar_1 = xlv_TEXCOORD2.xyz;
+ tmpvar_2 = xlv_TEXCOORD2_1.xyz;
+ tmpvar_3 = normalize(xlv_TEXCOORD2_2.xyz);
+ mat3 tmpvar_4;
+ tmpvar_4[0].x = tmpvar_1.x;
+ tmpvar_4[0].y = tmpvar_2.x;
+ tmpvar_4[0].z = tmpvar_3.x;
+ tmpvar_4[1].x = tmpvar_1.y;
+ tmpvar_4[1].y = tmpvar_2.y;
+ tmpvar_4[1].z = tmpvar_3.y;
+ tmpvar_4[2].x = tmpvar_1.z;
+ tmpvar_4[2].y = tmpvar_2.z;
+ tmpvar_4[2].z = tmpvar_3.z;
+ vec3 normal_5;
+ normal_5.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0);
+ normal_5.xy = (normal_5.xy * _BumpScale);
+ normal_5.z = sqrt((1.0 - clamp (
+ dot (normal_5.xy, normal_5.xy)
+ , 0.0, 1.0)));
+ vec3 normal_6;
+ normal_6.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0);
+ normal_6.xy = (normal_6.xy * _DetailNormalMapScale);
+ normal_6.z = sqrt((1.0 - clamp (
+ dot (normal_6.xy, normal_6.xy)
+ , 0.0, 1.0)));
+ vec3 tmpvar_7;
+ tmpvar_7.xy = (normal_5.xy + normal_6.xy);
+ tmpvar_7.z = (normal_5.z * normal_6.z);
+ vec3 tmpvar_8;
+ vec4 cse_9;
+ cse_9 = texture2D (_DetailMask, xlv_TEXCOORD0.xy);
+ tmpvar_8 = normalize((mix (normal_5,
+ normalize(tmpvar_7)
+ , cse_9.www) * tmpvar_4));
+ vec4 tmpvar_10;
+ tmpvar_10 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy);
+ vec3 tmpvar_11;
+ tmpvar_11.x = xlv_TEXCOORD2.w;
+ tmpvar_11.y = xlv_TEXCOORD2_1.w;
+ tmpvar_11.z = xlv_TEXCOORD2_2.w;
+ vec4 shadows_12;
+ vec3 tmpvar_13;
+ tmpvar_13 = (xlv_TEXCOORD6.xyz / xlv_TEXCOORD6.w);
+ shadows_12.x = shadow2D (_ShadowMapTexture, (tmpvar_13 + _ShadowOffsets[0].xyz)).x;
+ shadows_12.y = shadow2D (_ShadowMapTexture, (tmpvar_13 + _ShadowOffsets[1].xyz)).x;
+ shadows_12.z = shadow2D (_ShadowMapTexture, (tmpvar_13 + _ShadowOffsets[2].xyz)).x;
+ shadows_12.w = shadow2D (_ShadowMapTexture, (tmpvar_13 + _ShadowOffsets[3].xyz)).x;
+ vec4 tmpvar_14;
+ tmpvar_14 = (_LightShadowData.xxxx + (shadows_12 * (1.0 - _LightShadowData.xxxx)));
+ shadows_12 = tmpvar_14;
+ vec3 tmpvar_15;
+ tmpvar_15 = normalize(tmpvar_11);
+ float tmpvar_16;
+ tmpvar_16 = max (0.0, dot (tmpvar_8, tmpvar_15));
+ vec3 tmpvar_17;
+ tmpvar_17 = ((_LightColor0.xyz + _LightColor0.xyz) * ((
+ (float((xlv_TEXCOORD5.z > 0.0)) * texture2D (_LightTexture0, ((xlv_TEXCOORD5.xy / xlv_TEXCOORD5.w) + 0.5)).w)
+ * texture2D (_LightTextureB0, vec2(
+ dot (xlv_TEXCOORD5.xyz, xlv_TEXCOORD5.xyz)
+ )).w) * dot (tmpvar_14, vec4(0.25, 0.25, 0.25, 0.25))));
+ vec3 viewDir_18;
+ viewDir_18 = -(normalize(xlv_TEXCOORD1));
+ float tmpvar_19;
+ tmpvar_19 = (1.0 - tmpvar_10.w);
+ vec3 tmpvar_20;
+ tmpvar_20 = normalize((tmpvar_15 + viewDir_18));
+ float tmpvar_21;
+ tmpvar_21 = max (0.0, dot (tmpvar_8, viewDir_18));
+ float tmpvar_22;
+ tmpvar_22 = max (0.0, dot (tmpvar_15, tmpvar_20));
+ float tmpvar_23;
+ tmpvar_23 = ((tmpvar_19 * tmpvar_19) * 0.797885);
+ float tmpvar_24;
+ float tmpvar_25;
+ tmpvar_25 = (10.0 / log2((
+ ((1.0 - tmpvar_19) * 0.968)
+ + 0.03)));
+ tmpvar_24 = (tmpvar_25 * tmpvar_25);
+ float tmpvar_26;
+ tmpvar_26 = (0.5 + ((
+ (2.0 * tmpvar_22)
+ * tmpvar_22) * tmpvar_19));
+ vec4 tmpvar_27;
+ tmpvar_27.w = 1.0;
+ tmpvar_27.xyz = (((
+ ((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (vec3((1.0 - cse_9.w)) + ((texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz * unity_ColorSpaceDouble.xyz) * cse_9.w)))
+ *
+ (1.0 - max (max (tmpvar_10.x, tmpvar_10.y), tmpvar_10.z))
+ ) * (tmpvar_17 *
+ (((1.0 + (
+ (tmpvar_26 - 1.0)
+ *
+ pow ((1.0001 - tmpvar_16), 5.0)
+ )) * (1.0 + (
+ (tmpvar_26 - 1.0)
+ *
+ pow ((1.0001 - tmpvar_21), 5.0)
+ ))) * tmpvar_16)
+ )) + ((
+ (max (0.0, ((
+ ((1.0/(((
+ (tmpvar_16 * (1.0 - tmpvar_23))
+ + tmpvar_23) * (
+ (tmpvar_21 * (1.0 - tmpvar_23))
+ + tmpvar_23)))) * (pow (max (0.0,
+ dot (tmpvar_8, tmpvar_20)
+ ), tmpvar_24) * ((tmpvar_24 + 1.0) / 6.28319)))
+ * tmpvar_16) / 4.0)) * 3.14159)
+ * tmpvar_17) * (tmpvar_10.xyz +
+ ((1.0 - tmpvar_10.xyz) * pow (abs((1.0 -
+ max (0.0, dot (viewDir_18, tmpvar_20))
+ )), 5.0))
+ )));
+ vec4 xlat_varoutput_28;
+ xlat_varoutput_28.xyz = tmpvar_27.xyz;
+ xlat_varoutput_28.w = 1.0;
+ gl_FragData[0] = xlat_varoutput_28;
+}
+