diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2015-01-05 14:14:36 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2015-01-05 16:04:18 -0800 |
commit | f4e5cbd191d1a644a29eef3da51d4d8a4630d12a (patch) | |
tree | 85a71101e1434e9cab19b21ad8289238f1d27a52 /shaders | |
parent | c6a13041fa143cbc6749bb3f10d23c3afe66edec (diff) |
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.
Diffstat (limited to 'shaders')
36 files changed, 6544 insertions, 0 deletions
diff --git a/shaders/unity/121-WorldNormalReflBump.shader_test b/shaders/unity/121-WorldNormalReflBump.shader_test new file mode 100644 index 0000000..7b8c124 --- /dev/null +++ b/shaders/unity/121-WorldNormalReflBump.shader_test @@ -0,0 +1,152 @@ +# 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; +} + diff --git a/shaders/unity/129-WrappedDiffuse.shader_test b/shaders/unity/129-WrappedDiffuse.shader_test new file mode 100644 index 0000000..71fcbbe --- /dev/null +++ b/shaders/unity/129-WrappedDiffuse.shader_test @@ -0,0 +1,91 @@ +# 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; +} + diff --git a/shaders/unity/131-ColoredSpecular.shader_test b/shaders/unity/131-ColoredSpecular.shader_test new file mode 100644 index 0000000..7efc7b5 --- /dev/null +++ b/shaders/unity/131-ColoredSpecular.shader_test @@ -0,0 +1,107 @@ +# 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; +} + diff --git a/shaders/unity/139-ScreenPos.shader_test b/shaders/unity/139-ScreenPos.shader_test new file mode 100644 index 0000000..dfceed4 --- /dev/null +++ b/shaders/unity/139-ScreenPos.shader_test @@ -0,0 +1,101 @@ +# 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; +} + diff --git a/shaders/unity/15.shader_test b/shaders/unity/15.shader_test new file mode 100644 index 0000000..7fa3fc8 --- /dev/null +++ b/shaders/unity/15.shader_test @@ -0,0 +1,87 @@ +# 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); +} + diff --git a/shaders/unity/151-Slices.shader_test b/shaders/unity/151-Slices.shader_test new file mode 100644 index 0000000..b5c7016 --- /dev/null +++ b/shaders/unity/151-Slices.shader_test @@ -0,0 +1,68 @@ +# 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; +} + diff --git a/shaders/unity/156-RimLighting.shader_test b/shaders/unity/156-RimLighting.shader_test new file mode 100644 index 0000000..e553da6 --- /dev/null +++ b/shaders/unity/156-RimLighting.shader_test @@ -0,0 +1,102 @@ +# 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; +} + diff --git a/shaders/unity/159-RimLightBump.shader_test b/shaders/unity/159-RimLightBump.shader_test new file mode 100644 index 0000000..aa85f64 --- /dev/null +++ b/shaders/unity/159-RimLightBump.shader_test @@ -0,0 +1,99 @@ +# 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; +attribute vec4 TANGENT; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +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))); + mat3 tmpvar_5; + tmpvar_5[0] = _Object2World[0].xyz; + tmpvar_5[1] = _Object2World[1].xyz; + tmpvar_5[2] = _Object2World[2].xyz; + vec3 tmpvar_6; + tmpvar_6 = normalize((tmpvar_5 * TANGENT.xyz)); + vec3 tmpvar_7; + tmpvar_7 = (((tmpvar_4.yzx * tmpvar_6.zxy) - (tmpvar_4.zxy * tmpvar_6.yzx)) * TANGENT.w); + vec3 tmpvar_8; + tmpvar_8.x = tmpvar_6.x; + tmpvar_8.y = tmpvar_7.x; + tmpvar_8.z = tmpvar_4.x; + vec3 tmpvar_9; + tmpvar_9.x = tmpvar_6.y; + tmpvar_9.y = tmpvar_7.y; + tmpvar_9.z = tmpvar_4.y; + vec3 tmpvar_10; + tmpvar_10.x = tmpvar_6.z; + tmpvar_10.y = tmpvar_7.z; + tmpvar_10.z = tmpvar_4.z; + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw); + xlv_TEXCOORD1 = tmpvar_8; + xlv_TEXCOORD2 = tmpvar_9; + xlv_TEXCOORD3 = tmpvar_10; + xlv_TEXCOORD4 = (_Object2World * gl_Vertex).xyz; +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _BumpMap; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +void main () +{ + vec3 worldN_1; + vec4 c_2; + vec3 normal_3; + normal_3.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0).wy * 2.0) - 1.0); + normal_3.z = sqrt((1.0 - clamp ( + dot (normal_3.xy, normal_3.xy) + , 0.0, 1.0))); + worldN_1.x = dot (xlv_TEXCOORD1, normal_3); + worldN_1.y = dot (xlv_TEXCOORD2, normal_3); + worldN_1.z = dot (xlv_TEXCOORD3, normal_3); + vec4 c_4; + c_4.xyz = ((texture2D (_MainTex, xlv_TEXCOORD0).xyz * _LightColor0.xyz) * (max (0.0, + dot (worldN_1, _WorldSpaceLightPos0.xyz) + ) * 2.0)); + c_4.w = 0.0; + c_2.xyz = c_4.xyz; + c_2.w = 1.0; + gl_FragData[0] = c_2; +} + diff --git a/shaders/unity/23-Tree.shader_test b/shaders/unity/23-Tree.shader_test new file mode 100644 index 0000000..d31fa45 --- /dev/null +++ b/shaders/unity/23-Tree.shader_test @@ -0,0 +1,263 @@ +# Built-in shader from Unity 5.0.0b19: +# Nature/SpeedTree +# internal variant: SHADOWS_DEPTH 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 float _WindQuality; +uniform float _WindEnabled; +uniform vec4 _ST_WindVector; +uniform vec4 _ST_WindGlobal; +uniform vec4 _ST_WindBranch; +uniform vec4 _ST_WindBranchTwitch; +uniform vec4 _ST_WindBranchWhip; +uniform vec4 _ST_WindBranchAnchor; +uniform vec4 _ST_WindBranchAdherences; +uniform vec4 _ST_WindTurbulences; +uniform vec4 _ST_WindAnimation; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = gl_Vertex; + vec3 vRotatedBranchAnchor_2; + vec3 vRotatedWindVector_3; + vec3 FinalPosition_4; + vec3 tmpvar_5; + tmpvar_5 = gl_Vertex.xyz; + FinalPosition_4 = tmpvar_5; + vec3 tmpvar_6; + tmpvar_6.x = _Object2World[3].x; + tmpvar_6.y = _Object2World[3].y; + tmpvar_6.z = _Object2World[3].z; + float tmpvar_7; + tmpvar_7 = (_WindQuality * _WindEnabled); + if ((tmpvar_7 > 0.0)) { + mat3 tmpvar_8; + tmpvar_8[0] = _World2Object[0].xyz; + tmpvar_8[1] = _World2Object[1].xyz; + tmpvar_8[2] = _World2Object[2].xyz; + vRotatedWindVector_3 = normalize((tmpvar_8 * _ST_WindVector.xyz)); + mat3 tmpvar_9; + tmpvar_9[0] = _World2Object[0].xyz; + tmpvar_9[1] = _World2Object[1].xyz; + tmpvar_9[2] = _World2Object[2].xyz; + vRotatedBranchAnchor_2 = (normalize((tmpvar_9 * _ST_WindBranchAnchor.xyz)) * _ST_WindBranchAnchor.w); + } else { + vRotatedWindVector_3 = vec3(0.0, 0.0, 0.0); + vRotatedBranchAnchor_2 = vec3(0.0, 0.0, 0.0); + }; + if ((tmpvar_7 >= 3.0)) { + vec3 vPos_10; + vPos_10 = tmpvar_5; + if ((tmpvar_7 == 5.0)) { + vec3 vPos_11; + vPos_11 = tmpvar_5; + float fAdherenceScale_12; + vec3 tmpvar_13; + tmpvar_13 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_14; + tmpvar_14 = (_ST_WindBranch.x + (tmpvar_6.x + tmpvar_6.y)); + vec4 vOscillations_15; + float fOscillation_16; + fOscillation_16 = 1.0; + float fAmount_17; + float fTarget_18; + vec4 tmpvar_19; + tmpvar_19.x = (tmpvar_14 + gl_MultiTexCoord0.w); + tmpvar_19.y = ((tmpvar_14 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_19.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_14 + gl_MultiTexCoord0.w)); + tmpvar_19.w = ((tmpvar_14 + gl_MultiTexCoord0.w) + (1.0 - gl_MultiTexCoord0.z)); + vec4 tmpvar_20; + tmpvar_20 = abs((( + fract((tmpvar_19 + 0.5)) + * 2.0) - 1.0)); + vOscillations_15 = ((( + (tmpvar_20 * tmpvar_20) + * + (3.0 - (2.0 * tmpvar_20)) + ) - 0.5) * 2.0); + float tmpvar_21; + tmpvar_21 = (vOscillations_15.y * vOscillations_15.z); + fTarget_18 = 1.0; + fAmount_17 = tmpvar_21; + if ((tmpvar_21 < 0.0)) { + fTarget_18 = -1.0; + fAmount_17 = -(tmpvar_21); + }; + fOscillation_16 = ((( + (mix (mix (tmpvar_21, fTarget_18, fAmount_17), fTarget_18, fAmount_17) * _ST_WindBranchTwitch.x) + * + (1.0 - _ST_WindVector.w) + ) + (vOscillations_15.x * + (1.0 - _ST_WindBranchTwitch.x) + )) * (1.0 + (vOscillations_15.w * _ST_WindBranchWhip.x))); + vPos_11 = (gl_Vertex.xyz + ((tmpvar_13 * fOscillation_16) * _ST_WindBranch.y)); + vec4 tmpvar_22; + tmpvar_22.zw = vec2(0.0, 0.0); + tmpvar_22.x = ((tmpvar_14 * 0.1) + gl_MultiTexCoord0.w); + tmpvar_22.y = (((_ST_WindAnimation.x * _ST_WindTurbulences.x) * 0.1) + gl_MultiTexCoord0.w); + vec4 tmpvar_23; + vec4 tmpvar_24; + tmpvar_24 = abs((( + fract((tmpvar_22 + 0.5)) + * 2.0) - 1.0)); + tmpvar_23 = ((( + (tmpvar_24 * tmpvar_24) + * + (3.0 - (2.0 * tmpvar_24)) + ) - 0.5) * 2.0); + fAdherenceScale_12 = (1.0 - (( + ((tmpvar_23.x * tmpvar_23.y) * tmpvar_23.x) + * tmpvar_23.y) * _ST_WindTurbulences.x)); + fAdherenceScale_12 = (fAdherenceScale_12 + ((vOscillations_15.w * _ST_WindVector.w) * _ST_WindBranchWhip.x)); + vPos_11 = (vPos_11 + (( + ((vRotatedBranchAnchor_2 - vPos_11) * _ST_WindBranchAdherences.y) + * fAdherenceScale_12) * gl_MultiTexCoord0.z)); + vPos_10 = vPos_11; + } else { + vec3 vPos_25; + vPos_25 = vPos_10; + vec3 tmpvar_26; + tmpvar_26 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_27; + tmpvar_27 = (_ST_WindBranch.x + (tmpvar_6.x + tmpvar_6.y)); + vec4 vOscillations_28; + float fAmount_29; + float fTarget_30; + vec4 tmpvar_31; + tmpvar_31.w = 0.0; + tmpvar_31.x = (tmpvar_27 + gl_MultiTexCoord0.w); + tmpvar_31.y = ((tmpvar_27 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_31.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_27 + gl_MultiTexCoord0.w)); + vec4 tmpvar_32; + tmpvar_32 = abs((( + fract((tmpvar_31 + 0.5)) + * 2.0) - 1.0)); + vOscillations_28 = ((( + (tmpvar_32 * tmpvar_32) + * + (3.0 - (2.0 * tmpvar_32)) + ) - 0.5) * 2.0); + float tmpvar_33; + tmpvar_33 = (vOscillations_28.y * vOscillations_28.z); + fTarget_30 = 1.0; + fAmount_29 = tmpvar_33; + if ((tmpvar_33 < 0.0)) { + fTarget_30 = -1.0; + fAmount_29 = -(tmpvar_33); + }; + vPos_25 = (vPos_10 + ((tmpvar_26 * + (((mix ( + mix (tmpvar_33, fTarget_30, fAmount_29) + , fTarget_30, fAmount_29) * _ST_WindBranchTwitch.x) * (1.0 - _ST_WindVector.w)) + (vOscillations_28.x * (1.0 - _ST_WindBranchTwitch.x))) + ) * _ST_WindBranch.y)); + vPos_10 = vPos_25; + }; + FinalPosition_4 = vPos_10; + }; + if ((tmpvar_7 > 0.0)) { + vec3 vPos_34; + vPos_34 = FinalPosition_4; + float fAdjust_35; + float fLength_36; + fLength_36 = sqrt(dot (FinalPosition_4, FinalPosition_4)); + float tmpvar_37; + tmpvar_37 = (max ((FinalPosition_4.y - + ((1.0/(_ST_WindGlobal.z)) * 0.25) + ), 0.0) * _ST_WindGlobal.z); + fAdjust_35 = tmpvar_37; + if ((tmpvar_37 != 0.0)) { + fAdjust_35 = pow (tmpvar_37, _ST_WindGlobal.w); + }; + vec4 tmpvar_38; + tmpvar_38.zw = vec2(0.0, 0.0); + tmpvar_38.x = (tmpvar_6.x + _ST_WindGlobal.x); + tmpvar_38.y = (tmpvar_6.y + (_ST_WindGlobal.x * 0.8)); + vec4 tmpvar_39; + vec4 tmpvar_40; + tmpvar_40 = abs((( + fract((tmpvar_38 + 0.5)) + * 2.0) - 1.0)); + tmpvar_39 = ((( + (tmpvar_40 * tmpvar_40) + * + (3.0 - (2.0 * tmpvar_40)) + ) - 0.5) * 2.0); + vPos_34.xz = (FinalPosition_4.xz + (vRotatedWindVector_3.xz * ( + ((_ST_WindGlobal.y * (tmpvar_39.x + (tmpvar_39.y * tmpvar_39.y))) + (_ST_WindBranchAdherences.x / _ST_WindGlobal.z)) + * fAdjust_35))); + vPos_34 = (normalize(vPos_34) * fLength_36); + FinalPosition_4 = vPos_34; + }; + tmpvar_1.xyz = FinalPosition_4; + vec3 vertex_41; + vertex_41 = tmpvar_1.xyz; + vec4 clipPos_42; + if ((unity_LightShadowBias.z != 0.0)) { + vec4 tmpvar_43; + tmpvar_43.w = 1.0; + tmpvar_43.xyz = vertex_41; + vec3 tmpvar_44; + tmpvar_44 = (_Object2World * tmpvar_43).xyz; + vec4 v_45; + v_45.x = _World2Object[0].x; + v_45.y = _World2Object[1].x; + v_45.z = _World2Object[2].x; + v_45.w = _World2Object[3].x; + vec4 v_46; + v_46.x = _World2Object[0].y; + v_46.y = _World2Object[1].y; + v_46.z = _World2Object[2].y; + v_46.w = _World2Object[3].y; + vec4 v_47; + v_47.x = _World2Object[0].z; + v_47.y = _World2Object[1].z; + v_47.z = _World2Object[2].z; + v_47.w = _World2Object[3].z; + vec3 tmpvar_48; + tmpvar_48 = normalize((( + (v_45.xyz * gl_Normal.x) + + + (v_46.xyz * gl_Normal.y) + ) + (v_47.xyz * gl_Normal.z))); + float tmpvar_49; + tmpvar_49 = dot (tmpvar_48, normalize((_WorldSpaceLightPos0.xyz - + (tmpvar_44 * _WorldSpaceLightPos0.w) + ))); + vec4 tmpvar_50; + tmpvar_50.w = 1.0; + tmpvar_50.xyz = (tmpvar_44 - (tmpvar_48 * (unity_LightShadowBias.z * + sqrt((1.0 - (tmpvar_49 * tmpvar_49))) + ))); + clipPos_42 = (unity_MatrixVP * tmpvar_50); + } else { + vec4 tmpvar_51; + tmpvar_51.w = 1.0; + tmpvar_51.xyz = vertex_41; + clipPos_42 = (gl_ModelViewProjectionMatrix * tmpvar_51); + }; + vec4 clipPos_52; + clipPos_52.xyw = clipPos_42.xyw; + clipPos_52.z = (clipPos_42.z + clamp ((unity_LightShadowBias.x / clipPos_42.w), 0.0, 1.0)); + clipPos_52.z = mix (clipPos_52.z, max (clipPos_52.z, -(clipPos_42.w)), unity_LightShadowBias.y); + gl_Position = clipPos_52; +} + +[fragment shader] +void main () +{ + gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); +} + diff --git a/shaders/unity/23.shader_test b/shaders/unity/23.shader_test new file mode 100644 index 0000000..4e2c812 --- /dev/null +++ b/shaders/unity/23.shader_test @@ -0,0 +1,43 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Camera-DepthNormalTexture +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + + +varying vec4 xlv_TEXCOORD0; +void main () +{ + vec4 tmpvar_1; + mat3 tmpvar_2; + tmpvar_2[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; + tmpvar_2[1] = gl_ModelViewMatrixInverseTranspose[1].xyz; + tmpvar_2[2] = gl_ModelViewMatrixInverseTranspose[2].xyz; + tmpvar_1.xyz = normalize((tmpvar_2 * gl_Normal)); + tmpvar_1.w = -(((gl_ModelViewMatrix * gl_Vertex).z * _ProjectionParams.w)); + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = tmpvar_1; +} + +[fragment shader] +varying vec4 xlv_TEXCOORD0; +void main () +{ + vec4 enc_1; + enc_1.xy = ((( + (xlv_TEXCOORD0.xy / (xlv_TEXCOORD0.z + 1.0)) + / 1.7777) * 0.5) + 0.5); + vec2 enc_2; + vec2 tmpvar_3; + tmpvar_3 = fract((vec2(1.0, 255.0) * xlv_TEXCOORD0.w)); + enc_2.y = tmpvar_3.y; + enc_2.x = (tmpvar_3.x - (tmpvar_3.y * 0.00392157)); + enc_1.zw = enc_2; + gl_FragData[0] = enc_1; +} + diff --git a/shaders/unity/236-PBSApproximationSlices.shader_test b/shaders/unity/236-PBSApproximationSlices.shader_test new file mode 100644 index 0000000..472e3f8 --- /dev/null +++ b/shaders/unity/236-PBSApproximationSlices.shader_test @@ -0,0 +1,138 @@ +# Built-in shader from Unity 5.0.0b19: +# Surface/Standard/Slices +# 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 unity_NHxRoughness; +uniform samplerCube unity_SpecCube; +uniform sampler2D _MainTex; +uniform vec4 unity_SpecCube_HDR; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +void main () +{ + vec3 tmpvar_1; + float tmpvar_2; + vec4 c_3; + vec3 tmpvar_4; + tmpvar_4 = normalize((_WorldSpaceCameraPos - xlv_TEXCOORD2)); + float x_5; + x_5 = (fract(( + (xlv_TEXCOORD2.y + (xlv_TEXCOORD2.z * 0.3)) + * 4.0)) - 0.5); + if ((x_5 < 0.0)) { + discard; + }; + vec4 tmpvar_6; + tmpvar_6 = texture2D (_MainTex, xlv_TEXCOORD0); + tmpvar_1 = (_LightColor0.xyz + _LightColor0.xyz); + tmpvar_2 = clamp (dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz), 0.0, 1.0); + vec3 tmpvar_7; + vec3 I_8; + I_8 = -(tmpvar_4); + vec4 tmpvar_9; + tmpvar_9.xyz = (I_8 - (2.0 * ( + dot (xlv_TEXCOORD1, I_8) + * xlv_TEXCOORD1))); + tmpvar_9.w = ((1.0 - tmpvar_6.w) * 7.0); + vec4 tmpvar_10; + tmpvar_10 = textureCube (unity_SpecCube, tmpvar_9.xyz, tmpvar_9.w); + tmpvar_7 = ((tmpvar_10.w * unity_SpecCube_HDR.x) * tmpvar_10.xyz); + vec4 c_11; + vec3 tmpvar_12; + tmpvar_12 = normalize(xlv_TEXCOORD1); + float tmpvar_13; + tmpvar_13 = (1.0 - tmpvar_6.x); + vec2 tmpvar_14; + tmpvar_14.x = dot (tmpvar_12, normalize((_WorldSpaceLightPos0.xyz + tmpvar_4))); + tmpvar_14.y = (1.0 - tmpvar_6.w); + float tmpvar_15; + tmpvar_15 = (1.0 - clamp (dot (tmpvar_12, tmpvar_4), 0.0, 1.0)); + float tmpvar_16; + tmpvar_16 = (tmpvar_15 * tmpvar_15); + c_11.xyz = (((vec3(tmpvar_13) * + (xlv_TEXCOORD3 + (tmpvar_1 * tmpvar_2)) + ) + (tmpvar_6.xyz * + (tmpvar_7 + (tmpvar_1 * ((texture2D (unity_NHxRoughness, tmpvar_14).w * 16.0) * tmpvar_2))) + )) + (tmpvar_7 * ( + (tmpvar_13 * tmpvar_6.w) + * + (tmpvar_16 * tmpvar_16) + ))); + c_11.w = 0.0; + c_3.xyz = c_11.xyz; + c_3.w = 1.0; + gl_FragData[0] = c_3; +} + diff --git a/shaders/unity/24-Tree.shader_test b/shaders/unity/24-Tree.shader_test new file mode 100644 index 0000000..8cc3f09 --- /dev/null +++ b/shaders/unity/24-Tree.shader_test @@ -0,0 +1,288 @@ +# Built-in shader from Unity 5.0.0b19: +# Nature/SpeedTree +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF GEOM_TYPE_BRANCH 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 float _WindQuality; +uniform float _WindEnabled; +uniform vec4 _ST_WindVector; +uniform vec4 _ST_WindGlobal; +uniform vec4 _ST_WindBranch; +uniform vec4 _ST_WindBranchTwitch; +uniform vec4 _ST_WindBranchWhip; +uniform vec4 _ST_WindBranchAnchor; +uniform vec4 _ST_WindBranchAdherences; +uniform vec4 _ST_WindTurbulences; +uniform vec4 _ST_WindAnimation; +uniform vec4 _Color; +varying vec3 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +void main () +{ + vec4 tmpvar_1; + vec3 tmpvar_2; + tmpvar_2.xy = gl_MultiTexCoord0.xy; + tmpvar_1.w = _Color.w; + tmpvar_1.xyz = (_Color.xyz * gl_Color.x); + vec4 tmpvar_3; + tmpvar_3 = gl_Vertex; + vec3 vRotatedBranchAnchor_4; + vec3 vRotatedWindVector_5; + vec3 FinalPosition_6; + vec3 tmpvar_7; + tmpvar_7 = gl_Vertex.xyz; + FinalPosition_6 = tmpvar_7; + vec3 tmpvar_8; + tmpvar_8.x = _Object2World[3].x; + tmpvar_8.y = _Object2World[3].y; + tmpvar_8.z = _Object2World[3].z; + float tmpvar_9; + tmpvar_9 = (_WindQuality * _WindEnabled); + if ((tmpvar_9 > 0.0)) { + mat3 tmpvar_10; + tmpvar_10[0] = _World2Object[0].xyz; + tmpvar_10[1] = _World2Object[1].xyz; + tmpvar_10[2] = _World2Object[2].xyz; + vRotatedWindVector_5 = normalize((tmpvar_10 * _ST_WindVector.xyz)); + mat3 tmpvar_11; + tmpvar_11[0] = _World2Object[0].xyz; + tmpvar_11[1] = _World2Object[1].xyz; + tmpvar_11[2] = _World2Object[2].xyz; + vRotatedBranchAnchor_4 = (normalize((tmpvar_11 * _ST_WindBranchAnchor.xyz)) * _ST_WindBranchAnchor.w); + } else { + vRotatedWindVector_5 = vec3(0.0, 0.0, 0.0); + vRotatedBranchAnchor_4 = vec3(0.0, 0.0, 0.0); + }; + if ((tmpvar_9 >= 3.0)) { + vec3 vPos_12; + vPos_12 = tmpvar_7; + if ((tmpvar_9 == 5.0)) { + vec3 vPos_13; + vPos_13 = tmpvar_7; + float fAdherenceScale_14; + vec3 tmpvar_15; + tmpvar_15 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_16; + tmpvar_16 = (_ST_WindBranch.x + (tmpvar_8.x + tmpvar_8.y)); + vec4 vOscillations_17; + float fOscillation_18; + fOscillation_18 = 1.0; + float fAmount_19; + float fTarget_20; + vec4 tmpvar_21; + tmpvar_21.x = (tmpvar_16 + gl_MultiTexCoord0.w); + tmpvar_21.y = ((tmpvar_16 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_21.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_16 + gl_MultiTexCoord0.w)); + tmpvar_21.w = ((tmpvar_16 + gl_MultiTexCoord0.w) + (1.0 - gl_MultiTexCoord0.z)); + vec4 tmpvar_22; + tmpvar_22 = abs((( + fract((tmpvar_21 + 0.5)) + * 2.0) - 1.0)); + vOscillations_17 = ((( + (tmpvar_22 * tmpvar_22) + * + (3.0 - (2.0 * tmpvar_22)) + ) - 0.5) * 2.0); + float tmpvar_23; + tmpvar_23 = (vOscillations_17.y * vOscillations_17.z); + fTarget_20 = 1.0; + fAmount_19 = tmpvar_23; + if ((tmpvar_23 < 0.0)) { + fTarget_20 = -1.0; + fAmount_19 = -(tmpvar_23); + }; + fOscillation_18 = ((( + (mix (mix (tmpvar_23, fTarget_20, fAmount_19), fTarget_20, fAmount_19) * _ST_WindBranchTwitch.x) + * + (1.0 - _ST_WindVector.w) + ) + (vOscillations_17.x * + (1.0 - _ST_WindBranchTwitch.x) + )) * (1.0 + (vOscillations_17.w * _ST_WindBranchWhip.x))); + vPos_13 = (gl_Vertex.xyz + ((tmpvar_15 * fOscillation_18) * _ST_WindBranch.y)); + vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.x = ((tmpvar_16 * 0.1) + gl_MultiTexCoord0.w); + tmpvar_24.y = (((_ST_WindAnimation.x * _ST_WindTurbulences.x) * 0.1) + gl_MultiTexCoord0.w); + vec4 tmpvar_25; + vec4 tmpvar_26; + tmpvar_26 = abs((( + fract((tmpvar_24 + 0.5)) + * 2.0) - 1.0)); + tmpvar_25 = ((( + (tmpvar_26 * tmpvar_26) + * + (3.0 - (2.0 * tmpvar_26)) + ) - 0.5) * 2.0); + fAdherenceScale_14 = (1.0 - (( + ((tmpvar_25.x * tmpvar_25.y) * tmpvar_25.x) + * tmpvar_25.y) * _ST_WindTurbulences.x)); + fAdherenceScale_14 = (fAdherenceScale_14 + ((vOscillations_17.w * _ST_WindVector.w) * _ST_WindBranchWhip.x)); + vPos_13 = (vPos_13 + (( + ((vRotatedBranchAnchor_4 - vPos_13) * _ST_WindBranchAdherences.y) + * fAdherenceScale_14) * gl_MultiTexCoord0.z)); + vPos_12 = vPos_13; + } else { + vec3 vPos_27; + vPos_27 = vPos_12; + vec3 tmpvar_28; + tmpvar_28 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_29; + tmpvar_29 = (_ST_WindBranch.x + (tmpvar_8.x + tmpvar_8.y)); + vec4 vOscillations_30; + float fAmount_31; + float fTarget_32; + vec4 tmpvar_33; + tmpvar_33.w = 0.0; + tmpvar_33.x = (tmpvar_29 + gl_MultiTexCoord0.w); + tmpvar_33.y = ((tmpvar_29 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_33.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_29 + gl_MultiTexCoord0.w)); + vec4 tmpvar_34; + tmpvar_34 = abs((( + fract((tmpvar_33 + 0.5)) + * 2.0) - 1.0)); + vOscillations_30 = ((( + (tmpvar_34 * tmpvar_34) + * + (3.0 - (2.0 * tmpvar_34)) + ) - 0.5) * 2.0); + float tmpvar_35; + tmpvar_35 = (vOscillations_30.y * vOscillations_30.z); + fTarget_32 = 1.0; + fAmount_31 = tmpvar_35; + if ((tmpvar_35 < 0.0)) { + fTarget_32 = -1.0; + fAmount_31 = -(tmpvar_35); + }; + vPos_27 = (vPos_12 + ((tmpvar_28 * + (((mix ( + mix (tmpvar_35, fTarget_32, fAmount_31) + , fTarget_32, fAmount_31) * _ST_WindBranchTwitch.x) * (1.0 - _ST_WindVector.w)) + (vOscillations_30.x * (1.0 - _ST_WindBranchTwitch.x))) + ) * _ST_WindBranch.y)); + vPos_12 = vPos_27; + }; + FinalPosition_6 = vPos_12; + }; + if ((tmpvar_9 > 0.0)) { + vec3 vPos_36; + vPos_36 = FinalPosition_6; + float fAdjust_37; + float fLength_38; + fLength_38 = sqrt(dot (FinalPosition_6, FinalPosition_6)); + float tmpvar_39; + tmpvar_39 = (max ((FinalPosition_6.y - + ((1.0/(_ST_WindGlobal.z)) * 0.25) + ), 0.0) * _ST_WindGlobal.z); + fAdjust_37 = tmpvar_39; + if ((tmpvar_39 != 0.0)) { + fAdjust_37 = pow (tmpvar_39, _ST_WindGlobal.w); + }; + vec4 tmpvar_40; + tmpvar_40.zw = vec2(0.0, 0.0); + tmpvar_40.x = (tmpvar_8.x + _ST_WindGlobal.x); + tmpvar_40.y = (tmpvar_8.y + (_ST_WindGlobal.x * 0.8)); + vec4 tmpvar_41; + vec4 tmpvar_42; + tmpvar_42 = abs((( + fract((tmpvar_40 + 0.5)) + * 2.0) - 1.0)); + tmpvar_41 = ((( + (tmpvar_42 * tmpvar_42) + * + (3.0 - (2.0 * tmpvar_42)) + ) - 0.5) * 2.0); + vPos_36.xz = (FinalPosition_6.xz + (vRotatedWindVector_5.xz * ( + ((_ST_WindGlobal.y * (tmpvar_41.x + (tmpvar_41.y * tmpvar_41.y))) + (_ST_WindBranchAdherences.x / _ST_WindGlobal.z)) + * fAdjust_37))); + vPos_36 = (normalize(vPos_36) * fLength_38); + FinalPosition_6 = vPos_36; + }; + tmpvar_3.xyz = FinalPosition_6; + vec4 v_43; + v_43.x = _World2Object[0].x; + v_43.y = _World2Object[1].x; + v_43.z = _World2Object[2].x; + v_43.w = _World2Object[3].x; + vec4 v_44; + v_44.x = _World2Object[0].y; + v_44.y = _World2Object[1].y; + v_44.z = _World2Object[2].y; + v_44.w = _World2Object[3].y; + vec4 v_45; + v_45.x = _World2Object[0].z; + v_45.y = _World2Object[1].z; + v_45.z = _World2Object[2].z; + v_45.w = _World2Object[3].z; + vec3 tmpvar_46; + tmpvar_46 = normalize((( + (v_43.xyz * gl_Normal.x) + + + (v_44.xyz * gl_Normal.y) + ) + (v_45.xyz * gl_Normal.z))); + vec4 tmpvar_47; + tmpvar_47.w = 1.0; + tmpvar_47.xyz = tmpvar_46; + vec3 x2_48; + vec3 x1_49; + x1_49.x = dot (unity_SHAr, tmpvar_47); + x1_49.y = dot (unity_SHAg, tmpvar_47); + x1_49.z = dot (unity_SHAb, tmpvar_47); + vec4 tmpvar_50; + tmpvar_50 = (tmpvar_46.xyzz * tmpvar_46.yzzx); + x2_48.x = dot (unity_SHBr, tmpvar_50); + x2_48.y = dot (unity_SHBg, tmpvar_50); + x2_48.z = dot (unity_SHBb, tmpvar_50); + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_3); + xlv_TEXCOORD0 = tmpvar_46; + xlv_TEXCOORD1 = tmpvar_1; + xlv_TEXCOORD2 = tmpvar_2; + xlv_TEXCOORD3 = ((x1_49 + x2_48) + (unity_SHC.xyz * ( + (tmpvar_46.x * tmpvar_46.x) + - + (tmpvar_46.y * tmpvar_46.y) + ))); +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +varying vec3 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +void main () +{ + vec4 c_1; + vec3 tmpvar_2; + tmpvar_2 = (texture2D (_MainTex, xlv_TEXCOORD2.xy).xyz * xlv_TEXCOORD1.xyz); + 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_TEXCOORD0, _WorldSpaceLightPos0.xyz) + ) * 2.0)); + c_3.w = 1.0; + c_1.xyz = (c_1 + c_3).xyz; + c_1.w = 1.0; + gl_FragData[0] = c_1; +} + diff --git a/shaders/unity/27-Tree.shader_test b/shaders/unity/27-Tree.shader_test new file mode 100644 index 0000000..d377203 --- /dev/null +++ b/shaders/unity/27-Tree.shader_test @@ -0,0 +1,325 @@ +# Built-in shader from Unity 5.0.0b19: +# Nature/SpeedTree +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF EFFECT_BUMP GEOM_TYPE_BRANCH 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 float _WindQuality; +uniform float _WindEnabled; +uniform vec4 _ST_WindVector; +uniform vec4 _ST_WindGlobal; +uniform vec4 _ST_WindBranch; +uniform vec4 _ST_WindBranchTwitch; +uniform vec4 _ST_WindBranchWhip; +uniform vec4 _ST_WindBranchAnchor; +uniform vec4 _ST_WindBranchAdherences; +uniform vec4 _ST_WindTurbulences; +uniform vec4 _ST_WindAnimation; +uniform vec4 _Color; +attribute vec4 TANGENT; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec3 xlv_TEXCOORD5; +void main () +{ + vec4 tmpvar_1; + vec3 tmpvar_2; + tmpvar_2.xy = gl_MultiTexCoord0.xy; + tmpvar_1.w = _Color.w; + tmpvar_1.xyz = (_Color.xyz * gl_Color.x); + vec4 tmpvar_3; + tmpvar_3 = gl_Vertex; + vec3 vRotatedBranchAnchor_4; + vec3 vRotatedWindVector_5; + vec3 FinalPosition_6; + vec3 tmpvar_7; + tmpvar_7 = gl_Vertex.xyz; + FinalPosition_6 = tmpvar_7; + vec3 tmpvar_8; + tmpvar_8.x = _Object2World[3].x; + tmpvar_8.y = _Object2World[3].y; + tmpvar_8.z = _Object2World[3].z; + float tmpvar_9; + tmpvar_9 = (_WindQuality * _WindEnabled); + if ((tmpvar_9 > 0.0)) { + mat3 tmpvar_10; + tmpvar_10[0] = _World2Object[0].xyz; + tmpvar_10[1] = _World2Object[1].xyz; + tmpvar_10[2] = _World2Object[2].xyz; + vRotatedWindVector_5 = normalize((tmpvar_10 * _ST_WindVector.xyz)); + mat3 tmpvar_11; + tmpvar_11[0] = _World2Object[0].xyz; + tmpvar_11[1] = _World2Object[1].xyz; + tmpvar_11[2] = _World2Object[2].xyz; + vRotatedBranchAnchor_4 = (normalize((tmpvar_11 * _ST_WindBranchAnchor.xyz)) * _ST_WindBranchAnchor.w); + } else { + vRotatedWindVector_5 = vec3(0.0, 0.0, 0.0); + vRotatedBranchAnchor_4 = vec3(0.0, 0.0, 0.0); + }; + if ((tmpvar_9 >= 3.0)) { + vec3 vPos_12; + vPos_12 = tmpvar_7; + if ((tmpvar_9 == 5.0)) { + vec3 vPos_13; + vPos_13 = tmpvar_7; + float fAdherenceScale_14; + vec3 tmpvar_15; + tmpvar_15 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_16; + tmpvar_16 = (_ST_WindBranch.x + (tmpvar_8.x + tmpvar_8.y)); + vec4 vOscillations_17; + float fOscillation_18; + fOscillation_18 = 1.0; + float fAmount_19; + float fTarget_20; + vec4 tmpvar_21; + tmpvar_21.x = (tmpvar_16 + gl_MultiTexCoord0.w); + tmpvar_21.y = ((tmpvar_16 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_21.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_16 + gl_MultiTexCoord0.w)); + tmpvar_21.w = ((tmpvar_16 + gl_MultiTexCoord0.w) + (1.0 - gl_MultiTexCoord0.z)); + vec4 tmpvar_22; + tmpvar_22 = abs((( + fract((tmpvar_21 + 0.5)) + * 2.0) - 1.0)); + vOscillations_17 = ((( + (tmpvar_22 * tmpvar_22) + * + (3.0 - (2.0 * tmpvar_22)) + ) - 0.5) * 2.0); + float tmpvar_23; + tmpvar_23 = (vOscillations_17.y * vOscillations_17.z); + fTarget_20 = 1.0; + fAmount_19 = tmpvar_23; + if ((tmpvar_23 < 0.0)) { + fTarget_20 = -1.0; + fAmount_19 = -(tmpvar_23); + }; + fOscillation_18 = ((( + (mix (mix (tmpvar_23, fTarget_20, fAmount_19), fTarget_20, fAmount_19) * _ST_WindBranchTwitch.x) + * + (1.0 - _ST_WindVector.w) + ) + (vOscillations_17.x * + (1.0 - _ST_WindBranchTwitch.x) + )) * (1.0 + (vOscillations_17.w * _ST_WindBranchWhip.x))); + vPos_13 = (gl_Vertex.xyz + ((tmpvar_15 * fOscillation_18) * _ST_WindBranch.y)); + vec4 tmpvar_24; + tmpvar_24.zw = vec2(0.0, 0.0); + tmpvar_24.x = ((tmpvar_16 * 0.1) + gl_MultiTexCoord0.w); + tmpvar_24.y = (((_ST_WindAnimation.x * _ST_WindTurbulences.x) * 0.1) + gl_MultiTexCoord0.w); + vec4 tmpvar_25; + vec4 tmpvar_26; + tmpvar_26 = abs((( + fract((tmpvar_24 + 0.5)) + * 2.0) - 1.0)); + tmpvar_25 = ((( + (tmpvar_26 * tmpvar_26) + * + (3.0 - (2.0 * tmpvar_26)) + ) - 0.5) * 2.0); + fAdherenceScale_14 = (1.0 - (( + ((tmpvar_25.x * tmpvar_25.y) * tmpvar_25.x) + * tmpvar_25.y) * _ST_WindTurbulences.x)); + fAdherenceScale_14 = (fAdherenceScale_14 + ((vOscillations_17.w * _ST_WindVector.w) * _ST_WindBranchWhip.x)); + vPos_13 = (vPos_13 + (( + ((vRotatedBranchAnchor_4 - vPos_13) * _ST_WindBranchAdherences.y) + * fAdherenceScale_14) * gl_MultiTexCoord0.z)); + vPos_12 = vPos_13; + } else { + vec3 vPos_27; + vPos_27 = vPos_12; + vec3 tmpvar_28; + tmpvar_28 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_29; + tmpvar_29 = (_ST_WindBranch.x + (tmpvar_8.x + tmpvar_8.y)); + vec4 vOscillations_30; + float fAmount_31; + float fTarget_32; + vec4 tmpvar_33; + tmpvar_33.w = 0.0; + tmpvar_33.x = (tmpvar_29 + gl_MultiTexCoord0.w); + tmpvar_33.y = ((tmpvar_29 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_33.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_29 + gl_MultiTexCoord0.w)); + vec4 tmpvar_34; + tmpvar_34 = abs((( + fract((tmpvar_33 + 0.5)) + * 2.0) - 1.0)); + vOscillations_30 = ((( + (tmpvar_34 * tmpvar_34) + * + (3.0 - (2.0 * tmpvar_34)) + ) - 0.5) * 2.0); + float tmpvar_35; + tmpvar_35 = (vOscillations_30.y * vOscillations_30.z); + fTarget_32 = 1.0; + fAmount_31 = tmpvar_35; + if ((tmpvar_35 < 0.0)) { + fTarget_32 = -1.0; + fAmount_31 = -(tmpvar_35); + }; + vPos_27 = (vPos_12 + ((tmpvar_28 * + (((mix ( + mix (tmpvar_35, fTarget_32, fAmount_31) + , fTarget_32, fAmount_31) * _ST_WindBranchTwitch.x) * (1.0 - _ST_WindVector.w)) + (vOscillations_30.x * (1.0 - _ST_WindBranchTwitch.x))) + ) * _ST_WindBranch.y)); + vPos_12 = vPos_27; + }; + FinalPosition_6 = vPos_12; + }; + if ((tmpvar_9 > 0.0)) { + vec3 vPos_36; + vPos_36 = FinalPosition_6; + float fAdjust_37; + float fLength_38; + fLength_38 = sqrt(dot (FinalPosition_6, FinalPosition_6)); + float tmpvar_39; + tmpvar_39 = (max ((FinalPosition_6.y - + ((1.0/(_ST_WindGlobal.z)) * 0.25) + ), 0.0) * _ST_WindGlobal.z); + fAdjust_37 = tmpvar_39; + if ((tmpvar_39 != 0.0)) { + fAdjust_37 = pow (tmpvar_39, _ST_WindGlobal.w); + }; + vec4 tmpvar_40; + tmpvar_40.zw = vec2(0.0, 0.0); + tmpvar_40.x = (tmpvar_8.x + _ST_WindGlobal.x); + tmpvar_40.y = (tmpvar_8.y + (_ST_WindGlobal.x * 0.8)); + vec4 tmpvar_41; + vec4 tmpvar_42; + tmpvar_42 = abs((( + fract((tmpvar_40 + 0.5)) + * 2.0) - 1.0)); + tmpvar_41 = ((( + (tmpvar_42 * tmpvar_42) + * + (3.0 - (2.0 * tmpvar_42)) + ) - 0.5) * 2.0); + vPos_36.xz = (FinalPosition_6.xz + (vRotatedWindVector_5.xz * ( + ((_ST_WindGlobal.y * (tmpvar_41.x + (tmpvar_41.y * tmpvar_41.y))) + (_ST_WindBranchAdherences.x / _ST_WindGlobal.z)) + * fAdjust_37))); + vPos_36 = (normalize(vPos_36) * fLength_38); + FinalPosition_6 = vPos_36; + }; + tmpvar_3.xyz = FinalPosition_6; + vec4 v_43; + v_43.x = _World2Object[0].x; + v_43.y = _World2Object[1].x; + v_43.z = _World2Object[2].x; + v_43.w = _World2Object[3].x; + vec4 v_44; + v_44.x = _World2Object[0].y; + v_44.y = _World2Object[1].y; + v_44.z = _World2Object[2].y; + v_44.w = _World2Object[3].y; + vec4 v_45; + v_45.x = _World2Object[0].z; + v_45.y = _World2Object[1].z; + v_45.z = _World2Object[2].z; + v_45.w = _World2Object[3].z; + vec3 tmpvar_46; + tmpvar_46 = normalize((( + (v_43.xyz * gl_Normal.x) + + + (v_44.xyz * gl_Normal.y) + ) + (v_45.xyz * gl_Normal.z))); + mat3 tmpvar_47; + tmpvar_47[0] = _Object2World[0].xyz; + tmpvar_47[1] = _Object2World[1].xyz; + tmpvar_47[2] = _Object2World[2].xyz; + vec3 tmpvar_48; + tmpvar_48 = normalize((tmpvar_47 * TANGENT.xyz)); + vec3 tmpvar_49; + tmpvar_49 = (((tmpvar_46.yzx * tmpvar_48.zxy) - (tmpvar_46.zxy * tmpvar_48.yzx)) * TANGENT.w); + vec3 tmpvar_50; + tmpvar_50.x = tmpvar_48.x; + tmpvar_50.y = tmpvar_49.x; + tmpvar_50.z = tmpvar_46.x; + vec3 tmpvar_51; + tmpvar_51.x = tmpvar_48.y; + tmpvar_51.y = tmpvar_49.y; + tmpvar_51.z = tmpvar_46.y; + vec3 tmpvar_52; + tmpvar_52.x = tmpvar_48.z; + tmpvar_52.y = tmpvar_49.z; + tmpvar_52.z = tmpvar_46.z; + vec4 tmpvar_53; + tmpvar_53.w = 1.0; + tmpvar_53.xyz = tmpvar_46; + vec3 x2_54; + vec3 x1_55; + x1_55.x = dot (unity_SHAr, tmpvar_53); + x1_55.y = dot (unity_SHAg, tmpvar_53); + x1_55.z = dot (unity_SHAb, tmpvar_53); + vec4 tmpvar_56; + tmpvar_56 = (tmpvar_46.xyzz * tmpvar_46.yzzx); + x2_54.x = dot (unity_SHBr, tmpvar_56); + x2_54.y = dot (unity_SHBg, tmpvar_56); + x2_54.z = dot (unity_SHBb, tmpvar_56); + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_3); + xlv_TEXCOORD0 = tmpvar_50; + xlv_TEXCOORD1 = tmpvar_51; + xlv_TEXCOORD2 = tmpvar_52; + xlv_TEXCOORD3 = tmpvar_1; + xlv_TEXCOORD4 = tmpvar_2; + xlv_TEXCOORD5 = ((x1_55 + x2_54) + (unity_SHC.xyz * ( + (tmpvar_46.x * tmpvar_46.x) + - + (tmpvar_46.y * tmpvar_46.y) + ))); +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _BumpMap; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec3 xlv_TEXCOORD5; +void main () +{ + vec3 worldN_1; + vec4 c_2; + vec3 tmpvar_3; + tmpvar_3 = (texture2D (_MainTex, xlv_TEXCOORD4.xy).xyz * xlv_TEXCOORD3.xyz); + vec3 normal_4; + normal_4.xy = ((texture2D (_BumpMap, xlv_TEXCOORD4.xy).wy * 2.0) - 1.0); + normal_4.z = sqrt((1.0 - clamp ( + dot (normal_4.xy, normal_4.xy) + , 0.0, 1.0))); + c_2.w = 0.0; + c_2.xyz = (tmpvar_3 * xlv_TEXCOORD5); + worldN_1.x = dot (xlv_TEXCOORD0, normal_4); + worldN_1.y = dot (xlv_TEXCOORD1, normal_4); + worldN_1.z = dot (xlv_TEXCOORD2, normal_4); + vec4 c_5; + c_5.xyz = ((tmpvar_3 * _LightColor0.xyz) * (max (0.0, + dot (worldN_1, _WorldSpaceLightPos0.xyz) + ) * 2.0)); + c_5.w = 1.0; + c_2.xyz = (c_2 + c_5).xyz; + c_2.w = 1.0; + gl_FragData[0] = c_2; +} + diff --git a/shaders/unity/286-PostFXHeightFog.shader_test b/shaders/unity/286-PostFXHeightFog.shader_test new file mode 100644 index 0000000..0eefe8e --- /dev/null +++ b/shaders/unity/286-PostFXHeightFog.shader_test @@ -0,0 +1,98 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/GlobalFog +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform mat4 _FrustumCornersWS; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = gl_MultiTexCoord0.xy; + vec4 tmpvar_2; + tmpvar_2.xyw = gl_Vertex.xyw; + vec4 tmpvar_3; + tmpvar_2.z = 0.1; + int i_4; + i_4 = int(gl_Vertex.z); + vec4 v_5; + v_5.x = _FrustumCornersWS[0][i_4]; + v_5.y = _FrustumCornersWS[1][i_4]; + v_5.z = _FrustumCornersWS[2][i_4]; + v_5.w = _FrustumCornersWS[3][i_4]; + tmpvar_3.xyz = v_5.xyz; + tmpvar_3.w = gl_Vertex.z; + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_2); + xlv_TEXCOORD0 = tmpvar_1; + xlv_TEXCOORD1 = tmpvar_1; + xlv_TEXCOORD2 = tmpvar_3; +} + +[fragment shader] +uniform vec4 _ZBufferParams; +uniform vec4 unity_FogColor; +uniform sampler2D _MainTex; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _HeightParams; +uniform vec4 _DistanceParams; +uniform int _SceneFogMode; +uniform vec4 _SceneFogParams; +uniform vec4 _CameraWS; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +void main () +{ + float fogFac_1; + float g_2; + vec4 tmpvar_3; + tmpvar_3 = texture2D (_MainTex, xlv_TEXCOORD0); + vec4 tmpvar_4; + tmpvar_4 = texture2D (_CameraDepthTexture, xlv_TEXCOORD1); + vec4 tmpvar_5; + tmpvar_5 = ((1.0/(( + (_ZBufferParams.x * tmpvar_4.x) + + _ZBufferParams.y))) * xlv_TEXCOORD2); + g_2 = (_DistanceParams.x + sqrt(dot (tmpvar_5.xyz, tmpvar_5.xyz))); + vec3 tmpvar_6; + tmpvar_6 = (_HeightParams.w * tmpvar_5.xyz); + float tmpvar_7; + tmpvar_7 = ((_CameraWS.xyz + tmpvar_5.xyz).y - _HeightParams.x); + float tmpvar_8; + tmpvar_8 = min (((1.0 - + (2.0 * _HeightParams.z) + ) * tmpvar_7), 0.0); + g_2 = (g_2 + (-( + sqrt(dot (tmpvar_6, tmpvar_6)) + ) * ( + (_HeightParams.z * (tmpvar_7 + _HeightParams.y)) + - + ((tmpvar_8 * tmpvar_8) / abs((tmpvar_5.y + 1e-05))) + ))); + float tmpvar_9; + tmpvar_9 = max (0.0, g_2); + float fogFac_10; + fogFac_10 = 0.0; + if ((_SceneFogMode == 1)) { + fogFac_10 = ((tmpvar_9 * _SceneFogParams.z) + _SceneFogParams.w); + }; + if ((_SceneFogMode == 2)) { + fogFac_10 = exp2(-((_SceneFogParams.y * tmpvar_9))); + }; + if ((_SceneFogMode == 3)) { + float tmpvar_11; + tmpvar_11 = (_SceneFogParams.x * tmpvar_9); + fogFac_10 = exp2((-(tmpvar_11) * tmpvar_11)); + }; + fogFac_1 = clamp (fogFac_10, 0.0, 1.0); + if ((tmpvar_4.x >= 0.999999)) { + fogFac_1 = 1.0; + }; + gl_FragData[0] = mix (unity_FogColor, tmpvar_3, vec4(fogFac_1)); +} + diff --git a/shaders/unity/30-Tree.shader_test b/shaders/unity/30-Tree.shader_test new file mode 100644 index 0000000..d87eb6b --- /dev/null +++ b/shaders/unity/30-Tree.shader_test @@ -0,0 +1,343 @@ +# Built-in shader from Unity 5.0.0b19: +# Nature/SpeedTree +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF EFFECT_BUMP EFFECT_HUE_VARIATION GEOM_TYPE_BRANCH 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 float _WindQuality; +uniform float _WindEnabled; +uniform vec4 _ST_WindVector; +uniform vec4 _ST_WindGlobal; +uniform vec4 _ST_WindBranch; +uniform vec4 _ST_WindBranchTwitch; +uniform vec4 _ST_WindBranchWhip; +uniform vec4 _ST_WindBranchAnchor; +uniform vec4 _ST_WindBranchAdherences; +uniform vec4 _ST_WindTurbulences; +uniform vec4 _ST_WindAnimation; +uniform vec4 _HueVariation; +uniform vec4 _Color; +attribute vec4 TANGENT; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec3 xlv_TEXCOORD5; +void main () +{ + vec4 tmpvar_1; + vec3 tmpvar_2; + tmpvar_2.xy = gl_MultiTexCoord0.xy; + tmpvar_1.w = _Color.w; + tmpvar_1.xyz = (_Color.xyz * gl_Color.x); + float cse_3; + cse_3 = _Object2World[3].x; + float cse_4; + cse_4 = _Object2World[3].y; + tmpvar_2.z = clamp ((( + fract(((cse_3 + cse_4) + _Object2World[3].z)) + + + ((fract(( + (gl_Vertex.x + gl_Normal.y) + + gl_Normal.x)) * 0.5) - 0.3) + ) * _HueVariation.w), 0.0, 1.0); + vec4 tmpvar_5; + tmpvar_5 = gl_Vertex; + vec3 vRotatedBranchAnchor_6; + vec3 vRotatedWindVector_7; + vec3 FinalPosition_8; + vec3 tmpvar_9; + tmpvar_9 = gl_Vertex.xyz; + FinalPosition_8 = tmpvar_9; + float tmpvar_10; + tmpvar_10 = (_WindQuality * _WindEnabled); + if ((tmpvar_10 > 0.0)) { + mat3 tmpvar_11; + tmpvar_11[0] = _World2Object[0].xyz; + tmpvar_11[1] = _World2Object[1].xyz; + tmpvar_11[2] = _World2Object[2].xyz; + vRotatedWindVector_7 = normalize((tmpvar_11 * _ST_WindVector.xyz)); + mat3 tmpvar_12; + tmpvar_12[0] = _World2Object[0].xyz; + tmpvar_12[1] = _World2Object[1].xyz; + tmpvar_12[2] = _World2Object[2].xyz; + vRotatedBranchAnchor_6 = (normalize((tmpvar_12 * _ST_WindBranchAnchor.xyz)) * _ST_WindBranchAnchor.w); + } else { + vRotatedWindVector_7 = vec3(0.0, 0.0, 0.0); + vRotatedBranchAnchor_6 = vec3(0.0, 0.0, 0.0); + }; + if ((tmpvar_10 >= 3.0)) { + vec3 vPos_13; + vPos_13 = tmpvar_9; + if ((tmpvar_10 == 5.0)) { + vec3 vPos_14; + vPos_14 = tmpvar_9; + float fAdherenceScale_15; + vec3 tmpvar_16; + tmpvar_16 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_17; + tmpvar_17 = (_ST_WindBranch.x + (cse_3 + cse_4)); + vec4 vOscillations_18; + float fOscillation_19; + fOscillation_19 = 1.0; + float fAmount_20; + float fTarget_21; + vec4 tmpvar_22; + tmpvar_22.x = (tmpvar_17 + gl_MultiTexCoord0.w); + tmpvar_22.y = ((tmpvar_17 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_22.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_17 + gl_MultiTexCoord0.w)); + tmpvar_22.w = ((tmpvar_17 + gl_MultiTexCoord0.w) + (1.0 - gl_MultiTexCoord0.z)); + vec4 tmpvar_23; + tmpvar_23 = abs((( + fract((tmpvar_22 + 0.5)) + * 2.0) - 1.0)); + vOscillations_18 = ((( + (tmpvar_23 * tmpvar_23) + * + (3.0 - (2.0 * tmpvar_23)) + ) - 0.5) * 2.0); + float tmpvar_24; + tmpvar_24 = (vOscillations_18.y * vOscillations_18.z); + fTarget_21 = 1.0; + fAmount_20 = tmpvar_24; + if ((tmpvar_24 < 0.0)) { + fTarget_21 = -1.0; + fAmount_20 = -(tmpvar_24); + }; + fOscillation_19 = ((( + (mix (mix (tmpvar_24, fTarget_21, fAmount_20), fTarget_21, fAmount_20) * _ST_WindBranchTwitch.x) + * + (1.0 - _ST_WindVector.w) + ) + (vOscillations_18.x * + (1.0 - _ST_WindBranchTwitch.x) + )) * (1.0 + (vOscillations_18.w * _ST_WindBranchWhip.x))); + vPos_14 = (gl_Vertex.xyz + ((tmpvar_16 * fOscillation_19) * _ST_WindBranch.y)); + vec4 tmpvar_25; + tmpvar_25.zw = vec2(0.0, 0.0); + tmpvar_25.x = ((tmpvar_17 * 0.1) + gl_MultiTexCoord0.w); + tmpvar_25.y = (((_ST_WindAnimation.x * _ST_WindTurbulences.x) * 0.1) + gl_MultiTexCoord0.w); + vec4 tmpvar_26; + vec4 tmpvar_27; + tmpvar_27 = abs((( + fract((tmpvar_25 + 0.5)) + * 2.0) - 1.0)); + tmpvar_26 = ((( + (tmpvar_27 * tmpvar_27) + * + (3.0 - (2.0 * tmpvar_27)) + ) - 0.5) * 2.0); + fAdherenceScale_15 = (1.0 - (( + ((tmpvar_26.x * tmpvar_26.y) * tmpvar_26.x) + * tmpvar_26.y) * _ST_WindTurbulences.x)); + fAdherenceScale_15 = (fAdherenceScale_15 + ((vOscillations_18.w * _ST_WindVector.w) * _ST_WindBranchWhip.x)); + vPos_14 = (vPos_14 + (( + ((vRotatedBranchAnchor_6 - vPos_14) * _ST_WindBranchAdherences.y) + * fAdherenceScale_15) * gl_MultiTexCoord0.z)); + vPos_13 = vPos_14; + } else { + vec3 vPos_28; + vPos_28 = vPos_13; + vec3 tmpvar_29; + tmpvar_29 = ((( + fract((gl_MultiTexCoord0.w / vec3(16.0, 1.0, 0.0625))) + * 2.0) - 1.0) * gl_MultiTexCoord0.z); + float tmpvar_30; + tmpvar_30 = (_ST_WindBranch.x + (cse_3 + cse_4)); + vec4 vOscillations_31; + float fAmount_32; + float fTarget_33; + vec4 tmpvar_34; + tmpvar_34.w = 0.0; + tmpvar_34.x = (tmpvar_30 + gl_MultiTexCoord0.w); + tmpvar_34.y = ((tmpvar_30 * _ST_WindBranchTwitch.y) + gl_MultiTexCoord0.w); + tmpvar_34.z = ((_ST_WindBranchTwitch.y * 0.5) * (tmpvar_30 + gl_MultiTexCoord0.w)); + vec4 tmpvar_35; + tmpvar_35 = abs((( + fract((tmpvar_34 + 0.5)) + * 2.0) - 1.0)); + vOscillations_31 = ((( + (tmpvar_35 * tmpvar_35) + * + (3.0 - (2.0 * tmpvar_35)) + ) - 0.5) * 2.0); + float tmpvar_36; + tmpvar_36 = (vOscillations_31.y * vOscillations_31.z); + fTarget_33 = 1.0; + fAmount_32 = tmpvar_36; + if ((tmpvar_36 < 0.0)) { + fTarget_33 = -1.0; + fAmount_32 = -(tmpvar_36); + }; + vPos_28 = (vPos_13 + ((tmpvar_29 * + (((mix ( + mix (tmpvar_36, fTarget_33, fAmount_32) + , fTarget_33, fAmount_32) * _ST_WindBranchTwitch.x) * (1.0 - _ST_WindVector.w)) + (vOscillations_31.x * (1.0 - _ST_WindBranchTwitch.x))) + ) * _ST_WindBranch.y)); + vPos_13 = vPos_28; + }; + FinalPosition_8 = vPos_13; + }; + if ((tmpvar_10 > 0.0)) { + vec3 vPos_37; + vPos_37 = FinalPosition_8; + float fAdjust_38; + float fLength_39; + fLength_39 = sqrt(dot (FinalPosition_8, FinalPosition_8)); + float tmpvar_40; + tmpvar_40 = (max ((FinalPosition_8.y - + ((1.0/(_ST_WindGlobal.z)) * 0.25) + ), 0.0) * _ST_WindGlobal.z); + fAdjust_38 = tmpvar_40; + if ((tmpvar_40 != 0.0)) { + fAdjust_38 = pow (tmpvar_40, _ST_WindGlobal.w); + }; + vec4 tmpvar_41; + tmpvar_41.zw = vec2(0.0, 0.0); + tmpvar_41.x = (cse_3 + _ST_WindGlobal.x); + tmpvar_41.y = (cse_4 + (_ST_WindGlobal.x * 0.8)); + vec4 tmpvar_42; + vec4 tmpvar_43; + tmpvar_43 = abs((( + fract((tmpvar_41 + 0.5)) + * 2.0) - 1.0)); + tmpvar_42 = ((( + (tmpvar_43 * tmpvar_43) + * + (3.0 - (2.0 * tmpvar_43)) + ) - 0.5) * 2.0); + vPos_37.xz = (FinalPosition_8.xz + (vRotatedWindVector_7.xz * ( + ((_ST_WindGlobal.y * (tmpvar_42.x + (tmpvar_42.y * tmpvar_42.y))) + (_ST_WindBranchAdherences.x / _ST_WindGlobal.z)) + * fAdjust_38))); + vPos_37 = (normalize(vPos_37) * fLength_39); + FinalPosition_8 = vPos_37; + }; + tmpvar_5.xyz = FinalPosition_8; + vec4 v_44; + v_44.x = _World2Object[0].x; + v_44.y = _World2Object[1].x; + v_44.z = _World2Object[2].x; + v_44.w = _World2Object[3].x; + vec4 v_45; + v_45.x = _World2Object[0].y; + v_45.y = _World2Object[1].y; + v_45.z = _World2Object[2].y; + v_45.w = _World2Object[3].y; + vec4 v_46; + v_46.x = _World2Object[0].z; + v_46.y = _World2Object[1].z; + v_46.z = _World2Object[2].z; + v_46.w = _World2Object[3].z; + vec3 tmpvar_47; + tmpvar_47 = normalize((( + (v_44.xyz * gl_Normal.x) + + + (v_45.xyz * gl_Normal.y) + ) + (v_46.xyz * gl_Normal.z))); + mat3 tmpvar_48; + tmpvar_48[0] = _Object2World[0].xyz; + tmpvar_48[1] = _Object2World[1].xyz; + tmpvar_48[2] = _Object2World[2].xyz; + vec3 tmpvar_49; + tmpvar_49 = normalize((tmpvar_48 * TANGENT.xyz)); + vec3 tmpvar_50; + tmpvar_50 = (((tmpvar_47.yzx * tmpvar_49.zxy) - (tmpvar_47.zxy * tmpvar_49.yzx)) * TANGENT.w); + vec3 tmpvar_51; + tmpvar_51.x = tmpvar_49.x; + tmpvar_51.y = tmpvar_50.x; + tmpvar_51.z = tmpvar_47.x; + vec3 tmpvar_52; + tmpvar_52.x = tmpvar_49.y; + tmpvar_52.y = tmpvar_50.y; + tmpvar_52.z = tmpvar_47.y; + vec3 tmpvar_53; + tmpvar_53.x = tmpvar_49.z; + tmpvar_53.y = tmpvar_50.z; + tmpvar_53.z = tmpvar_47.z; + vec4 tmpvar_54; + tmpvar_54.w = 1.0; + tmpvar_54.xyz = tmpvar_47; + vec3 x2_55; + vec3 x1_56; + x1_56.x = dot (unity_SHAr, tmpvar_54); + x1_56.y = dot (unity_SHAg, tmpvar_54); + x1_56.z = dot (unity_SHAb, tmpvar_54); + vec4 tmpvar_57; + tmpvar_57 = (tmpvar_47.xyzz * tmpvar_47.yzzx); + x2_55.x = dot (unity_SHBr, tmpvar_57); + x2_55.y = dot (unity_SHBg, tmpvar_57); + x2_55.z = dot (unity_SHBb, tmpvar_57); + gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_5); + xlv_TEXCOORD0 = tmpvar_51; + xlv_TEXCOORD1 = tmpvar_52; + xlv_TEXCOORD2 = tmpvar_53; + xlv_TEXCOORD3 = tmpvar_1; + xlv_TEXCOORD4 = tmpvar_2; + xlv_TEXCOORD5 = ((x1_56 + x2_55) + (unity_SHC.xyz * ( + (tmpvar_47.x * tmpvar_47.x) + - + (tmpvar_47.y * tmpvar_47.y) + ))); +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _HueVariation; +uniform sampler2D _BumpMap; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec3 xlv_TEXCOORD5; +void main () +{ + vec3 worldN_1; + vec4 c_2; + vec4 diffuseColor_3; + vec4 tmpvar_4; + tmpvar_4 = texture2D (_MainTex, xlv_TEXCOORD4.xy); + diffuseColor_3.w = min (1.0, (2.0 * tmpvar_4.w)); + vec3 tmpvar_5; + tmpvar_5 = mix (tmpvar_4.xyz, _HueVariation.xyz, xlv_TEXCOORD4.zzz); + diffuseColor_3.xyz = clamp ((tmpvar_5 * ( + ((max (tmpvar_4.x, max (tmpvar_4.y, tmpvar_4.z)) / max (tmpvar_5.x, max (tmpvar_5.y, tmpvar_5.z))) * 0.5) + + 0.5)), 0.0, 1.0); + vec3 tmpvar_6; + tmpvar_6 = (diffuseColor_3.xyz * xlv_TEXCOORD3.xyz); + vec3 normal_7; + normal_7.xy = ((texture2D (_BumpMap, xlv_TEXCOORD4.xy).wy * 2.0) - 1.0); + normal_7.z = sqrt((1.0 - clamp ( + dot (normal_7.xy, normal_7.xy) + , 0.0, 1.0))); + c_2.w = 0.0; + c_2.xyz = (tmpvar_6 * xlv_TEXCOORD5); + worldN_1.x = dot (xlv_TEXCOORD0, normal_7); + worldN_1.y = dot (xlv_TEXCOORD1, normal_7); + worldN_1.z = dot (xlv_TEXCOORD2, normal_7); + vec4 c_8; + c_8.xyz = ((tmpvar_6 * _LightColor0.xyz) * (max (0.0, + dot (worldN_1, _WorldSpaceLightPos0.xyz) + ) * 2.0)); + c_8.w = 1.0; + c_2.xyz = (c_2 + c_8).xyz; + c_2.w = 1.0; + gl_FragData[0] = c_2; +} + diff --git a/shaders/unity/33-GrassBillboard.shader_test b/shaders/unity/33-GrassBillboard.shader_test new file mode 100644 index 0000000..7159b7c --- /dev/null +++ b/shaders/unity/33-GrassBillboard.shader_test @@ -0,0 +1,149 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/TerrainEngine/Details/BillboardWavingDoublePass +# internal variant: SHADOWS_DEPTH 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 _WavingTint; +uniform vec4 _WaveAndDistance; +uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +attribute vec4 TANGENT; +varying vec2 xlv_TEXCOORD1; +varying vec4 xlv_COLOR0; +void main () +{ + vec2 tmpvar_1; + vec4 pos_2; + pos_2 = gl_Vertex; + vec2 offset_3; + offset_3 = TANGENT.xy; + vec3 tmpvar_4; + tmpvar_4 = (gl_Vertex.xyz - _CameraPosition.xyz); + float tmpvar_5; + tmpvar_5 = dot (tmpvar_4, tmpvar_4); + if ((tmpvar_5 > _WaveAndDistance.w)) { + offset_3 = vec2(0.0, 0.0); + }; + pos_2.xyz = (gl_Vertex.xyz + (offset_3.x * _CameraRight)); + pos_2.xyz = (pos_2.xyz + (offset_3.y * _CameraUp)); + vec4 vertex_6; + vertex_6.yw = pos_2.yw; + vec4 color_7; + color_7.xyz = gl_Color.xyz; + vec3 waveMove_8; + vec4 tmpvar_9; + tmpvar_9 = ((fract( + (((pos_2.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_2.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); + vec4 tmpvar_10; + tmpvar_10 = (tmpvar_9 * tmpvar_9); + vec4 tmpvar_11; + tmpvar_11 = (tmpvar_10 * tmpvar_9); + vec4 tmpvar_12; + tmpvar_12 = (tmpvar_11 * tmpvar_10); + vec4 tmpvar_13; + tmpvar_13 = (((tmpvar_9 + + (tmpvar_11 * -0.161616) + ) + (tmpvar_12 * 0.0083333)) + ((tmpvar_12 * tmpvar_10) * -0.00019841)); + vec4 tmpvar_14; + tmpvar_14 = (tmpvar_13 * tmpvar_13); + vec4 tmpvar_15; + tmpvar_15 = (tmpvar_14 * tmpvar_14); + vec4 tmpvar_16; + tmpvar_16 = (tmpvar_15 * TANGENT.y); + waveMove_8.y = 0.0; + waveMove_8.x = dot (tmpvar_16, vec4(0.024, 0.04, -0.12, 0.096)); + waveMove_8.z = dot (tmpvar_16, vec4(0.006, 0.02, -0.02, 0.1)); + vertex_6.xz = (pos_2.xz - (waveMove_8.xz * _WaveAndDistance.z)); + vec3 tmpvar_17; + tmpvar_17 = (vertex_6.xyz - _CameraPosition.xyz); + color_7.w = clamp (((2.0 * + (_WaveAndDistance.w - dot (tmpvar_17, tmpvar_17)) + ) * _CameraPosition.w), 0.0, 1.0); + vec4 tmpvar_18; + tmpvar_18.xyz = ((2.0 * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_15, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * gl_Color.xyz); + tmpvar_18.w = color_7.w; + tmpvar_1 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + vec3 vertex_19; + vertex_19 = vertex_6.xyz; + vec4 clipPos_20; + if ((unity_LightShadowBias.z != 0.0)) { + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = vertex_19; + vec3 tmpvar_22; + tmpvar_22 = (_Object2World * tmpvar_21).xyz; + vec4 v_23; + v_23.x = _World2Object[0].x; + v_23.y = _World2Object[1].x; + v_23.z = _World2Object[2].x; + v_23.w = _World2Object[3].x; + vec4 v_24; + v_24.x = _World2Object[0].y; + v_24.y = _World2Object[1].y; + v_24.z = _World2Object[2].y; + v_24.w = _World2Object[3].y; + vec4 v_25; + v_25.x = _World2Object[0].z; + v_25.y = _World2Object[1].z; + v_25.z = _World2Object[2].z; + v_25.w = _World2Object[3].z; + vec3 tmpvar_26; + tmpvar_26 = normalize((( + (v_23.xyz * gl_Normal.x) + + + (v_24.xyz * gl_Normal.y) + ) + (v_25.xyz * gl_Normal.z))); + float tmpvar_27; + tmpvar_27 = dot (tmpvar_26, normalize((_WorldSpaceLightPos0.xyz - + (tmpvar_22 * _WorldSpaceLightPos0.w) + ))); + vec4 tmpvar_28; + tmpvar_28.w = 1.0; + tmpvar_28.xyz = (tmpvar_22 - (tmpvar_26 * (unity_LightShadowBias.z * + sqrt((1.0 - (tmpvar_27 * tmpvar_27))) + ))); + clipPos_20 = (unity_MatrixVP * tmpvar_28); + } else { + vec4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = vertex_19; + clipPos_20 = (gl_ModelViewProjectionMatrix * tmpvar_29); + }; + vec4 clipPos_30; + clipPos_30.xyw = clipPos_20.xyw; + clipPos_30.z = (clipPos_20.z + clamp ((unity_LightShadowBias.x / clipPos_20.w), 0.0, 1.0)); + clipPos_30.z = mix (clipPos_30.z, max (clipPos_30.z, -(clipPos_20.w)), unity_LightShadowBias.y); + gl_Position = clipPos_30; + xlv_TEXCOORD1 = tmpvar_1; + xlv_COLOR0 = tmpvar_18; +} + +[fragment shader] +uniform sampler2D _MainTex; +uniform float _Cutoff; +varying vec2 xlv_TEXCOORD1; +varying vec4 xlv_COLOR0; +void main () +{ + float x_1; + x_1 = ((texture2D (_MainTex, xlv_TEXCOORD1) * xlv_COLOR0).w - _Cutoff); + if ((x_1 < 0.0)) { + discard; + }; + gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); +} + diff --git a/shaders/unity/37-Terrain.shader_test b/shaders/unity/37-Terrain.shader_test new file mode 100644 index 0000000..0585015 --- /dev/null +++ b/shaders/unity/37-Terrain.shader_test @@ -0,0 +1,132 @@ +# Built-in shader from Unity 5.0.0b19: +# Nature/Terrain/Diffuse +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_SCREEN +# 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; +uniform vec4 _Control_ST; +uniform vec4 _Splat0_ST; +uniform vec4 _Splat1_ST; +uniform vec4 _Splat2_ST; +uniform vec4 _Splat3_ST; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec2 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +void main () +{ + vec4 tmpvar_1; + vec4 tmpvar_2; + vec4 tmpvar_3; + tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw); + tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw); + tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw); + tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw); + vec4 v_4; + v_4.x = _World2Object[0].x; + v_4.y = _World2Object[1].x; + v_4.z = _World2Object[2].x; + v_4.w = _World2Object[3].x; + vec4 v_5; + v_5.x = _World2Object[0].y; + v_5.y = _World2Object[1].y; + v_5.z = _World2Object[2].y; + v_5.w = _World2Object[3].y; + vec4 v_6; + v_6.x = _World2Object[0].z; + v_6.y = _World2Object[1].z; + v_6.z = _World2Object[2].z; + v_6.w = _World2Object[3].z; + vec3 tmpvar_7; + tmpvar_7 = normalize((( + (v_4.xyz * gl_Normal.x) + + + (v_5.xyz * gl_Normal.y) + ) + (v_6.xyz * gl_Normal.z))); + vec4 tmpvar_8; + tmpvar_8.w = 1.0; + tmpvar_8.xyz = tmpvar_7; + vec3 x2_9; + vec3 x1_10; + x1_10.x = dot (unity_SHAr, tmpvar_8); + x1_10.y = dot (unity_SHAg, tmpvar_8); + x1_10.z = dot (unity_SHAb, tmpvar_8); + vec4 tmpvar_11; + tmpvar_11 = (tmpvar_7.xyzz * tmpvar_7.yzzx); + x2_9.x = dot (unity_SHBr, tmpvar_11); + x2_9.y = dot (unity_SHBg, tmpvar_11); + x2_9.z = dot (unity_SHBb, tmpvar_11); + vec4 o_12; + vec4 tmpvar_13; + tmpvar_13 = (tmpvar_3 * 0.5); + vec2 tmpvar_14; + tmpvar_14.x = tmpvar_13.x; + tmpvar_14.y = (tmpvar_13.y * _ProjectionParams.x); + o_12.xy = (tmpvar_14 + tmpvar_13.w); + o_12.zw = tmpvar_3.zw; + gl_Position = tmpvar_3; + xlv_TEXCOORD0 = tmpvar_1; + xlv_TEXCOORD1 = tmpvar_2; + xlv_TEXCOORD2 = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw); + xlv_TEXCOORD3 = tmpvar_7; + xlv_TEXCOORD4 = ((x1_10 + x2_9) + (unity_SHC.xyz * ( + (tmpvar_7.x * tmpvar_7.x) + - + (tmpvar_7.y * tmpvar_7.y) + ))); + xlv_TEXCOORD5 = o_12; +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; +uniform sampler2D _Control; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec2 xlv_TEXCOORD2; +varying vec3 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +void main () +{ + vec4 c_1; + vec4 tmpvar_2; + tmpvar_2 = texture2D (_Control, xlv_TEXCOORD0.xy); + vec3 tmpvar_3; + tmpvar_3 = ((( + (tmpvar_2.x * texture2D (_Splat0, xlv_TEXCOORD0.zw).xyz) + + + (tmpvar_2.y * texture2D (_Splat1, xlv_TEXCOORD1.xy).xyz) + ) + (tmpvar_2.z * texture2D (_Splat2, xlv_TEXCOORD1.zw).xyz)) + (tmpvar_2.w * texture2D (_Splat3, xlv_TEXCOORD2).xyz)); + c_1.w = 0.0; + c_1.xyz = (tmpvar_3 * xlv_TEXCOORD4); + vec4 c_4; + c_4.xyz = ((tmpvar_3 * _LightColor0.xyz) * (( + max (0.0, dot (xlv_TEXCOORD3, _WorldSpaceLightPos0.xyz)) + * texture2DProj (_ShadowMapTexture, xlv_TEXCOORD5).x) * 2.0)); + c_4.w = 0.0; + c_1.xyz = (c_1 + c_4).xyz; + c_1.w = 1.0; + gl_FragData[0] = c_1; +} + diff --git a/shaders/unity/37.shader_test b/shaders/unity/37.shader_test new file mode 100644 index 0000000..a53a559 --- /dev/null +++ b/shaders/unity/37.shader_test @@ -0,0 +1,230 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-PrePassCollectShadows +# internal variant: SHADOWS_NATIVE +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; +uniform mat4 unity_CameraInvProjection; + +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +void main () +{ + vec4 clipPos_1; + vec4 tmpvar_2; + tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex); + clipPos_1.xzw = tmpvar_2.xzw; + clipPos_1.y = (tmpvar_2.y * _ProjectionParams.x); + vec4 tmpvar_3; + tmpvar_3.zw = vec2(-1.0, 1.0); + tmpvar_3.xy = clipPos_1.xy; + vec4 tmpvar_4; + tmpvar_4 = (unity_CameraInvProjection * tmpvar_3); + vec4 tmpvar_5; + tmpvar_5.zw = vec2(1.0, 1.0); + tmpvar_5.xy = clipPos_1.xy; + vec4 tmpvar_6; + tmpvar_6.xy = tmpvar_4.xy; + tmpvar_6.z = -(tmpvar_4.z); + tmpvar_6.w = -((unity_CameraInvProjection * tmpvar_5).z); + xlv_TEXCOORD0 = gl_MultiTexCoord0.xy; + xlv_TEXCOORD1 = gl_Normal; + xlv_TEXCOORD2 = tmpvar_6; + gl_Position = tmpvar_2; +} + +[fragment shader] +uniform vec4 _ZBufferParams; +uniform vec4 unity_OrthoParams; +uniform vec4 _LightSplitsNear; +uniform vec4 _LightSplitsFar; +uniform mat4 unity_World2Shadow[4]; +uniform vec4 _LightShadowData; +uniform sampler2D _CameraDepthTexture; +uniform mat4 _CameraToWorld; +uniform sampler2DShadow _ShadowMapTexture; +uniform vec4 _ShadowMapTexture_TexelSize; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +void main () +{ + vec3 vposOrtho_1; + vec4 tmpvar_2; + tmpvar_2 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0); + vposOrtho_1.xy = xlv_TEXCOORD2.xy; + vposOrtho_1.z = mix (xlv_TEXCOORD2.z, xlv_TEXCOORD2.w, tmpvar_2.x); + vec3 tmpvar_3; + tmpvar_3 = mix ((xlv_TEXCOORD1 * mix ( + (1.0/(((_ZBufferParams.x * tmpvar_2.x) + _ZBufferParams.y))) + , tmpvar_2.x, unity_OrthoParams.w)), vposOrtho_1, unity_OrthoParams.www); + vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = tmpvar_3; + vec4 tmpvar_5; + tmpvar_5 = (_CameraToWorld * tmpvar_4); + vec4 tmpvar_6; + tmpvar_6 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); + vec4 tmpvar_7; + tmpvar_7.w = 1.0; + tmpvar_7.xyz = ((( + ((unity_World2Shadow[0] * tmpvar_5).xyz * tmpvar_6.x) + + + ((unity_World2Shadow[1] * tmpvar_5).xyz * tmpvar_6.y) + ) + ( + (unity_World2Shadow[2] * tmpvar_5) + .xyz * tmpvar_6.z)) + ((unity_World2Shadow[3] * tmpvar_5).xyz * tmpvar_6.w)); + vec2 tmpvar_8; + tmpvar_8 = ((tmpvar_7.xy * _ShadowMapTexture_TexelSize.zw) + vec2(0.5, 0.5)); + vec2 tmpvar_9; + tmpvar_9 = ((floor(tmpvar_8) - vec2(0.5, 0.5)) * _ShadowMapTexture_TexelSize.xy); + vec2 tmpvar_10; + tmpvar_10 = fract(tmpvar_8); + vec3 tmpvar_11; + tmpvar_11.y = 7.0; + tmpvar_11.x = (4.0 - (3.0 * tmpvar_10.x)); + tmpvar_11.z = (1.0 + (3.0 * tmpvar_10.x)); + vec3 tmpvar_12; + tmpvar_12.x = (((3.0 - + (2.0 * tmpvar_10.x) + ) / tmpvar_11.x) - 2.0); + tmpvar_12.y = ((3.0 + tmpvar_10.x) / 7.0); + tmpvar_12.z = ((tmpvar_10.x / tmpvar_11.z) + 2.0); + vec3 tmpvar_13; + tmpvar_13 = (tmpvar_12 * _ShadowMapTexture_TexelSize.x); + vec3 tmpvar_14; + tmpvar_14.y = 7.0; + tmpvar_14.x = (4.0 - (3.0 * tmpvar_10.y)); + tmpvar_14.z = (1.0 + (3.0 * tmpvar_10.y)); + vec3 tmpvar_15; + tmpvar_15.x = (((3.0 - + (2.0 * tmpvar_10.y) + ) / tmpvar_14.x) - 2.0); + tmpvar_15.y = ((3.0 + tmpvar_10.y) / 7.0); + tmpvar_15.z = ((tmpvar_10.y / tmpvar_14.z) + 2.0); + vec3 tmpvar_16; + tmpvar_16 = (tmpvar_15 * _ShadowMapTexture_TexelSize.y); + vec3 tmpvar_17; + tmpvar_17 = (tmpvar_11 * tmpvar_14.x); + vec2 tmpvar_18; + tmpvar_18.x = tmpvar_13.x; + tmpvar_18.y = tmpvar_16.x; + float depth_19; + depth_19 = tmpvar_7.z; + vec3 uv_20; + vec3 tmpvar_21; + tmpvar_21.xy = (tmpvar_9 + tmpvar_18); + tmpvar_21.z = depth_19; + uv_20.xy = tmpvar_21.xy; + uv_20.z = depth_19; + vec2 tmpvar_22; + tmpvar_22.x = tmpvar_13.y; + tmpvar_22.y = tmpvar_16.x; + float depth_23; + depth_23 = tmpvar_7.z; + vec3 uv_24; + vec3 tmpvar_25; + tmpvar_25.xy = (tmpvar_9 + tmpvar_22); + tmpvar_25.z = depth_23; + uv_24.xy = tmpvar_25.xy; + uv_24.z = depth_23; + vec2 tmpvar_26; + tmpvar_26.x = tmpvar_13.z; + tmpvar_26.y = tmpvar_16.x; + float depth_27; + depth_27 = tmpvar_7.z; + vec3 uv_28; + vec3 tmpvar_29; + tmpvar_29.xy = (tmpvar_9 + tmpvar_26); + tmpvar_29.z = depth_27; + uv_28.xy = tmpvar_29.xy; + uv_28.z = depth_27; + vec3 tmpvar_30; + tmpvar_30 = (tmpvar_11 * 7.0); + vec2 tmpvar_31; + tmpvar_31.x = tmpvar_13.x; + tmpvar_31.y = tmpvar_16.y; + float depth_32; + depth_32 = tmpvar_7.z; + vec3 uv_33; + vec3 tmpvar_34; + tmpvar_34.xy = (tmpvar_9 + tmpvar_31); + tmpvar_34.z = depth_32; + uv_33.xy = tmpvar_34.xy; + uv_33.z = depth_32; + vec2 tmpvar_35; + tmpvar_35.x = tmpvar_13.y; + tmpvar_35.y = tmpvar_16.y; + float depth_36; + depth_36 = tmpvar_7.z; + vec3 uv_37; + vec3 tmpvar_38; + tmpvar_38.xy = (tmpvar_9 + tmpvar_35); + tmpvar_38.z = depth_36; + uv_37.xy = tmpvar_38.xy; + uv_37.z = depth_36; + vec2 tmpvar_39; + tmpvar_39.x = tmpvar_13.z; + tmpvar_39.y = tmpvar_16.y; + float depth_40; + depth_40 = tmpvar_7.z; + vec3 uv_41; + vec3 tmpvar_42; + tmpvar_42.xy = (tmpvar_9 + tmpvar_39); + tmpvar_42.z = depth_40; + uv_41.xy = tmpvar_42.xy; + uv_41.z = depth_40; + vec3 tmpvar_43; + tmpvar_43 = (tmpvar_11 * tmpvar_14.z); + vec2 tmpvar_44; + tmpvar_44.x = tmpvar_13.x; + tmpvar_44.y = tmpvar_16.z; + float depth_45; + depth_45 = tmpvar_7.z; + vec3 uv_46; + vec3 tmpvar_47; + tmpvar_47.xy = (tmpvar_9 + tmpvar_44); + tmpvar_47.z = depth_45; + uv_46.xy = tmpvar_47.xy; + uv_46.z = depth_45; + vec2 tmpvar_48; + tmpvar_48.x = tmpvar_13.y; + tmpvar_48.y = tmpvar_16.z; + float depth_49; + depth_49 = tmpvar_7.z; + vec3 uv_50; + vec3 tmpvar_51; + tmpvar_51.xy = (tmpvar_9 + tmpvar_48); + tmpvar_51.z = depth_49; + uv_50.xy = tmpvar_51.xy; + uv_50.z = depth_49; + vec2 tmpvar_52; + tmpvar_52.x = tmpvar_13.z; + tmpvar_52.y = tmpvar_16.z; + float depth_53; + depth_53 = tmpvar_7.z; + vec3 uv_54; + vec3 tmpvar_55; + tmpvar_55.xy = (tmpvar_9 + tmpvar_52); + tmpvar_55.z = depth_53; + uv_54.xy = tmpvar_55.xy; + uv_54.z = depth_53; + gl_FragData[0] = vec4((mix (_LightShadowData.x, 1.0, ( + (((( + (((( + (tmpvar_17.x * shadow2D (_ShadowMapTexture, uv_20).x) + + + (tmpvar_17.y * shadow2D (_ShadowMapTexture, uv_24).x) + ) + (tmpvar_17.z * shadow2D (_ShadowMapTexture, uv_28).x)) + (tmpvar_30.x * shadow2D (_ShadowMapTexture, uv_33).x)) + (tmpvar_30.y * shadow2D (_ShadowMapTexture, uv_37).x)) + + + (tmpvar_30.z * shadow2D (_ShadowMapTexture, uv_41).x) + ) + (tmpvar_43.x * shadow2D (_ShadowMapTexture, uv_46).x)) + (tmpvar_43.y * shadow2D (_ShadowMapTexture, uv_50).x)) + (tmpvar_43.z * shadow2D (_ShadowMapTexture, uv_54).x)) + / 144.0)) + clamp (( + (tmpvar_3.z * _LightShadowData.z) + + _LightShadowData.w), 0.0, 1.0))); +} + diff --git a/shaders/unity/38.shader_test b/shaders/unity/38.shader_test new file mode 100644 index 0000000..04ef249 --- /dev/null +++ b/shaders/unity/38.shader_test @@ -0,0 +1,411 @@ +# Built-in shader from Unity 5.0.0b19: +# Standard (Specular setup) +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_SCREEN _DETAIL_MULX2 _NORMALMAP _SPECGLOSSMAP +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +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 _DetailAlbedoMap_ST; +uniform float _UVSec; +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; +varying vec3 xlv_TEXCOORD8; +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; + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + vec3 tmpvar_8; + tmpvar_8 = tmpvar_7.xyz; + vec4 tmpvar_9; + tmpvar_9 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 texcoord_10; + texcoord_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + vec2 tmpvar_11; + if ((_UVSec == 0.0)) { + tmpvar_11 = tmpvar_1; + } else { + tmpvar_11 = tmpvar_2; + }; + texcoord_10.zw = ((tmpvar_11 * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + vec4 v_12; + v_12.x = _World2Object[0].x; + v_12.y = _World2Object[1].x; + v_12.z = _World2Object[2].x; + v_12.w = _World2Object[3].x; + vec4 v_13; + v_13.x = _World2Object[0].y; + v_13.y = _World2Object[1].y; + v_13.z = _World2Object[2].y; + v_13.w = _World2Object[3].y; + vec4 v_14; + v_14.x = _World2Object[0].z; + v_14.y = _World2Object[1].z; + v_14.z = _World2Object[2].z; + v_14.w = _World2Object[3].z; + vec3 tmpvar_15; + tmpvar_15 = normalize((( + (v_12.xyz * gl_Normal.x) + + + (v_13.xyz * gl_Normal.y) + ) + (v_14.xyz * gl_Normal.z))); + mat3 tmpvar_16; + tmpvar_16[0] = _Object2World[0].xyz; + tmpvar_16[1] = _Object2World[1].xyz; + tmpvar_16[2] = _Object2World[2].xyz; + vec4 tmpvar_17; + tmpvar_17.xyz = normalize((tmpvar_16 * TANGENT.xyz)); + tmpvar_17.w = TANGENT.w; + vec3 tmpvar_18; + vec3 tmpvar_19; + tmpvar_18 = tmpvar_17.xyz; + tmpvar_19 = (((tmpvar_15.yzx * tmpvar_17.zxy) - (tmpvar_15.zxy * tmpvar_17.yzx)) * TANGENT.www); + vec3 tmpvar_20; + vec3 tmpvar_21; + vec3 tmpvar_22; + tmpvar_20.x = tmpvar_18.x; + tmpvar_20.y = tmpvar_19.x; + tmpvar_20.z = tmpvar_15.x; + tmpvar_21.x = tmpvar_18.y; + tmpvar_21.y = tmpvar_19.y; + tmpvar_21.z = tmpvar_15.y; + tmpvar_22.x = tmpvar_18.z; + tmpvar_22.y = tmpvar_19.z; + tmpvar_22.z = tmpvar_15.z; + vec3 v_23; + v_23.x = tmpvar_20.x; + v_23.y = tmpvar_21.x; + v_23.z = tmpvar_22.x; + tmpvar_3.xyz = v_23; + vec3 v_24; + v_24.x = tmpvar_20.y; + v_24.y = tmpvar_21.y; + v_24.z = tmpvar_22.y; + tmpvar_4.xyz = v_24; + vec3 v_25; + v_25.x = tmpvar_20.z; + v_25.y = tmpvar_21.z; + v_25.z = tmpvar_22.z; + tmpvar_5.xyz = v_25; + vec4 o_26; + vec4 tmpvar_27; + tmpvar_27 = (tmpvar_9 * 0.5); + vec2 tmpvar_28; + tmpvar_28.x = tmpvar_27.x; + tmpvar_28.y = (tmpvar_27.y * _ProjectionParams.x); + o_26.xy = (tmpvar_28 + tmpvar_27.w); + o_26.zw = tmpvar_9.zw; + vec3 x2_29; + vec4 tmpvar_30; + tmpvar_30 = (tmpvar_15.xyzz * tmpvar_15.yzzx); + x2_29.x = dot (unity_SHBr, tmpvar_30); + x2_29.y = dot (unity_SHBg, tmpvar_30); + x2_29.z = dot (unity_SHBb, tmpvar_30); + tmpvar_6.xyz = (x2_29 + (unity_SHC.xyz * ( + (tmpvar_15.x * tmpvar_15.x) + - + (tmpvar_15.y * tmpvar_15.y) + ))); + gl_Position = tmpvar_9; + xlv_TEXCOORD0 = texcoord_10; + xlv_TEXCOORD1 = (tmpvar_7.xyz - _WorldSpaceCameraPos); + xlv_TEXCOORD2 = tmpvar_3; + xlv_TEXCOORD2_1 = tmpvar_4; + xlv_TEXCOORD2_2 = tmpvar_5; + xlv_TEXCOORD5 = tmpvar_6; + xlv_TEXCOORD6 = o_26; + xlv_TEXCOORD8 = tmpvar_8; +} + +[fragment shader] +#extension GL_ARB_shader_texture_lod : enable +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_ColorSpaceDouble; +uniform samplerCube unity_SpecCube; +uniform samplerCube unity_SpecCube1; +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 sampler2D _OcclusionMap; +uniform float _OcclusionStrength; +uniform sampler2D _ShadowMapTexture; +uniform vec4 unity_SpecCube_BoxMax; +uniform vec4 unity_SpecCube_BoxMin; +uniform vec4 unity_SpecCube_ProbePosition; +uniform vec4 unity_SpecCube_HDR; +uniform vec4 unity_SpecCube_BoxMax1; +uniform vec4 unity_SpecCube_BoxMin1; +uniform vec4 unity_SpecCube_ProbePosition1; +uniform vec4 unity_SpecCube_HDR1; +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; +varying vec3 xlv_TEXCOORD8; +void main () +{ + vec4 c_1; + vec3 tmpvar_2; + vec3 tmpvar_3; + vec3 tmpvar_4; + tmpvar_2 = xlv_TEXCOORD2.xyz; + tmpvar_3 = xlv_TEXCOORD2_1.xyz; + tmpvar_4 = normalize(xlv_TEXCOORD2_2.xyz); + mat3 tmpvar_5; + tmpvar_5[0].x = tmpvar_2.x; + tmpvar_5[0].y = tmpvar_3.x; + tmpvar_5[0].z = tmpvar_4.x; + tmpvar_5[1].x = tmpvar_2.y; + tmpvar_5[1].y = tmpvar_3.y; + tmpvar_5[1].z = tmpvar_4.y; + tmpvar_5[2].x = tmpvar_2.z; + tmpvar_5[2].y = tmpvar_3.z; + tmpvar_5[2].z = tmpvar_4.z; + vec3 normal_6; + normal_6.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); + normal_6.xy = (normal_6.xy * _BumpScale); + normal_6.z = sqrt((1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) + , 0.0, 1.0))); + vec3 normal_7; + normal_7.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0); + normal_7.xy = (normal_7.xy * _DetailNormalMapScale); + normal_7.z = sqrt((1.0 - clamp ( + dot (normal_7.xy, normal_7.xy) + , 0.0, 1.0))); + vec3 tmpvar_8; + tmpvar_8.xy = (normal_6.xy + normal_7.xy); + tmpvar_8.z = (normal_6.z * normal_7.z); + vec3 tmpvar_9; + vec4 cse_10; + cse_10 = texture2D (_DetailMask, xlv_TEXCOORD0.xy); + tmpvar_9 = normalize((mix (normal_6, + normalize(tmpvar_8) + , cse_10.www) * tmpvar_5)); + vec3 tmpvar_11; + tmpvar_11 = normalize(xlv_TEXCOORD1); + vec4 tmpvar_12; + tmpvar_12 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy); + vec3 tmpvar_13; + float tmpvar_14; + tmpvar_14 = (1.0 - max (max (tmpvar_12.x, tmpvar_12.y), tmpvar_12.z)); + tmpvar_13 = (((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (vec3( + (1.0 - cse_10.w) + ) + + ((texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz * unity_ColorSpaceDouble.xyz) * cse_10.w) + )) * tmpvar_14); + float tmpvar_15; + tmpvar_15 = ((1.0 - _OcclusionStrength) + (texture2D (_OcclusionMap, xlv_TEXCOORD0.xy).y * _OcclusionStrength)); + float tmpvar_16; + tmpvar_16 = max (0.0, dot (tmpvar_9, _WorldSpaceLightPos0.xyz)); + vec3 tmpvar_17; + vec3 tmpvar_18; + vec3 tmpvar_19; + tmpvar_19 = vec3(0.0, 0.0, 0.0); + vec4 tmpvar_20; + tmpvar_20.w = 1.0; + tmpvar_20.xyz = tmpvar_9; + vec3 x1_21; + x1_21.x = dot (unity_SHAr, tmpvar_20); + x1_21.y = dot (unity_SHAg, tmpvar_20); + x1_21.z = dot (unity_SHAb, tmpvar_20); + tmpvar_18 = (xlv_TEXCOORD5.xyz + x1_21); + tmpvar_17 = ((_LightColor0.xyz + _LightColor0.xyz) * texture2DProj (_ShadowMapTexture, xlv_TEXCOORD6).x); + tmpvar_18 = (tmpvar_18 * tmpvar_15); + vec3 tmpvar_22; + tmpvar_22 = (tmpvar_11 - (2.0 * ( + dot (tmpvar_9, tmpvar_11) + * tmpvar_9))); + vec3 worldNormal_23; + worldNormal_23 = tmpvar_22; + if ((unity_SpecCube_ProbePosition.w > 0.0)) { + vec3 tmpvar_24; + tmpvar_24 = normalize(tmpvar_22); + vec3 tmpvar_25; + tmpvar_25 = ((unity_SpecCube_BoxMax.xyz - xlv_TEXCOORD8) / tmpvar_24); + vec3 tmpvar_26; + tmpvar_26 = ((unity_SpecCube_BoxMin.xyz - xlv_TEXCOORD8) / tmpvar_24); + bvec3 tmpvar_27; + tmpvar_27 = greaterThan (tmpvar_24, vec3(0.0, 0.0, 0.0)); + float tmpvar_28; + if (tmpvar_27.x) { + tmpvar_28 = tmpvar_25.x; + } else { + tmpvar_28 = tmpvar_26.x; + }; + float tmpvar_29; + if (tmpvar_27.y) { + tmpvar_29 = tmpvar_25.y; + } else { + tmpvar_29 = tmpvar_26.y; + }; + float tmpvar_30; + if (tmpvar_27.z) { + tmpvar_30 = tmpvar_25.z; + } else { + tmpvar_30 = tmpvar_26.z; + }; + vec3 tmpvar_31; + tmpvar_31 = ((unity_SpecCube_BoxMax.xyz + unity_SpecCube_BoxMin.xyz) * 0.5); + worldNormal_23 = ((( + (tmpvar_31 - unity_SpecCube_ProbePosition.xyz) + + xlv_TEXCOORD8) + (tmpvar_24 * + min (min (tmpvar_28, tmpvar_29), tmpvar_30) + )) - tmpvar_31); + }; + vec4 tmpvar_32; + tmpvar_32.xyz = worldNormal_23; + tmpvar_32.w = (pow ((1.0 - tmpvar_12.w), 0.75) * 7.0); + vec4 tmpvar_33; + tmpvar_33 = textureCubeLod (unity_SpecCube, worldNormal_23, tmpvar_32.w); + vec3 tmpvar_34; + tmpvar_34 = ((unity_SpecCube_HDR.x * pow (tmpvar_33.w, unity_SpecCube_HDR.y)) * tmpvar_33.xyz); + if ((unity_SpecCube_BoxMin.w < 0.99999)) { + vec3 worldNormal_35; + worldNormal_35 = tmpvar_22; + if ((unity_SpecCube_ProbePosition1.w > 0.0)) { + vec3 tmpvar_36; + tmpvar_36 = normalize(tmpvar_22); + vec3 tmpvar_37; + tmpvar_37 = ((unity_SpecCube_BoxMax1.xyz - xlv_TEXCOORD8) / tmpvar_36); + vec3 tmpvar_38; + tmpvar_38 = ((unity_SpecCube_BoxMin1.xyz - xlv_TEXCOORD8) / tmpvar_36); + bvec3 tmpvar_39; + tmpvar_39 = greaterThan (tmpvar_36, vec3(0.0, 0.0, 0.0)); + float tmpvar_40; + if (tmpvar_39.x) { + tmpvar_40 = tmpvar_37.x; + } else { + tmpvar_40 = tmpvar_38.x; + }; + float tmpvar_41; + if (tmpvar_39.y) { + tmpvar_41 = tmpvar_37.y; + } else { + tmpvar_41 = tmpvar_38.y; + }; + float tmpvar_42; + if (tmpvar_39.z) { + tmpvar_42 = tmpvar_37.z; + } else { + tmpvar_42 = tmpvar_38.z; + }; + vec3 tmpvar_43; + tmpvar_43 = ((unity_SpecCube_BoxMax1.xyz + unity_SpecCube_BoxMin1.xyz) * 0.5); + worldNormal_35 = ((( + (tmpvar_43 - unity_SpecCube_ProbePosition1.xyz) + + xlv_TEXCOORD8) + (tmpvar_36 * + min (min (tmpvar_40, tmpvar_41), tmpvar_42) + )) - tmpvar_43); + }; + vec4 tmpvar_44; + tmpvar_44.xyz = worldNormal_35; + tmpvar_44.w = (pow ((1.0 - tmpvar_12.w), 0.75) * 7.0); + vec4 tmpvar_45; + tmpvar_45 = textureCubeLod (unity_SpecCube1, worldNormal_35, tmpvar_44.w); + tmpvar_19 = mix (((unity_SpecCube_HDR1.x * + pow (tmpvar_45.w, unity_SpecCube_HDR1.y) + ) * tmpvar_45.xyz), tmpvar_34, unity_SpecCube_BoxMin.www); + } else { + tmpvar_19 = tmpvar_34; + }; + tmpvar_19 = (tmpvar_19 * tmpvar_15); + vec3 viewDir_46; + viewDir_46 = -(tmpvar_11); + float tmpvar_47; + tmpvar_47 = (1.0 - tmpvar_12.w); + vec3 tmpvar_48; + tmpvar_48 = normalize((_WorldSpaceLightPos0.xyz + viewDir_46)); + float tmpvar_49; + tmpvar_49 = max (0.0, dot (tmpvar_9, viewDir_46)); + float tmpvar_50; + tmpvar_50 = max (0.0, dot (_WorldSpaceLightPos0.xyz, tmpvar_48)); + float tmpvar_51; + tmpvar_51 = ((tmpvar_47 * tmpvar_47) * 0.797885); + float tmpvar_52; + float tmpvar_53; + tmpvar_53 = (10.0 / log2(( + ((1.0 - tmpvar_47) * 0.968) + + 0.03))); + tmpvar_52 = (tmpvar_53 * tmpvar_53); + float tmpvar_54; + tmpvar_54 = (0.5 + (( + (2.0 * tmpvar_50) + * tmpvar_50) * tmpvar_47)); + vec3 tmpvar_55; + tmpvar_55 = (((tmpvar_13 * + (tmpvar_18 + (tmpvar_17 * (( + (1.0 + ((tmpvar_54 - 1.0) * pow ((1.0001 - tmpvar_16), 5.0))) + * + (1.0 + ((tmpvar_54 - 1.0) * pow ((1.0001 - tmpvar_49), 5.0))) + ) * tmpvar_16))) + ) + ( + ((max (0.0, ( + (((1.0/(( + ((tmpvar_16 * (1.0 - tmpvar_51)) + tmpvar_51) + * + ((tmpvar_49 * (1.0 - tmpvar_51)) + tmpvar_51) + ))) * (pow ( + max (0.0, dot (tmpvar_9, tmpvar_48)) + , tmpvar_52) * ( + (tmpvar_52 + 1.0) + / 6.28319))) * tmpvar_16) + / 4.0)) * 3.14159) * tmpvar_17) + * + (tmpvar_12.xyz + ((1.0 - tmpvar_12.xyz) * pow (abs( + (1.0 - max (0.0, dot (viewDir_46, tmpvar_48))) + ), 5.0))) + )) + (tmpvar_19 * mix (tmpvar_12.xyz, vec3( + clamp ((tmpvar_12.w + (1.0 - tmpvar_14)), 0.0, 1.0) + ), vec3( + pow (abs((1.0 - tmpvar_49)), 5.0) + )))); + vec4 tmpvar_56; + tmpvar_56.w = 1.0; + tmpvar_56.xyz = tmpvar_55; + c_1.w = tmpvar_56.w; + c_1.xyz = tmpvar_55; + c_1.xyz = c_1.xyz; + vec4 xlat_varoutput_57; + xlat_varoutput_57.xyz = c_1.xyz; + xlat_varoutput_57.w = 1.0; + gl_FragData[0] = xlat_varoutput_57; +} + diff --git a/shaders/unity/39.shader_test b/shaders/unity/39.shader_test new file mode 100644 index 0000000..ee9c715 --- /dev/null +++ b/shaders/unity/39.shader_test @@ -0,0 +1,394 @@ +# Built-in shader from Unity 5.0.0b19: +# Standard +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_SCREEN _METALLICGLOSSMAP _NORMALMAP +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +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 _DetailAlbedoMap_ST; +uniform float _UVSec; +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; +varying vec3 xlv_TEXCOORD8; +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; + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + vec3 tmpvar_8; + tmpvar_8 = tmpvar_7.xyz; + vec4 tmpvar_9; + tmpvar_9 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 texcoord_10; + texcoord_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + vec2 tmpvar_11; + if ((_UVSec == 0.0)) { + tmpvar_11 = tmpvar_1; + } else { + tmpvar_11 = tmpvar_2; + }; + texcoord_10.zw = ((tmpvar_11 * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + vec4 v_12; + v_12.x = _World2Object[0].x; + v_12.y = _World2Object[1].x; + v_12.z = _World2Object[2].x; + v_12.w = _World2Object[3].x; + vec4 v_13; + v_13.x = _World2Object[0].y; + v_13.y = _World2Object[1].y; + v_13.z = _World2Object[2].y; + v_13.w = _World2Object[3].y; + vec4 v_14; + v_14.x = _World2Object[0].z; + v_14.y = _World2Object[1].z; + v_14.z = _World2Object[2].z; + v_14.w = _World2Object[3].z; + vec3 tmpvar_15; + tmpvar_15 = normalize((( + (v_12.xyz * gl_Normal.x) + + + (v_13.xyz * gl_Normal.y) + ) + (v_14.xyz * gl_Normal.z))); + mat3 tmpvar_16; + tmpvar_16[0] = _Object2World[0].xyz; + tmpvar_16[1] = _Object2World[1].xyz; + tmpvar_16[2] = _Object2World[2].xyz; + vec4 tmpvar_17; + tmpvar_17.xyz = normalize((tmpvar_16 * TANGENT.xyz)); + tmpvar_17.w = TANGENT.w; + vec3 tmpvar_18; + vec3 tmpvar_19; + tmpvar_18 = tmpvar_17.xyz; + tmpvar_19 = (((tmpvar_15.yzx * tmpvar_17.zxy) - (tmpvar_15.zxy * tmpvar_17.yzx)) * TANGENT.www); + vec3 tmpvar_20; + vec3 tmpvar_21; + vec3 tmpvar_22; + tmpvar_20.x = tmpvar_18.x; + tmpvar_20.y = tmpvar_19.x; + tmpvar_20.z = tmpvar_15.x; + tmpvar_21.x = tmpvar_18.y; + tmpvar_21.y = tmpvar_19.y; + tmpvar_21.z = tmpvar_15.y; + tmpvar_22.x = tmpvar_18.z; + tmpvar_22.y = tmpvar_19.z; + tmpvar_22.z = tmpvar_15.z; + vec3 v_23; + v_23.x = tmpvar_20.x; + v_23.y = tmpvar_21.x; + v_23.z = tmpvar_22.x; + tmpvar_3.xyz = v_23; + vec3 v_24; + v_24.x = tmpvar_20.y; + v_24.y = tmpvar_21.y; + v_24.z = tmpvar_22.y; + tmpvar_4.xyz = v_24; + vec3 v_25; + v_25.x = tmpvar_20.z; + v_25.y = tmpvar_21.z; + v_25.z = tmpvar_22.z; + tmpvar_5.xyz = v_25; + vec4 o_26; + vec4 tmpvar_27; + tmpvar_27 = (tmpvar_9 * 0.5); + vec2 tmpvar_28; + tmpvar_28.x = tmpvar_27.x; + tmpvar_28.y = (tmpvar_27.y * _ProjectionParams.x); + o_26.xy = (tmpvar_28 + tmpvar_27.w); + o_26.zw = tmpvar_9.zw; + vec3 x2_29; + vec4 tmpvar_30; + tmpvar_30 = (tmpvar_15.xyzz * tmpvar_15.yzzx); + x2_29.x = dot (unity_SHBr, tmpvar_30); + x2_29.y = dot (unity_SHBg, tmpvar_30); + x2_29.z = dot (unity_SHBb, tmpvar_30); + tmpvar_6.xyz = (x2_29 + (unity_SHC.xyz * ( + (tmpvar_15.x * tmpvar_15.x) + - + (tmpvar_15.y * tmpvar_15.y) + ))); + gl_Position = tmpvar_9; + xlv_TEXCOORD0 = texcoord_10; + xlv_TEXCOORD1 = (tmpvar_7.xyz - _WorldSpaceCameraPos); + xlv_TEXCOORD2 = tmpvar_3; + xlv_TEXCOORD2_1 = tmpvar_4; + xlv_TEXCOORD2_2 = tmpvar_5; + xlv_TEXCOORD5 = tmpvar_6; + xlv_TEXCOORD6 = o_26; + xlv_TEXCOORD8 = tmpvar_8; +} + +[fragment shader] +#extension GL_ARB_shader_texture_lod : enable +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_ColorSpaceDielectricSpec; +uniform samplerCube unity_SpecCube; +uniform samplerCube unity_SpecCube1; +uniform vec4 _LightColor0; +uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform sampler2D _MetallicGlossMap; +uniform sampler2D _OcclusionMap; +uniform float _OcclusionStrength; +uniform sampler2D _ShadowMapTexture; +uniform vec4 unity_SpecCube_BoxMax; +uniform vec4 unity_SpecCube_BoxMin; +uniform vec4 unity_SpecCube_ProbePosition; +uniform vec4 unity_SpecCube_HDR; +uniform vec4 unity_SpecCube_BoxMax1; +uniform vec4 unity_SpecCube_BoxMin1; +uniform vec4 unity_SpecCube_ProbePosition1; +uniform vec4 unity_SpecCube_HDR1; +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; +varying vec3 xlv_TEXCOORD8; +void main () +{ + vec4 c_1; + vec3 tmpvar_2; + vec3 tmpvar_3; + vec3 tmpvar_4; + tmpvar_2 = xlv_TEXCOORD2.xyz; + tmpvar_3 = xlv_TEXCOORD2_1.xyz; + tmpvar_4 = normalize(xlv_TEXCOORD2_2.xyz); + mat3 tmpvar_5; + tmpvar_5[0].x = tmpvar_2.x; + tmpvar_5[0].y = tmpvar_3.x; + tmpvar_5[0].z = tmpvar_4.x; + tmpvar_5[1].x = tmpvar_2.y; + tmpvar_5[1].y = tmpvar_3.y; + tmpvar_5[1].z = tmpvar_4.y; + tmpvar_5[2].x = tmpvar_2.z; + tmpvar_5[2].y = tmpvar_3.z; + tmpvar_5[2].z = tmpvar_4.z; + vec3 normal_6; + normal_6.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); + normal_6.xy = (normal_6.xy * _BumpScale); + normal_6.z = sqrt((1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) + , 0.0, 1.0))); + vec3 tmpvar_7; + tmpvar_7 = normalize((normal_6 * tmpvar_5)); + vec3 tmpvar_8; + tmpvar_8 = normalize(xlv_TEXCOORD1); + vec2 tmpvar_9; + tmpvar_9 = texture2D (_MetallicGlossMap, xlv_TEXCOORD0.xy).xw; + vec3 tmpvar_10; + tmpvar_10 = (_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz); + vec3 tmpvar_11; + vec3 tmpvar_12; + tmpvar_12 = mix (unity_ColorSpaceDielectricSpec.xyz, tmpvar_10, tmpvar_9.xxx); + float tmpvar_13; + tmpvar_13 = (unity_ColorSpaceDielectricSpec.w - (tmpvar_9.x * unity_ColorSpaceDielectricSpec.w)); + tmpvar_11 = (tmpvar_10 * tmpvar_13); + float tmpvar_14; + tmpvar_14 = ((1.0 - _OcclusionStrength) + (texture2D (_OcclusionMap, xlv_TEXCOORD0.xy).y * _OcclusionStrength)); + float tmpvar_15; + tmpvar_15 = max (0.0, dot (tmpvar_7, _WorldSpaceLightPos0.xyz)); + vec3 tmpvar_16; + vec3 tmpvar_17; + vec3 tmpvar_18; + tmpvar_18 = vec3(0.0, 0.0, 0.0); + vec4 tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = tmpvar_7; + vec3 x1_20; + x1_20.x = dot (unity_SHAr, tmpvar_19); + x1_20.y = dot (unity_SHAg, tmpvar_19); + x1_20.z = dot (unity_SHAb, tmpvar_19); + tmpvar_17 = (xlv_TEXCOORD5.xyz + x1_20); + tmpvar_16 = ((_LightColor0.xyz + _LightColor0.xyz) * texture2DProj (_ShadowMapTexture, xlv_TEXCOORD6).x); + tmpvar_17 = (tmpvar_17 * tmpvar_14); + vec3 tmpvar_21; + tmpvar_21 = (tmpvar_8 - (2.0 * ( + dot (tmpvar_7, tmpvar_8) + * tmpvar_7))); + vec3 worldNormal_22; + worldNormal_22 = tmpvar_21; + if ((unity_SpecCube_ProbePosition.w > 0.0)) { + vec3 tmpvar_23; + tmpvar_23 = normalize(tmpvar_21); + vec3 tmpvar_24; + tmpvar_24 = ((unity_SpecCube_BoxMax.xyz - xlv_TEXCOORD8) / tmpvar_23); + vec3 tmpvar_25; + tmpvar_25 = ((unity_SpecCube_BoxMin.xyz - xlv_TEXCOORD8) / tmpvar_23); + bvec3 tmpvar_26; + tmpvar_26 = greaterThan (tmpvar_23, vec3(0.0, 0.0, 0.0)); + float tmpvar_27; + if (tmpvar_26.x) { + tmpvar_27 = tmpvar_24.x; + } else { + tmpvar_27 = tmpvar_25.x; + }; + float tmpvar_28; + if (tmpvar_26.y) { + tmpvar_28 = tmpvar_24.y; + } else { + tmpvar_28 = tmpvar_25.y; + }; + float tmpvar_29; + if (tmpvar_26.z) { + tmpvar_29 = tmpvar_24.z; + } else { + tmpvar_29 = tmpvar_25.z; + }; + vec3 tmpvar_30; + tmpvar_30 = ((unity_SpecCube_BoxMax.xyz + unity_SpecCube_BoxMin.xyz) * 0.5); + worldNormal_22 = ((( + (tmpvar_30 - unity_SpecCube_ProbePosition.xyz) + + xlv_TEXCOORD8) + (tmpvar_23 * + min (min (tmpvar_27, tmpvar_28), tmpvar_29) + )) - tmpvar_30); + }; + vec4 tmpvar_31; + tmpvar_31.xyz = worldNormal_22; + tmpvar_31.w = (pow ((1.0 - tmpvar_9.y), 0.75) * 7.0); + vec4 tmpvar_32; + tmpvar_32 = textureCubeLod (unity_SpecCube, worldNormal_22, tmpvar_31.w); + vec3 tmpvar_33; + tmpvar_33 = ((unity_SpecCube_HDR.x * pow (tmpvar_32.w, unity_SpecCube_HDR.y)) * tmpvar_32.xyz); + if ((unity_SpecCube_BoxMin.w < 0.99999)) { + vec3 worldNormal_34; + worldNormal_34 = tmpvar_21; + if ((unity_SpecCube_ProbePosition1.w > 0.0)) { + vec3 tmpvar_35; + tmpvar_35 = normalize(tmpvar_21); + vec3 tmpvar_36; + tmpvar_36 = ((unity_SpecCube_BoxMax1.xyz - xlv_TEXCOORD8) / tmpvar_35); + vec3 tmpvar_37; + tmpvar_37 = ((unity_SpecCube_BoxMin1.xyz - xlv_TEXCOORD8) / tmpvar_35); + bvec3 tmpvar_38; + tmpvar_38 = greaterThan (tmpvar_35, vec3(0.0, 0.0, 0.0)); + float tmpvar_39; + if (tmpvar_38.x) { + tmpvar_39 = tmpvar_36.x; + } else { + tmpvar_39 = tmpvar_37.x; + }; + float tmpvar_40; + if (tmpvar_38.y) { + tmpvar_40 = tmpvar_36.y; + } else { + tmpvar_40 = tmpvar_37.y; + }; + float tmpvar_41; + if (tmpvar_38.z) { + tmpvar_41 = tmpvar_36.z; + } else { + tmpvar_41 = tmpvar_37.z; + }; + vec3 tmpvar_42; + tmpvar_42 = ((unity_SpecCube_BoxMax1.xyz + unity_SpecCube_BoxMin1.xyz) * 0.5); + worldNormal_34 = ((( + (tmpvar_42 - unity_SpecCube_ProbePosition1.xyz) + + xlv_TEXCOORD8) + (tmpvar_35 * + min (min (tmpvar_39, tmpvar_40), tmpvar_41) + )) - tmpvar_42); + }; + vec4 tmpvar_43; + tmpvar_43.xyz = worldNormal_34; + tmpvar_43.w = (pow ((1.0 - tmpvar_9.y), 0.75) * 7.0); + vec4 tmpvar_44; + tmpvar_44 = textureCubeLod (unity_SpecCube1, worldNormal_34, tmpvar_43.w); + tmpvar_18 = mix (((unity_SpecCube_HDR1.x * + pow (tmpvar_44.w, unity_SpecCube_HDR1.y) + ) * tmpvar_44.xyz), tmpvar_33, unity_SpecCube_BoxMin.www); + } else { + tmpvar_18 = tmpvar_33; + }; + tmpvar_18 = (tmpvar_18 * tmpvar_14); + vec3 viewDir_45; + viewDir_45 = -(tmpvar_8); + float tmpvar_46; + tmpvar_46 = (1.0 - tmpvar_9.y); + vec3 tmpvar_47; + tmpvar_47 = normalize((_WorldSpaceLightPos0.xyz + viewDir_45)); + float tmpvar_48; + tmpvar_48 = max (0.0, dot (tmpvar_7, viewDir_45)); + float tmpvar_49; + tmpvar_49 = max (0.0, dot (_WorldSpaceLightPos0.xyz, tmpvar_47)); + float tmpvar_50; + tmpvar_50 = ((tmpvar_46 * tmpvar_46) * 0.797885); + float tmpvar_51; + float tmpvar_52; + tmpvar_52 = (10.0 / log2(( + ((1.0 - tmpvar_46) * 0.968) + + 0.03))); + tmpvar_51 = (tmpvar_52 * tmpvar_52); + float tmpvar_53; + tmpvar_53 = (0.5 + (( + (2.0 * tmpvar_49) + * tmpvar_49) * tmpvar_46)); + vec3 tmpvar_54; + tmpvar_54 = (((tmpvar_11 * + (tmpvar_17 + (tmpvar_16 * (( + (1.0 + ((tmpvar_53 - 1.0) * pow ((1.0001 - tmpvar_15), 5.0))) + * + (1.0 + ((tmpvar_53 - 1.0) * pow ((1.0001 - tmpvar_48), 5.0))) + ) * tmpvar_15))) + ) + ( + ((max (0.0, ( + (((1.0/(( + ((tmpvar_15 * (1.0 - tmpvar_50)) + tmpvar_50) + * + ((tmpvar_48 * (1.0 - tmpvar_50)) + tmpvar_50) + ))) * (pow ( + max (0.0, dot (tmpvar_7, tmpvar_47)) + , tmpvar_51) * ( + (tmpvar_51 + 1.0) + / 6.28319))) * tmpvar_15) + / 4.0)) * 3.14159) * tmpvar_16) + * + (tmpvar_12 + ((1.0 - tmpvar_12) * pow (abs( + (1.0 - max (0.0, dot (viewDir_45, tmpvar_47))) + ), 5.0))) + )) + (tmpvar_18 * mix (tmpvar_12, vec3( + clamp ((tmpvar_9.y + (1.0 - tmpvar_13)), 0.0, 1.0) + ), vec3( + pow (abs((1.0 - tmpvar_48)), 5.0) + )))); + vec4 tmpvar_55; + tmpvar_55.w = 1.0; + tmpvar_55.xyz = tmpvar_54; + c_1.w = tmpvar_55.w; + c_1.xyz = tmpvar_54; + c_1.xyz = c_1.xyz; + vec4 xlat_varoutput_56; + xlat_varoutput_56.xyz = c_1.xyz; + xlat_varoutput_56.w = 1.0; + gl_FragData[0] = xlat_varoutput_56; +} + diff --git a/shaders/unity/40.shader_test b/shaders/unity/40.shader_test new file mode 100644 index 0000000..ca3dd36 --- /dev/null +++ b/shaders/unity/40.shader_test @@ -0,0 +1,331 @@ +# Built-in shader from Unity 5.0.0b19: +# Standard +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_SCREEN +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +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 _DetailAlbedoMap_ST; +uniform float _UVSec; +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; +varying vec3 xlv_TEXCOORD8; +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; + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + vec3 tmpvar_8; + tmpvar_8 = tmpvar_7.xyz; + vec4 tmpvar_9; + tmpvar_9 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 texcoord_10; + texcoord_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + vec2 tmpvar_11; + if ((_UVSec == 0.0)) { + tmpvar_11 = tmpvar_1; + } else { + tmpvar_11 = tmpvar_2; + }; + texcoord_10.zw = ((tmpvar_11 * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + vec4 v_12; + v_12.x = _World2Object[0].x; + v_12.y = _World2Object[1].x; + v_12.z = _World2Object[2].x; + v_12.w = _World2Object[3].x; + vec4 v_13; + v_13.x = _World2Object[0].y; + v_13.y = _World2Object[1].y; + v_13.z = _World2Object[2].y; + v_13.w = _World2Object[3].y; + vec4 v_14; + v_14.x = _World2Object[0].z; + v_14.y = _World2Object[1].z; + v_14.z = _World2Object[2].z; + v_14.w = _World2Object[3].z; + vec3 tmpvar_15; + tmpvar_15 = normalize((( + (v_12.xyz * gl_Normal.x) + + + (v_13.xyz * gl_Normal.y) + ) + (v_14.xyz * gl_Normal.z))); + tmpvar_3.xyz = vec3(0.0, 0.0, 0.0); + tmpvar_4.xyz = vec3(0.0, 0.0, 0.0); + tmpvar_5.xyz = tmpvar_15; + vec4 o_16; + vec4 tmpvar_17; + tmpvar_17 = (tmpvar_9 * 0.5); + vec2 tmpvar_18; + tmpvar_18.x = tmpvar_17.x; + tmpvar_18.y = (tmpvar_17.y * _ProjectionParams.x); + o_16.xy = (tmpvar_18 + tmpvar_17.w); + o_16.zw = tmpvar_9.zw; + vec3 x2_19; + vec4 tmpvar_20; + tmpvar_20 = (tmpvar_15.xyzz * tmpvar_15.yzzx); + x2_19.x = dot (unity_SHBr, tmpvar_20); + x2_19.y = dot (unity_SHBg, tmpvar_20); + x2_19.z = dot (unity_SHBb, tmpvar_20); + tmpvar_6.xyz = (x2_19 + (unity_SHC.xyz * ( + (tmpvar_15.x * tmpvar_15.x) + - + (tmpvar_15.y * tmpvar_15.y) + ))); + gl_Position = tmpvar_9; + xlv_TEXCOORD0 = texcoord_10; + xlv_TEXCOORD1 = (tmpvar_7.xyz - _WorldSpaceCameraPos); + xlv_TEXCOORD2 = tmpvar_3; + xlv_TEXCOORD2_1 = tmpvar_4; + xlv_TEXCOORD2_2 = tmpvar_5; + xlv_TEXCOORD5 = tmpvar_6; + xlv_TEXCOORD6 = o_16; + xlv_TEXCOORD8 = tmpvar_8; +} + +[fragment shader] +#extension GL_ARB_shader_texture_lod : enable +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_ColorSpaceDielectricSpec; +uniform samplerCube unity_SpecCube; +uniform samplerCube unity_SpecCube1; +uniform vec4 _LightColor0; +uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform float _Metallic; +uniform float _Glossiness; +uniform sampler2D _OcclusionMap; +uniform float _OcclusionStrength; +uniform sampler2D _ShadowMapTexture; +uniform vec4 unity_SpecCube_BoxMax; +uniform vec4 unity_SpecCube_BoxMin; +uniform vec4 unity_SpecCube_ProbePosition; +uniform vec4 unity_SpecCube_HDR; +uniform vec4 unity_SpecCube_BoxMax1; +uniform vec4 unity_SpecCube_BoxMin1; +uniform vec4 unity_SpecCube_ProbePosition1; +uniform vec4 unity_SpecCube_HDR1; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2_2; +varying vec4 xlv_TEXCOORD5; +varying vec4 xlv_TEXCOORD6; +varying vec3 xlv_TEXCOORD8; +void main () +{ + vec4 c_1; + vec3 tmpvar_2; + tmpvar_2 = normalize(xlv_TEXCOORD2_2.xyz); + vec3 tmpvar_3; + tmpvar_3 = normalize(xlv_TEXCOORD1); + vec3 tmpvar_4; + tmpvar_4 = (_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz); + vec3 tmpvar_5; + vec3 tmpvar_6; + tmpvar_6 = mix (unity_ColorSpaceDielectricSpec.xyz, tmpvar_4, vec3(_Metallic)); + float tmpvar_7; + tmpvar_7 = (unity_ColorSpaceDielectricSpec.w - (_Metallic * unity_ColorSpaceDielectricSpec.w)); + tmpvar_5 = (tmpvar_4 * tmpvar_7); + float tmpvar_8; + tmpvar_8 = ((1.0 - _OcclusionStrength) + (texture2D (_OcclusionMap, xlv_TEXCOORD0.xy).y * _OcclusionStrength)); + float tmpvar_9; + tmpvar_9 = max (0.0, dot (tmpvar_2, _WorldSpaceLightPos0.xyz)); + vec3 tmpvar_10; + vec3 tmpvar_11; + vec3 tmpvar_12; + tmpvar_12 = vec3(0.0, 0.0, 0.0); + vec4 tmpvar_13; + tmpvar_13.w = 1.0; + tmpvar_13.xyz = tmpvar_2; + vec3 x1_14; + x1_14.x = dot (unity_SHAr, tmpvar_13); + x1_14.y = dot (unity_SHAg, tmpvar_13); + x1_14.z = dot (unity_SHAb, tmpvar_13); + tmpvar_11 = (xlv_TEXCOORD5.xyz + x1_14); + tmpvar_10 = ((_LightColor0.xyz + _LightColor0.xyz) * texture2DProj (_ShadowMapTexture, xlv_TEXCOORD6).x); + tmpvar_11 = (tmpvar_11 * tmpvar_8); + vec3 tmpvar_15; + tmpvar_15 = (tmpvar_3 - (2.0 * ( + dot (tmpvar_2, tmpvar_3) + * tmpvar_2))); + vec3 worldNormal_16; + worldNormal_16 = tmpvar_15; + if ((unity_SpecCube_ProbePosition.w > 0.0)) { + vec3 tmpvar_17; + tmpvar_17 = normalize(tmpvar_15); + vec3 tmpvar_18; + tmpvar_18 = ((unity_SpecCube_BoxMax.xyz - xlv_TEXCOORD8) / tmpvar_17); + vec3 tmpvar_19; + tmpvar_19 = ((unity_SpecCube_BoxMin.xyz - xlv_TEXCOORD8) / tmpvar_17); + bvec3 tmpvar_20; + tmpvar_20 = greaterThan (tmpvar_17, vec3(0.0, 0.0, 0.0)); + float tmpvar_21; + if (tmpvar_20.x) { + tmpvar_21 = tmpvar_18.x; + } else { + tmpvar_21 = tmpvar_19.x; + }; + float tmpvar_22; + if (tmpvar_20.y) { + tmpvar_22 = tmpvar_18.y; + } else { + tmpvar_22 = tmpvar_19.y; + }; + float tmpvar_23; + if (tmpvar_20.z) { + tmpvar_23 = tmpvar_18.z; + } else { + tmpvar_23 = tmpvar_19.z; + }; + vec3 tmpvar_24; + tmpvar_24 = ((unity_SpecCube_BoxMax.xyz + unity_SpecCube_BoxMin.xyz) * 0.5); + worldNormal_16 = ((( + (tmpvar_24 - unity_SpecCube_ProbePosition.xyz) + + xlv_TEXCOORD8) + (tmpvar_17 * + min (min (tmpvar_21, tmpvar_22), tmpvar_23) + )) - tmpvar_24); + }; + vec4 tmpvar_25; + tmpvar_25.xyz = worldNormal_16; + tmpvar_25.w = (pow ((1.0 - _Glossiness), 0.75) * 7.0); + vec4 tmpvar_26; + tmpvar_26 = textureCubeLod (unity_SpecCube, worldNormal_16, tmpvar_25.w); + vec3 tmpvar_27; + tmpvar_27 = ((unity_SpecCube_HDR.x * pow (tmpvar_26.w, unity_SpecCube_HDR.y)) * tmpvar_26.xyz); + if ((unity_SpecCube_BoxMin.w < 0.99999)) { + vec3 worldNormal_28; + worldNormal_28 = tmpvar_15; + if ((unity_SpecCube_ProbePosition1.w > 0.0)) { + vec3 tmpvar_29; + tmpvar_29 = normalize(tmpvar_15); + vec3 tmpvar_30; + tmpvar_30 = ((unity_SpecCube_BoxMax1.xyz - xlv_TEXCOORD8) / tmpvar_29); + vec3 tmpvar_31; + tmpvar_31 = ((unity_SpecCube_BoxMin1.xyz - xlv_TEXCOORD8) / tmpvar_29); + bvec3 tmpvar_32; + tmpvar_32 = greaterThan (tmpvar_29, vec3(0.0, 0.0, 0.0)); + float tmpvar_33; + if (tmpvar_32.x) { + tmpvar_33 = tmpvar_30.x; + } else { + tmpvar_33 = tmpvar_31.x; + }; + float tmpvar_34; + if (tmpvar_32.y) { + tmpvar_34 = tmpvar_30.y; + } else { + tmpvar_34 = tmpvar_31.y; + }; + float tmpvar_35; + if (tmpvar_32.z) { + tmpvar_35 = tmpvar_30.z; + } else { + tmpvar_35 = tmpvar_31.z; + }; + vec3 tmpvar_36; + tmpvar_36 = ((unity_SpecCube_BoxMax1.xyz + unity_SpecCube_BoxMin1.xyz) * 0.5); + worldNormal_28 = ((( + (tmpvar_36 - unity_SpecCube_ProbePosition1.xyz) + + xlv_TEXCOORD8) + (tmpvar_29 * + min (min (tmpvar_33, tmpvar_34), tmpvar_35) + )) - tmpvar_36); + }; + vec4 tmpvar_37; + tmpvar_37.xyz = worldNormal_28; + tmpvar_37.w = (pow ((1.0 - _Glossiness), 0.75) * 7.0); + vec4 tmpvar_38; + tmpvar_38 = textureCubeLod (unity_SpecCube1, worldNormal_28, tmpvar_37.w); + tmpvar_12 = mix (((unity_SpecCube_HDR1.x * + pow (tmpvar_38.w, unity_SpecCube_HDR1.y) + ) * tmpvar_38.xyz), tmpvar_27, unity_SpecCube_BoxMin.www); + } else { + tmpvar_12 = tmpvar_27; + }; + tmpvar_12 = (tmpvar_12 * tmpvar_8); + vec3 viewDir_39; + viewDir_39 = -(tmpvar_3); + float tmpvar_40; + tmpvar_40 = (1.0 - _Glossiness); + vec3 tmpvar_41; + tmpvar_41 = normalize((_WorldSpaceLightPos0.xyz + viewDir_39)); + float tmpvar_42; + tmpvar_42 = max (0.0, dot (tmpvar_2, viewDir_39)); + float tmpvar_43; + tmpvar_43 = max (0.0, dot (_WorldSpaceLightPos0.xyz, tmpvar_41)); + float tmpvar_44; + tmpvar_44 = ((tmpvar_40 * tmpvar_40) * 0.797885); + float tmpvar_45; + float tmpvar_46; + tmpvar_46 = (10.0 / log2(( + ((1.0 - tmpvar_40) * 0.968) + + 0.03))); + tmpvar_45 = (tmpvar_46 * tmpvar_46); + float tmpvar_47; + tmpvar_47 = (0.5 + (( + (2.0 * tmpvar_43) + * tmpvar_43) * tmpvar_40)); + vec3 tmpvar_48; + tmpvar_48 = (((tmpvar_5 * + (tmpvar_11 + (tmpvar_10 * (( + (1.0 + ((tmpvar_47 - 1.0) * pow ((1.0001 - tmpvar_9), 5.0))) + * + (1.0 + ((tmpvar_47 - 1.0) * pow ((1.0001 - tmpvar_42), 5.0))) + ) * tmpvar_9))) + ) + ( + ((max (0.0, ( + (((1.0/(( + ((tmpvar_9 * (1.0 - tmpvar_44)) + tmpvar_44) + * + ((tmpvar_42 * (1.0 - tmpvar_44)) + tmpvar_44) + ))) * (pow ( + max (0.0, dot (tmpvar_2, tmpvar_41)) + , tmpvar_45) * ( + (tmpvar_45 + 1.0) + / 6.28319))) * tmpvar_9) + / 4.0)) * 3.14159) * tmpvar_10) + * + (tmpvar_6 + ((1.0 - tmpvar_6) * pow (abs( + (1.0 - max (0.0, dot (viewDir_39, tmpvar_41))) + ), 5.0))) + )) + (tmpvar_12 * mix (tmpvar_6, vec3( + clamp ((_Glossiness + (1.0 - tmpvar_7)), 0.0, 1.0) + ), vec3( + pow (abs((1.0 - tmpvar_42)), 5.0) + )))); + vec4 tmpvar_49; + tmpvar_49.w = 1.0; + tmpvar_49.xyz = tmpvar_48; + c_1.w = tmpvar_49.w; + c_1.xyz = tmpvar_48; + c_1.xyz = c_1.xyz; + vec4 xlat_varoutput_50; + xlat_varoutput_50.xyz = c_1.xyz; + xlat_varoutput_50.w = 1.0; + gl_FragData[0] = xlat_varoutput_50; +} + diff --git a/shaders/unity/41-GrassBillboard.shader_test b/shaders/unity/41-GrassBillboard.shader_test new file mode 100644 index 0000000..a9740a4 --- /dev/null +++ b/shaders/unity/41-GrassBillboard.shader_test @@ -0,0 +1,173 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/TerrainEngine/Details/BillboardWavingDoublePass +# internal variant: DIRECTIONAL DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF SHADOWS_SCREEN +# 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; +uniform vec4 _WavingTint; +uniform vec4 _WaveAndDistance; +uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +attribute vec4 TANGENT; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +void main () +{ + vec4 pos_1; + pos_1 = gl_Vertex; + vec2 offset_2; + offset_2 = TANGENT.xy; + vec3 tmpvar_3; + tmpvar_3 = (gl_Vertex.xyz - _CameraPosition.xyz); + float tmpvar_4; + tmpvar_4 = dot (tmpvar_3, tmpvar_3); + if ((tmpvar_4 > _WaveAndDistance.w)) { + offset_2 = vec2(0.0, 0.0); + }; + pos_1.xyz = (gl_Vertex.xyz + (offset_2.x * _CameraRight)); + pos_1.xyz = (pos_1.xyz + (offset_2.y * _CameraUp)); + vec4 vertex_5; + vertex_5.yw = pos_1.yw; + vec4 color_6; + color_6.xyz = gl_Color.xyz; + vec3 waveMove_7; + vec4 tmpvar_8; + tmpvar_8 = ((fract( + (((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); + vec4 tmpvar_9; + tmpvar_9 = (tmpvar_8 * tmpvar_8); + vec4 tmpvar_10; + tmpvar_10 = (tmpvar_9 * tmpvar_8); + vec4 tmpvar_11; + tmpvar_11 = (tmpvar_10 * tmpvar_9); + vec4 tmpvar_12; + tmpvar_12 = (((tmpvar_8 + + (tmpvar_10 * -0.161616) + ) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); + vec4 tmpvar_13; + tmpvar_13 = (tmpvar_12 * tmpvar_12); + vec4 tmpvar_14; + tmpvar_14 = (tmpvar_13 * tmpvar_13); + vec4 tmpvar_15; + tmpvar_15 = (tmpvar_14 * TANGENT.y); + waveMove_7.y = 0.0; + waveMove_7.x = dot (tmpvar_15, vec4(0.024, 0.04, -0.12, 0.096)); + waveMove_7.z = dot (tmpvar_15, vec4(0.006, 0.02, -0.02, 0.1)); + vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z)); + vec3 tmpvar_16; + tmpvar_16 = (vertex_5.xyz - _CameraPosition.xyz); + color_6.w = clamp (((2.0 * + (_WaveAndDistance.w - dot (tmpvar_16, tmpvar_16)) + ) * _CameraPosition.w), 0.0, 1.0); + vec4 tmpvar_17; + tmpvar_17.xyz = ((2.0 * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_14, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * gl_Color.xyz); + tmpvar_17.w = color_6.w; + vec4 tmpvar_18; + tmpvar_18 = (gl_ModelViewProjectionMatrix * vertex_5); + vec4 v_19; + v_19.x = _World2Object[0].x; + v_19.y = _World2Object[1].x; + v_19.z = _World2Object[2].x; + v_19.w = _World2Object[3].x; + vec4 v_20; + v_20.x = _World2Object[0].y; + v_20.y = _World2Object[1].y; + v_20.z = _World2Object[2].y; + v_20.w = _World2Object[3].y; + vec4 v_21; + v_21.x = _World2Object[0].z; + v_21.y = _World2Object[1].z; + v_21.z = _World2Object[2].z; + v_21.w = _World2Object[3].z; + vec3 tmpvar_22; + tmpvar_22 = normalize((( + (v_19.xyz * gl_Normal.x) + + + (v_20.xyz * gl_Normal.y) + ) + (v_21.xyz * gl_Normal.z))); + vec4 tmpvar_23; + tmpvar_23.w = 1.0; + tmpvar_23.xyz = tmpvar_22; + vec3 x2_24; + vec3 x1_25; + x1_25.x = dot (unity_SHAr, tmpvar_23); + x1_25.y = dot (unity_SHAg, tmpvar_23); + x1_25.z = dot (unity_SHAb, tmpvar_23); + vec4 tmpvar_26; + tmpvar_26 = (tmpvar_22.xyzz * tmpvar_22.yzzx); + x2_24.x = dot (unity_SHBr, tmpvar_26); + x2_24.y = dot (unity_SHBg, tmpvar_26); + x2_24.z = dot (unity_SHBb, tmpvar_26); + vec4 o_27; + vec4 tmpvar_28; + tmpvar_28 = (tmpvar_18 * 0.5); + vec2 tmpvar_29; + tmpvar_29.x = tmpvar_28.x; + tmpvar_29.y = (tmpvar_28.y * _ProjectionParams.x); + o_27.xy = (tmpvar_29 + tmpvar_28.w); + o_27.zw = tmpvar_18.zw; + gl_Position = tmpvar_18; + xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + xlv_TEXCOORD1 = tmpvar_22; + xlv_COLOR0 = tmpvar_17; + xlv_TEXCOORD2 = ((x1_25 + x2_24) + (unity_SHC.xyz * ( + (tmpvar_22.x * tmpvar_22.x) + - + (tmpvar_22.y * tmpvar_22.y) + ))); + xlv_TEXCOORD3 = o_27; +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; +uniform sampler2D _MainTex; +uniform float _Cutoff; +varying vec2 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +void main () +{ + vec4 c_1; + vec4 tmpvar_2; + tmpvar_2 = (texture2D (_MainTex, xlv_TEXCOORD0) * xlv_COLOR0); + float x_3; + x_3 = (tmpvar_2.w - _Cutoff); + if ((x_3 < 0.0)) { + discard; + }; + c_1.w = 0.0; + c_1.xyz = (tmpvar_2.xyz * xlv_TEXCOORD2); + vec4 c_4; + c_4.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + max (0.0, dot (xlv_TEXCOORD1, _WorldSpaceLightPos0.xyz)) + * texture2DProj (_ShadowMapTexture, xlv_TEXCOORD3).x) * 2.0)); + c_4.w = (tmpvar_2.w * xlv_COLOR0.w); + c_1.xyz = (c_1 + c_4).xyz; + c_1.w = 1.0; + gl_FragData[0] = c_1; +} + diff --git a/shaders/unity/41.shader_test b/shaders/unity/41.shader_test new file mode 100644 index 0000000..609a820 --- /dev/null +++ b/shaders/unity/41.shader_test @@ -0,0 +1,248 @@ +# Built-in shader from Unity 5.0.0b19: +# Standard (Specular setup) +# internal variant: POINT SHADOWS_OFF _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 _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 vec3 xlv_TEXCOORD5; +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; + xlv_TEXCOORD5 = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz; +} + +[fragment shader] +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 sampler2D _LightTexture0; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD2_1; +varying vec4 xlv_TEXCOORD2_2; +varying vec3 xlv_TEXCOORD5; +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; + vec3 tmpvar_12; + tmpvar_12 = normalize(tmpvar_11); + float tmpvar_13; + tmpvar_13 = max (0.0, dot (tmpvar_8, tmpvar_12)); + vec3 tmpvar_14; + tmpvar_14 = ((_LightColor0.xyz + _LightColor0.xyz) * texture2D (_LightTexture0, vec2(dot (xlv_TEXCOORD5, xlv_TEXCOORD5))).w); + vec3 viewDir_15; + viewDir_15 = -(normalize(xlv_TEXCOORD1)); + float tmpvar_16; + tmpvar_16 = (1.0 - tmpvar_10.w); + vec3 tmpvar_17; + tmpvar_17 = normalize((tmpvar_12 + viewDir_15)); + float tmpvar_18; + tmpvar_18 = max (0.0, dot (tmpvar_8, viewDir_15)); + float tmpvar_19; + tmpvar_19 = max (0.0, dot (tmpvar_12, tmpvar_17)); + float tmpvar_20; + tmpvar_20 = ((tmpvar_16 * tmpvar_16) * 0.797885); + float tmpvar_21; + float tmpvar_22; + tmpvar_22 = (10.0 / log2(( + ((1.0 - tmpvar_16) * 0.968) + + 0.03))); + tmpvar_21 = (tmpvar_22 * tmpvar_22); + float tmpvar_23; + tmpvar_23 = (0.5 + (( + (2.0 * tmpvar_19) + * tmpvar_19) * tmpvar_16)); + vec4 tmpvar_24; + tmpvar_24.w = 1.0; + tmpvar_24.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_14 * + (((1.0 + ( + (tmpvar_23 - 1.0) + * + pow ((1.0001 - tmpvar_13), 5.0) + )) * (1.0 + ( + (tmpvar_23 - 1.0) + * + pow ((1.0001 - tmpvar_18), 5.0) + ))) * tmpvar_13) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_13 * (1.0 - tmpvar_20)) + + tmpvar_20) * ( + (tmpvar_18 * (1.0 - tmpvar_20)) + + tmpvar_20)))) * (pow (max (0.0, + dot (tmpvar_8, tmpvar_17) + ), tmpvar_21) * ((tmpvar_21 + 1.0) / 6.28319))) + * tmpvar_13) / 4.0)) * 3.14159) + * tmpvar_14) * (tmpvar_10.xyz + + ((1.0 - tmpvar_10.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_15, tmpvar_17)) + )), 5.0)) + ))); + vec4 xlat_varoutput_25; + xlat_varoutput_25.xyz = tmpvar_24.xyz; + xlat_varoutput_25.w = 1.0; + gl_FragData[0] = xlat_varoutput_25; +} + 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; +} + diff --git a/shaders/unity/50.shader_test b/shaders/unity/50.shader_test new file mode 100644 index 0000000..f8ab50c --- /dev/null +++ b/shaders/unity/50.shader_test @@ -0,0 +1,101 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/SSAO +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec2 _NoiseScale; +uniform vec4 _CameraDepthNormalsTexture_ST; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +void main () +{ + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _CameraDepthNormalsTexture_ST.xy) + _CameraDepthNormalsTexture_ST.zw); + xlv_TEXCOORD1 = (gl_MultiTexCoord0.xy * _NoiseScale); +} + +[fragment shader] +uniform vec4 _ProjectionParams; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform vec4 _Params; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +void main () +{ + vec3 RAND_SAMPLES_1[14]; + RAND_SAMPLES_1[0] = vec3(0.401004, 0.889938, -0.0175177); + RAND_SAMPLES_1[1] = vec3(0.161784, 0.133855, -0.353049); + RAND_SAMPLES_1[2] = vec3(-0.23053, -0.190009, 0.50254); + RAND_SAMPLES_1[3] = vec3(-0.625668, 0.124166, 0.116393); + RAND_SAMPLES_1[4] = vec3(0.382079, -0.32414, 0.411283); + RAND_SAMPLES_1[5] = vec3(-0.0882965, 0.164976, 0.139588); + RAND_SAMPLES_1[6] = vec3(0.189168, -0.128376, -0.0987356); + RAND_SAMPLES_1[7] = vec3(0.198614, 0.176724, 0.438049); + RAND_SAMPLES_1[8] = vec3(-0.329497, 0.0268434, -0.402184); + RAND_SAMPLES_1[9] = vec3(-0.019565, -0.310806, -0.410663); + RAND_SAMPLES_1[10] = vec3(-0.32155, 0.683205, -0.343345); + RAND_SAMPLES_1[11] = vec3(0.702613, 0.164825, 0.0225063); + RAND_SAMPLES_1[12] = vec3(0.0370446, -0.939131, 0.135877); + RAND_SAMPLES_1[13] = vec3(-0.698445, -0.600342, -0.0401694); + vec2 tmpvar_2; + tmpvar_2 = xlv_TEXCOORD0; + vec3 samples_3[14]; + samples_3[0]=RAND_SAMPLES_1[0];samples_3[1]=RAND_SAMPLES_1[1];samples_3[2]=RAND_SAMPLES_1[2];samples_3[3]=RAND_SAMPLES_1[3];samples_3[4]=RAND_SAMPLES_1[4];samples_3[5]=RAND_SAMPLES_1[5];samples_3[6]=RAND_SAMPLES_1[6];samples_3[7]=RAND_SAMPLES_1[7];samples_3[8]=RAND_SAMPLES_1[8];samples_3[9]=RAND_SAMPLES_1[9];samples_3[10]=RAND_SAMPLES_1[10];samples_3[11]=RAND_SAMPLES_1[11];samples_3[12]=RAND_SAMPLES_1[12];samples_3[13]=RAND_SAMPLES_1[13]; + float occ_5; + float scale_6; + float depth_7; + vec3 viewNorm_8; + vec3 randN_9; + randN_9 = ((texture2D (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0); + vec4 tmpvar_10; + tmpvar_10 = texture2D (_CameraDepthNormalsTexture, xlv_TEXCOORD0); + vec3 n_11; + vec3 tmpvar_12; + tmpvar_12 = ((tmpvar_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); + float tmpvar_13; + tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12)); + n_11.xy = (tmpvar_13 * tmpvar_12.xy); + n_11.z = (tmpvar_13 - 1.0); + viewNorm_8 = n_11; + float tmpvar_14; + tmpvar_14 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); + depth_7 = tmpvar_14; + scale_6 = (_Params.x / tmpvar_14); + occ_5 = 0.0; + for (int s_4 = 0; s_4 < 14; s_4++) { + vec3 tmpvar_15; + vec3 I_16; + I_16 = samples_3[s_4]; + tmpvar_15 = (I_16 - (2.0 * ( + dot (randN_9, I_16) + * randN_9))); + float tmpvar_17; + tmpvar_17 = dot (viewNorm_8, tmpvar_15); + float tmpvar_18; + if ((tmpvar_17 < 0.0)) { + tmpvar_18 = 1.0; + } else { + tmpvar_18 = -1.0; + }; + vec3 tmpvar_19; + tmpvar_19 = ((tmpvar_15 * -(tmpvar_18)) + (viewNorm_8 * 0.3)); + float tmpvar_20; + tmpvar_20 = clamp (((depth_7 - + (tmpvar_19.z * _Params.x) + ) - ( + dot (texture2D (_CameraDepthNormalsTexture, (tmpvar_2 + (tmpvar_19.xy * scale_6))).zw, vec2(1.0, 0.00392157)) + * _ProjectionParams.z)), 0.0, 1.0); + if ((tmpvar_20 > _Params.y)) { + occ_5 = (occ_5 + pow ((1.0 - tmpvar_20), _Params.z)); + }; + }; + float tmpvar_21; + tmpvar_21 = (occ_5 / 14.0); + occ_5 = tmpvar_21; + gl_FragData[0] = vec4((1.0 - tmpvar_21)); +} + diff --git a/shaders/unity/51.shader_test b/shaders/unity/51.shader_test new file mode 100644 index 0000000..849332a --- /dev/null +++ b/shaders/unity/51.shader_test @@ -0,0 +1,174 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/SSAO +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _CameraDepthNormalsTexture_ST; +varying vec2 xlv_TEXCOORD0; +void main () +{ + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _CameraDepthNormalsTexture_ST.xy) + _CameraDepthNormalsTexture_ST.zw); +} + +[fragment shader] +uniform vec4 _ProjectionParams; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _SSAO; +uniform vec3 _TexelOffsetScale; +varying vec2 xlv_TEXCOORD0; +void main () +{ + vec4 geom_1; + float denom_2; + float sum_3; + sum_3 = (texture2D (_SSAO, xlv_TEXCOORD0).x * 5.0); + geom_1 = texture2D (_CameraDepthNormalsTexture, xlv_TEXCOORD0); + vec2 tmpvar_4; + tmpvar_4 = (xlv_TEXCOORD0 + _TexelOffsetScale.xy); + vec4 tmpvar_5; + tmpvar_5 = texture2D (_CameraDepthNormalsTexture, tmpvar_4); + vec2 tmpvar_6; + tmpvar_6 = abs((geom_1.xy - tmpvar_5.xy)); + float tmpvar_7; + tmpvar_7 = (4.0 * (float( + ((tmpvar_6.x + tmpvar_6.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_5.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_4).x * tmpvar_7)); + denom_2 = (5.0 + tmpvar_7); + vec2 tmpvar_8; + vec2 cse_9; + cse_9 = (_TexelOffsetScale.xy * 2.0); + tmpvar_8 = (xlv_TEXCOORD0 + cse_9); + vec4 tmpvar_10; + tmpvar_10 = texture2D (_CameraDepthNormalsTexture, tmpvar_8); + vec2 tmpvar_11; + tmpvar_11 = abs((geom_1.xy - tmpvar_10.xy)); + float tmpvar_12; + tmpvar_12 = (3.0 * (float( + ((tmpvar_11.x + tmpvar_11.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_8).x * tmpvar_12)); + denom_2 = (denom_2 + tmpvar_12); + vec2 tmpvar_13; + vec2 cse_14; + cse_14 = (_TexelOffsetScale.xy * 3.0); + tmpvar_13 = (xlv_TEXCOORD0 + cse_14); + vec4 tmpvar_15; + tmpvar_15 = texture2D (_CameraDepthNormalsTexture, tmpvar_13); + vec2 tmpvar_16; + tmpvar_16 = abs((geom_1.xy - tmpvar_15.xy)); + float tmpvar_17; + tmpvar_17 = (2.0 * (float( + ((tmpvar_16.x + tmpvar_16.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_15.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_13).x * tmpvar_17)); + denom_2 = (denom_2 + tmpvar_17); + vec2 tmpvar_18; + vec2 cse_19; + cse_19 = (_TexelOffsetScale.xy * 4.0); + tmpvar_18 = (xlv_TEXCOORD0 + cse_19); + vec4 tmpvar_20; + tmpvar_20 = texture2D (_CameraDepthNormalsTexture, tmpvar_18); + vec2 tmpvar_21; + tmpvar_21 = abs((geom_1.xy - tmpvar_20.xy)); + float tmpvar_22; + tmpvar_22 = (float(( + (tmpvar_21.x + tmpvar_21.y) + < 0.1)) * float(( + (abs((dot (geom_1.zw, vec2(1.0, 0.00392157)) - dot (tmpvar_20.zw, vec2(1.0, 0.00392157)))) * _ProjectionParams.z) + < 0.2))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_18).x * tmpvar_22)); + denom_2 = (denom_2 + tmpvar_22); + vec2 tmpvar_23; + tmpvar_23 = (xlv_TEXCOORD0 - _TexelOffsetScale.xy); + vec4 tmpvar_24; + tmpvar_24 = texture2D (_CameraDepthNormalsTexture, tmpvar_23); + vec2 tmpvar_25; + tmpvar_25 = abs((geom_1.xy - tmpvar_24.xy)); + float tmpvar_26; + tmpvar_26 = (4.0 * (float( + ((tmpvar_25.x + tmpvar_25.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_24.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_23).x * tmpvar_26)); + denom_2 = (denom_2 + tmpvar_26); + vec2 tmpvar_27; + tmpvar_27 = (xlv_TEXCOORD0 - cse_9); + vec4 tmpvar_28; + tmpvar_28 = texture2D (_CameraDepthNormalsTexture, tmpvar_27); + vec2 tmpvar_29; + tmpvar_29 = abs((geom_1.xy - tmpvar_28.xy)); + float tmpvar_30; + tmpvar_30 = (3.0 * (float( + ((tmpvar_29.x + tmpvar_29.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_28.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_27).x * tmpvar_30)); + denom_2 = (denom_2 + tmpvar_30); + vec2 tmpvar_31; + tmpvar_31 = (xlv_TEXCOORD0 - cse_14); + vec4 tmpvar_32; + tmpvar_32 = texture2D (_CameraDepthNormalsTexture, tmpvar_31); + vec2 tmpvar_33; + tmpvar_33 = abs((geom_1.xy - tmpvar_32.xy)); + float tmpvar_34; + tmpvar_34 = (2.0 * (float( + ((tmpvar_33.x + tmpvar_33.y) < 0.1) + ) * float( + ((abs(( + dot (geom_1.zw, vec2(1.0, 0.00392157)) + - + dot (tmpvar_32.zw, vec2(1.0, 0.00392157)) + )) * _ProjectionParams.z) < 0.2) + ))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_31).x * tmpvar_34)); + denom_2 = (denom_2 + tmpvar_34); + vec2 tmpvar_35; + tmpvar_35 = (xlv_TEXCOORD0 - cse_19); + vec4 tmpvar_36; + tmpvar_36 = texture2D (_CameraDepthNormalsTexture, tmpvar_35); + vec2 tmpvar_37; + tmpvar_37 = abs((geom_1.xy - tmpvar_36.xy)); + float tmpvar_38; + tmpvar_38 = (float(( + (tmpvar_37.x + tmpvar_37.y) + < 0.1)) * float(( + (abs((dot (geom_1.zw, vec2(1.0, 0.00392157)) - dot (tmpvar_36.zw, vec2(1.0, 0.00392157)))) * _ProjectionParams.z) + < 0.2))); + sum_3 = (sum_3 + (texture2D (_SSAO, tmpvar_35).x * tmpvar_38)); + denom_2 = (denom_2 + tmpvar_38); + gl_FragData[0] = vec4((sum_3 / denom_2)); +} + diff --git a/shaders/unity/56-PBS_Deferred_MRT.shader_test b/shaders/unity/56-PBS_Deferred_MRT.shader_test new file mode 100644 index 0000000..48af19f --- /dev/null +++ b/shaders/unity/56-PBS_Deferred_MRT.shader_test @@ -0,0 +1,341 @@ +# Built-in shader from Unity 5.0.0b19: +# Standard; deferred shading g-buffer (MRT) output pass +# internal variant: DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF LIGHTMAP_OFF _METALLICGLOSSMAP _NORMALMAP +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec3 _WorldSpaceCameraPos; +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 _DetailAlbedoMap_ST; +uniform float _UVSec; +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 vec3 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; + vec4 tmpvar_7; + tmpvar_7 = (_Object2World * gl_Vertex); + vec3 tmpvar_8; + tmpvar_8 = tmpvar_7.xyz; + vec4 tmpvar_9; + tmpvar_9 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 texcoord_10; + texcoord_10.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + vec2 tmpvar_11; + if ((_UVSec == 0.0)) { + tmpvar_11 = tmpvar_1; + } else { + tmpvar_11 = tmpvar_2; + }; + texcoord_10.zw = ((tmpvar_11 * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + vec4 v_12; + v_12.x = _World2Object[0].x; + v_12.y = _World2Object[1].x; + v_12.z = _World2Object[2].x; + v_12.w = _World2Object[3].x; + vec4 v_13; + v_13.x = _World2Object[0].y; + v_13.y = _World2Object[1].y; + v_13.z = _World2Object[2].y; + v_13.w = _World2Object[3].y; + vec4 v_14; + v_14.x = _World2Object[0].z; + v_14.y = _World2Object[1].z; + v_14.z = _World2Object[2].z; + v_14.w = _World2Object[3].z; + vec3 tmpvar_15; + tmpvar_15 = normalize((( + (v_12.xyz * gl_Normal.x) + + + (v_13.xyz * gl_Normal.y) + ) + (v_14.xyz * gl_Normal.z))); + mat3 tmpvar_16; + tmpvar_16[0] = _Object2World[0].xyz; + tmpvar_16[1] = _Object2World[1].xyz; + tmpvar_16[2] = _Object2World[2].xyz; + vec4 tmpvar_17; + tmpvar_17.xyz = normalize((tmpvar_16 * TANGENT.xyz)); + tmpvar_17.w = TANGENT.w; + vec3 tmpvar_18; + vec3 tmpvar_19; + tmpvar_18 = tmpvar_17.xyz; + tmpvar_19 = (((tmpvar_15.yzx * tmpvar_17.zxy) - (tmpvar_15.zxy * tmpvar_17.yzx)) * TANGENT.www); + vec3 tmpvar_20; + vec3 tmpvar_21; + vec3 tmpvar_22; + tmpvar_20.x = tmpvar_18.x; + tmpvar_20.y = tmpvar_19.x; + tmpvar_20.z = tmpvar_15.x; + tmpvar_21.x = tmpvar_18.y; + tmpvar_21.y = tmpvar_19.y; + tmpvar_21.z = tmpvar_15.y; + tmpvar_22.x = tmpvar_18.z; + tmpvar_22.y = tmpvar_19.z; + tmpvar_22.z = tmpvar_15.z; + vec3 v_23; + v_23.x = tmpvar_20.x; + v_23.y = tmpvar_21.x; + v_23.z = tmpvar_22.x; + tmpvar_3.xyz = v_23; + vec3 v_24; + v_24.x = tmpvar_20.y; + v_24.y = tmpvar_21.y; + v_24.z = tmpvar_22.y; + tmpvar_4.xyz = v_24; + vec3 v_25; + v_25.x = tmpvar_20.z; + v_25.y = tmpvar_21.z; + v_25.z = tmpvar_22.z; + tmpvar_5.xyz = v_25; + vec3 x2_26; + vec4 tmpvar_27; + tmpvar_27 = (tmpvar_15.xyzz * tmpvar_15.yzzx); + x2_26.x = dot (unity_SHBr, tmpvar_27); + x2_26.y = dot (unity_SHBg, tmpvar_27); + x2_26.z = dot (unity_SHBb, tmpvar_27); + tmpvar_6.xyz = (x2_26 + (unity_SHC.xyz * ( + (tmpvar_15.x * tmpvar_15.x) + - + (tmpvar_15.y * tmpvar_15.y) + ))); + gl_Position = tmpvar_9; + xlv_TEXCOORD0 = texcoord_10; + xlv_TEXCOORD1 = (tmpvar_7.xyz - _WorldSpaceCameraPos); + xlv_TEXCOORD2 = tmpvar_3; + xlv_TEXCOORD2_1 = tmpvar_4; + xlv_TEXCOORD2_2 = tmpvar_5; + xlv_TEXCOORD5 = tmpvar_6; + xlv_TEXCOORD6 = tmpvar_8; +} + +[fragment shader] +#extension GL_ARB_shader_texture_lod : enable +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_ColorSpaceDielectricSpec; +uniform samplerCube unity_SpecCube; +uniform samplerCube unity_SpecCube1; +uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform sampler2D _MetallicGlossMap; +uniform sampler2D _OcclusionMap; +uniform float _OcclusionStrength; +uniform vec4 unity_SpecCube_BoxMax; +uniform vec4 unity_SpecCube_BoxMin; +uniform vec4 unity_SpecCube_ProbePosition; +uniform vec4 unity_SpecCube_HDR; +uniform vec4 unity_SpecCube_BoxMax1; +uniform vec4 unity_SpecCube_BoxMin1; +uniform vec4 unity_SpecCube_ProbePosition1; +uniform vec4 unity_SpecCube_HDR1; +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 vec3 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 tmpvar_6; + tmpvar_6 = normalize((normal_5 * tmpvar_4)); + vec3 tmpvar_7; + tmpvar_7 = normalize(xlv_TEXCOORD1); + vec2 tmpvar_8; + tmpvar_8 = texture2D (_MetallicGlossMap, xlv_TEXCOORD0.xy).xw; + float tmpvar_9; + tmpvar_9 = tmpvar_8.y; + vec3 tmpvar_10; + tmpvar_10 = (_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz); + vec3 tmpvar_11; + vec3 tmpvar_12; + tmpvar_12 = mix (unity_ColorSpaceDielectricSpec.xyz, tmpvar_10, tmpvar_8.xxx); + float tmpvar_13; + tmpvar_13 = (unity_ColorSpaceDielectricSpec.w - (tmpvar_8.x * unity_ColorSpaceDielectricSpec.w)); + tmpvar_11 = (tmpvar_10 * tmpvar_13); + float tmpvar_14; + tmpvar_14 = ((1.0 - _OcclusionStrength) + (texture2D (_OcclusionMap, xlv_TEXCOORD0.xy).y * _OcclusionStrength)); + vec3 tmpvar_15; + vec3 tmpvar_16; + tmpvar_16 = vec3(0.0, 0.0, 0.0); + vec4 tmpvar_17; + tmpvar_17.w = 1.0; + tmpvar_17.xyz = tmpvar_6; + vec3 x1_18; + x1_18.x = dot (unity_SHAr, tmpvar_17); + x1_18.y = dot (unity_SHAg, tmpvar_17); + x1_18.z = dot (unity_SHAb, tmpvar_17); + tmpvar_15 = (xlv_TEXCOORD5.xyz + x1_18); + tmpvar_15 = (tmpvar_15 * tmpvar_14); + vec3 tmpvar_19; + tmpvar_19 = (tmpvar_7 - (2.0 * ( + dot (tmpvar_6, tmpvar_7) + * tmpvar_6))); + vec3 worldNormal_20; + worldNormal_20 = tmpvar_19; + if ((unity_SpecCube_ProbePosition.w > 0.0)) { + vec3 tmpvar_21; + tmpvar_21 = normalize(tmpvar_19); + vec3 tmpvar_22; + tmpvar_22 = ((unity_SpecCube_BoxMax.xyz - xlv_TEXCOORD6) / tmpvar_21); + vec3 tmpvar_23; + tmpvar_23 = ((unity_SpecCube_BoxMin.xyz - xlv_TEXCOORD6) / tmpvar_21); + bvec3 tmpvar_24; + tmpvar_24 = greaterThan (tmpvar_21, vec3(0.0, 0.0, 0.0)); + float tmpvar_25; + if (tmpvar_24.x) { + tmpvar_25 = tmpvar_22.x; + } else { + tmpvar_25 = tmpvar_23.x; + }; + float tmpvar_26; + if (tmpvar_24.y) { + tmpvar_26 = tmpvar_22.y; + } else { + tmpvar_26 = tmpvar_23.y; + }; + float tmpvar_27; + if (tmpvar_24.z) { + tmpvar_27 = tmpvar_22.z; + } else { + tmpvar_27 = tmpvar_23.z; + }; + vec3 tmpvar_28; + tmpvar_28 = ((unity_SpecCube_BoxMax.xyz + unity_SpecCube_BoxMin.xyz) * 0.5); + worldNormal_20 = ((( + (tmpvar_28 - unity_SpecCube_ProbePosition.xyz) + + xlv_TEXCOORD6) + (tmpvar_21 * + min (min (tmpvar_25, tmpvar_26), tmpvar_27) + )) - tmpvar_28); + }; + vec4 tmpvar_29; + tmpvar_29.xyz = worldNormal_20; + tmpvar_29.w = (pow ((1.0 - tmpvar_8.y), 0.75) * 7.0); + vec4 tmpvar_30; + tmpvar_30 = textureCubeLod (unity_SpecCube, worldNormal_20, tmpvar_29.w); + vec3 tmpvar_31; + tmpvar_31 = ((unity_SpecCube_HDR.x * pow (tmpvar_30.w, unity_SpecCube_HDR.y)) * tmpvar_30.xyz); + if ((unity_SpecCube_BoxMin.w < 0.99999)) { + vec3 worldNormal_32; + worldNormal_32 = tmpvar_19; + if ((unity_SpecCube_ProbePosition1.w > 0.0)) { + vec3 tmpvar_33; + tmpvar_33 = normalize(tmpvar_19); + vec3 tmpvar_34; + tmpvar_34 = ((unity_SpecCube_BoxMax1.xyz - xlv_TEXCOORD6) / tmpvar_33); + vec3 tmpvar_35; + tmpvar_35 = ((unity_SpecCube_BoxMin1.xyz - xlv_TEXCOORD6) / tmpvar_33); + bvec3 tmpvar_36; + tmpvar_36 = greaterThan (tmpvar_33, vec3(0.0, 0.0, 0.0)); + float tmpvar_37; + if (tmpvar_36.x) { + tmpvar_37 = tmpvar_34.x; + } else { + tmpvar_37 = tmpvar_35.x; + }; + float tmpvar_38; + if (tmpvar_36.y) { + tmpvar_38 = tmpvar_34.y; + } else { + tmpvar_38 = tmpvar_35.y; + }; + float tmpvar_39; + if (tmpvar_36.z) { + tmpvar_39 = tmpvar_34.z; + } else { + tmpvar_39 = tmpvar_35.z; + }; + vec3 tmpvar_40; + tmpvar_40 = ((unity_SpecCube_BoxMax1.xyz + unity_SpecCube_BoxMin1.xyz) * 0.5); + worldNormal_32 = ((( + (tmpvar_40 - unity_SpecCube_ProbePosition1.xyz) + + xlv_TEXCOORD6) + (tmpvar_33 * + min (min (tmpvar_37, tmpvar_38), tmpvar_39) + )) - tmpvar_40); + }; + vec4 tmpvar_41; + tmpvar_41.xyz = worldNormal_32; + tmpvar_41.w = (pow ((1.0 - tmpvar_8.y), 0.75) * 7.0); + vec4 tmpvar_42; + tmpvar_42 = textureCubeLod (unity_SpecCube1, worldNormal_32, tmpvar_41.w); + tmpvar_16 = mix (((unity_SpecCube_HDR1.x * + pow (tmpvar_42.w, unity_SpecCube_HDR1.y) + ) * tmpvar_42.xyz), tmpvar_31, unity_SpecCube_BoxMin.www); + } else { + tmpvar_16 = tmpvar_31; + }; + tmpvar_16 = (tmpvar_16 * tmpvar_14); + vec4 tmpvar_43; + tmpvar_43.w = 1.0; + tmpvar_43.xyz = ((tmpvar_11 * tmpvar_15) + (tmpvar_16 * mix (tmpvar_12, vec3( + clamp ((tmpvar_8.y + (1.0 - tmpvar_13)), 0.0, 1.0) + ), vec3( + pow (abs((1.0 - max (0.0, + dot (tmpvar_6, -(tmpvar_7)) + ))), 5.0) + )))); + vec4 tmpvar_44; + tmpvar_44.xyz = tmpvar_11; + tmpvar_44.w = tmpvar_14; + vec4 tmpvar_45; + tmpvar_45.xyz = tmpvar_12; + tmpvar_45.w = tmpvar_9; + vec4 tmpvar_46; + tmpvar_46.w = 1.0; + tmpvar_46.xyz = ((tmpvar_6 * 0.5) + 0.5); + vec4 tmpvar_47; + tmpvar_47.w = 1.0; + tmpvar_47.xyz = exp2(-(tmpvar_43.xyz)); + gl_FragData[0] = tmpvar_44; + gl_FragData[1] = tmpvar_45; + gl_FragData[2] = tmpvar_46; + gl_FragData[3] = tmpvar_47; +} + diff --git a/shaders/unity/57-DeferredDirectional.shader_test b/shaders/unity/57-DeferredDirectional.shader_test new file mode 100644 index 0000000..72946b7 --- /dev/null +++ b/shaders/unity/57-DeferredDirectional.shader_test @@ -0,0 +1,126 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-DeferredShading +# internal variant: DIRECTIONAL SHADOWS_SCREEN +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + +uniform float _LightAsQuad; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_2; + vec4 tmpvar_3; + tmpvar_3 = (tmpvar_1 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = tmpvar_3.x; + tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); + o_2.xy = (tmpvar_4 + tmpvar_3.w); + o_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_2; + xlv_TEXCOORD1 = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(_LightAsQuad)); +} + +[fragment shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ZBufferParams; +uniform vec4 _LightShadowData; +uniform vec4 unity_ShadowFadeCenterAndType; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightDir; +uniform vec4 _LightColor; +uniform mat4 _CameraToWorld; +uniform sampler2D _ShadowMapTexture; +uniform sampler2D _CameraGBufferTexture0; +uniform sampler2D _CameraGBufferTexture1; +uniform sampler2D _CameraGBufferTexture2; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec3 lightDir_1; + vec2 tmpvar_2; + tmpvar_2 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_3; + tmpvar_3.w = 1.0; + tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_2).x) + + _ZBufferParams.y)))); + vec3 tmpvar_4; + tmpvar_4 = (_CameraToWorld * tmpvar_3).xyz; + vec3 tmpvar_5; + tmpvar_5 = (tmpvar_4 - unity_ShadowFadeCenterAndType.xyz); + lightDir_1 = -(_LightDir.xyz); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_CameraGBufferTexture1, tmpvar_2); + vec3 tmpvar_7; + tmpvar_7 = (_LightColor.xyz * clamp ((texture2D (_ShadowMapTexture, tmpvar_2).x + + clamp (((mix (tmpvar_3.z, + sqrt(dot (tmpvar_5, tmpvar_5)) + , unity_ShadowFadeCenterAndType.w) * _LightShadowData.z) + _LightShadowData.w), 0.0, 1.0) + ), 0.0, 1.0)); + vec3 tmpvar_8; + tmpvar_8 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_2).xyz * 2.0) - 1.0)); + float tmpvar_9; + tmpvar_9 = max (0.0, dot (tmpvar_8, lightDir_1)); + vec3 viewDir_10; + viewDir_10 = -(normalize((tmpvar_4 - _WorldSpaceCameraPos))); + float tmpvar_11; + tmpvar_11 = (1.0 - tmpvar_6.w); + vec3 tmpvar_12; + tmpvar_12 = normalize((lightDir_1 + viewDir_10)); + float tmpvar_13; + tmpvar_13 = max (0.0, dot (tmpvar_8, viewDir_10)); + float tmpvar_14; + tmpvar_14 = max (0.0, dot (lightDir_1, tmpvar_12)); + float tmpvar_15; + tmpvar_15 = ((tmpvar_11 * tmpvar_11) * 0.797885); + float tmpvar_16; + float tmpvar_17; + tmpvar_17 = (10.0 / log2(( + ((1.0 - tmpvar_11) * 0.968) + + 0.03))); + tmpvar_16 = (tmpvar_17 * tmpvar_17); + float tmpvar_18; + tmpvar_18 = (0.5 + (( + (2.0 * tmpvar_14) + * tmpvar_14) * tmpvar_11)); + vec4 tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_2).xyz * (tmpvar_7 * + (((1.0 + ( + (tmpvar_18 - 1.0) + * + pow ((1.0001 - tmpvar_9), 5.0) + )) * (1.0 + ( + (tmpvar_18 - 1.0) + * + pow ((1.0001 - tmpvar_13), 5.0) + ))) * tmpvar_9) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_9 * (1.0 - tmpvar_15)) + + tmpvar_15) * ( + (tmpvar_13 * (1.0 - tmpvar_15)) + + tmpvar_15)))) * (pow (max (0.0, + dot (tmpvar_8, tmpvar_12) + ), tmpvar_16) * ((tmpvar_16 + 1.0) / 6.28319))) + * tmpvar_9) / 4.0)) * 3.14159) + * tmpvar_7) * (tmpvar_6.xyz + + ((1.0 - tmpvar_6.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_10, tmpvar_12)) + )), 5.0)) + ))); + gl_FragData[0] = exp2(-(tmpvar_19)); +} + diff --git a/shaders/unity/59-DeferredPoint.shader_test b/shaders/unity/59-DeferredPoint.shader_test new file mode 100644 index 0000000..ab1bd54 --- /dev/null +++ b/shaders/unity/59-DeferredPoint.shader_test @@ -0,0 +1,120 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-DeferredShading +# internal variant: POINT SHADOWS_OFF +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + +uniform float _LightAsQuad; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_2; + vec4 tmpvar_3; + tmpvar_3 = (tmpvar_1 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = tmpvar_3.x; + tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); + o_2.xy = (tmpvar_4 + tmpvar_3.w); + o_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_2; + xlv_TEXCOORD1 = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(_LightAsQuad)); +} + +[fragment shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ZBufferParams; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightPos; +uniform vec4 _LightColor; +uniform mat4 _CameraToWorld; +uniform sampler2D _LightTextureB0; +uniform sampler2D _CameraGBufferTexture0; +uniform sampler2D _CameraGBufferTexture1; +uniform sampler2D _CameraGBufferTexture2; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_2; + tmpvar_2.w = 1.0; + tmpvar_2.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_1).x) + + _ZBufferParams.y)))); + vec3 tmpvar_3; + tmpvar_3 = (_CameraToWorld * tmpvar_2).xyz; + vec3 tmpvar_4; + tmpvar_4 = (tmpvar_3 - _LightPos.xyz); + vec3 tmpvar_5; + tmpvar_5 = -(normalize(tmpvar_4)); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_CameraGBufferTexture1, tmpvar_1); + vec3 tmpvar_7; + tmpvar_7 = (_LightColor.xyz * texture2D (_LightTextureB0, vec2((dot (tmpvar_4, tmpvar_4) * _LightPos.w))).w); + vec3 tmpvar_8; + tmpvar_8 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_1).xyz * 2.0) - 1.0)); + float tmpvar_9; + tmpvar_9 = max (0.0, dot (tmpvar_8, tmpvar_5)); + vec3 viewDir_10; + viewDir_10 = -(normalize((tmpvar_3 - _WorldSpaceCameraPos))); + float tmpvar_11; + tmpvar_11 = (1.0 - tmpvar_6.w); + vec3 tmpvar_12; + tmpvar_12 = normalize((tmpvar_5 + viewDir_10)); + float tmpvar_13; + tmpvar_13 = max (0.0, dot (tmpvar_8, viewDir_10)); + float tmpvar_14; + tmpvar_14 = max (0.0, dot (tmpvar_5, tmpvar_12)); + float tmpvar_15; + tmpvar_15 = ((tmpvar_11 * tmpvar_11) * 0.797885); + float tmpvar_16; + float tmpvar_17; + tmpvar_17 = (10.0 / log2(( + ((1.0 - tmpvar_11) * 0.968) + + 0.03))); + tmpvar_16 = (tmpvar_17 * tmpvar_17); + float tmpvar_18; + tmpvar_18 = (0.5 + (( + (2.0 * tmpvar_14) + * tmpvar_14) * tmpvar_11)); + vec4 tmpvar_19; + tmpvar_19.w = 1.0; + tmpvar_19.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_1).xyz * (tmpvar_7 * + (((1.0 + ( + (tmpvar_18 - 1.0) + * + pow ((1.0001 - tmpvar_9), 5.0) + )) * (1.0 + ( + (tmpvar_18 - 1.0) + * + pow ((1.0001 - tmpvar_13), 5.0) + ))) * tmpvar_9) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_9 * (1.0 - tmpvar_15)) + + tmpvar_15) * ( + (tmpvar_13 * (1.0 - tmpvar_15)) + + tmpvar_15)))) * (pow (max (0.0, + dot (tmpvar_8, tmpvar_12) + ), tmpvar_16) * ((tmpvar_16 + 1.0) / 6.28319))) + * tmpvar_9) / 4.0)) * 3.14159) + * tmpvar_7) * (tmpvar_6.xyz + + ((1.0 - tmpvar_6.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_10, tmpvar_12)) + )), 5.0)) + ))); + gl_FragData[0] = exp2(-(tmpvar_19)); +} + diff --git a/shaders/unity/59.shader_test b/shaders/unity/59.shader_test new file mode 100644 index 0000000..9768bb2 --- /dev/null +++ b/shaders/unity/59.shader_test @@ -0,0 +1,61 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/BlurAndFlares +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _Offsets; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD0_1; +varying vec2 xlv_TEXCOORD0_2; +varying vec2 xlv_TEXCOORD0_3; +varying vec2 xlv_TEXCOORD0_4; +varying vec2 xlv_TEXCOORD0_5; +varying vec2 xlv_TEXCOORD0_6; +void main () +{ + vec2 cse_1; + cse_1 = (0.5 * _MainTex_TexelSize.xy); + vec2 cse_2; + cse_2 = (1.5 * _MainTex_TexelSize.xy); + vec2 cse_3; + cse_3 = (2.5 * _MainTex_TexelSize.xy); + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = gl_MultiTexCoord0.xy; + xlv_TEXCOORD0_1 = (gl_MultiTexCoord0.xy + (cse_1 * _Offsets.xy)); + xlv_TEXCOORD0_2 = (gl_MultiTexCoord0.xy - (cse_1 * _Offsets.xy)); + xlv_TEXCOORD0_3 = (gl_MultiTexCoord0.xy + (cse_2 * _Offsets.xy)); + xlv_TEXCOORD0_4 = (gl_MultiTexCoord0.xy - (cse_2 * _Offsets.xy)); + xlv_TEXCOORD0_5 = (gl_MultiTexCoord0.xy + (cse_3 * _Offsets.xy)); + xlv_TEXCOORD0_6 = (gl_MultiTexCoord0.xy - (cse_3 * _Offsets.xy)); +} + +[fragment shader] +uniform vec4 _TintColor; +uniform vec2 _Threshhold; +uniform float _Saturation; +uniform sampler2D _MainTex; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD0_1; +varying vec2 xlv_TEXCOORD0_2; +varying vec2 xlv_TEXCOORD0_3; +varying vec2 xlv_TEXCOORD0_4; +varying vec2 xlv_TEXCOORD0_5; +varying vec2 xlv_TEXCOORD0_6; +void main () +{ + vec4 color_1; + vec4 tmpvar_2; + tmpvar_2 = max ((( + (((( + ((texture2D (_MainTex, xlv_TEXCOORD0) + texture2D (_MainTex, xlv_TEXCOORD0_1)) + texture2D (_MainTex, xlv_TEXCOORD0_2)) + + texture2D (_MainTex, xlv_TEXCOORD0_3)) + texture2D (_MainTex, xlv_TEXCOORD0_4)) + texture2D (_MainTex, xlv_TEXCOORD0_5)) + texture2D (_MainTex, xlv_TEXCOORD0_6)) + / 7.0) - _Threshhold.xxxx), vec4(0.0, 0.0, 0.0, 0.0)); + color_1.w = tmpvar_2.w; + color_1.xyz = (mix (vec3(dot (tmpvar_2.xyz, vec3(0.22, 0.707, 0.071))), tmpvar_2.xyz, vec3(_Saturation)) * _TintColor.xyz); + gl_FragData[0] = color_1; +} + diff --git a/shaders/unity/60-DeferredSpot.shader_test b/shaders/unity/60-DeferredSpot.shader_test new file mode 100644 index 0000000..b5773b4 --- /dev/null +++ b/shaders/unity/60-DeferredSpot.shader_test @@ -0,0 +1,131 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-DeferredShading +# internal variant: SHADOWS_OFF SPOT +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + +uniform float _LightAsQuad; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_2; + vec4 tmpvar_3; + tmpvar_3 = (tmpvar_1 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = tmpvar_3.x; + tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); + o_2.xy = (tmpvar_4 + tmpvar_3.w); + o_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_2; + xlv_TEXCOORD1 = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(_LightAsQuad)); +} + +[fragment shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ZBufferParams; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightPos; +uniform vec4 _LightColor; +uniform mat4 _CameraToWorld; +uniform mat4 _LightMatrix0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _LightTexture0; +uniform sampler2D _CameraGBufferTexture0; +uniform sampler2D _CameraGBufferTexture1; +uniform sampler2D _CameraGBufferTexture2; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_2; + tmpvar_2.w = 1.0; + tmpvar_2.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_1).x) + + _ZBufferParams.y)))); + vec3 tmpvar_3; + tmpvar_3 = (_CameraToWorld * tmpvar_2).xyz; + vec3 tmpvar_4; + tmpvar_4 = (_LightPos.xyz - tmpvar_3); + vec3 tmpvar_5; + tmpvar_5 = normalize(tmpvar_4); + vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = tmpvar_3; + vec4 tmpvar_7; + tmpvar_7 = (_LightMatrix0 * tmpvar_6); + vec4 tmpvar_8; + tmpvar_8 = texture2D (_CameraGBufferTexture1, tmpvar_1); + vec3 tmpvar_9; + tmpvar_9 = (_LightColor.xyz * ((texture2DProj (_LightTexture0, tmpvar_7).w * + float((tmpvar_7.w < 0.0)) + ) * texture2D (_LightTextureB0, vec2(( + dot (tmpvar_4, tmpvar_4) + * _LightPos.w))).w)); + vec3 tmpvar_10; + tmpvar_10 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_1).xyz * 2.0) - 1.0)); + float tmpvar_11; + tmpvar_11 = max (0.0, dot (tmpvar_10, tmpvar_5)); + vec3 viewDir_12; + viewDir_12 = -(normalize((tmpvar_3 - _WorldSpaceCameraPos))); + float tmpvar_13; + tmpvar_13 = (1.0 - tmpvar_8.w); + vec3 tmpvar_14; + tmpvar_14 = normalize((tmpvar_5 + viewDir_12)); + float tmpvar_15; + tmpvar_15 = max (0.0, dot (tmpvar_10, viewDir_12)); + float tmpvar_16; + tmpvar_16 = max (0.0, dot (tmpvar_5, tmpvar_14)); + float tmpvar_17; + tmpvar_17 = ((tmpvar_13 * tmpvar_13) * 0.797885); + float tmpvar_18; + float tmpvar_19; + tmpvar_19 = (10.0 / log2(( + ((1.0 - tmpvar_13) * 0.968) + + 0.03))); + tmpvar_18 = (tmpvar_19 * tmpvar_19); + float tmpvar_20; + tmpvar_20 = (0.5 + (( + (2.0 * tmpvar_16) + * tmpvar_16) * tmpvar_13)); + vec4 tmpvar_21; + tmpvar_21.w = 1.0; + tmpvar_21.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_1).xyz * (tmpvar_9 * + (((1.0 + ( + (tmpvar_20 - 1.0) + * + pow ((1.0001 - tmpvar_11), 5.0) + )) * (1.0 + ( + (tmpvar_20 - 1.0) + * + pow ((1.0001 - tmpvar_15), 5.0) + ))) * tmpvar_11) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_11 * (1.0 - tmpvar_17)) + + tmpvar_17) * ( + (tmpvar_15 * (1.0 - tmpvar_17)) + + tmpvar_17)))) * (pow (max (0.0, + dot (tmpvar_10, tmpvar_14) + ), tmpvar_18) * ((tmpvar_18 + 1.0) / 6.28319))) + * tmpvar_11) / 4.0)) * 3.14159) + * tmpvar_9) * (tmpvar_8.xyz + + ((1.0 - tmpvar_8.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_12, tmpvar_14)) + )), 5.0)) + ))); + gl_FragData[0] = exp2(-(tmpvar_21)); +} + diff --git a/shaders/unity/62-DeferredSpotShadows.shader_test b/shaders/unity/62-DeferredSpotShadows.shader_test new file mode 100644 index 0000000..95bef2c --- /dev/null +++ b/shaders/unity/62-DeferredSpotShadows.shader_test @@ -0,0 +1,162 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-DeferredShading +# internal variant: SHADOWS_DEPTH SHADOWS_NATIVE SHADOWS_SOFT SPOT +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + +uniform float _LightAsQuad; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_2; + vec4 tmpvar_3; + tmpvar_3 = (tmpvar_1 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = tmpvar_3.x; + tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); + o_2.xy = (tmpvar_4 + tmpvar_3.w); + o_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_2; + xlv_TEXCOORD1 = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(_LightAsQuad)); +} + +[fragment shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ZBufferParams; +uniform mat4 unity_World2Shadow[4]; +uniform vec4 _LightShadowData; +uniform vec4 unity_ShadowFadeCenterAndType; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightPos; +uniform vec4 _LightColor; +uniform mat4 _CameraToWorld; +uniform mat4 _LightMatrix0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _LightTexture0; +uniform sampler2DShadow _ShadowMapTexture; +uniform vec4 _ShadowOffsets[4]; +uniform sampler2D _CameraGBufferTexture0; +uniform sampler2D _CameraGBufferTexture1; +uniform sampler2D _CameraGBufferTexture2; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + float atten_1; + vec3 lightDir_2; + vec2 tmpvar_3; + tmpvar_3 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_3).x) + + _ZBufferParams.y)))); + vec3 tmpvar_5; + tmpvar_5 = (_CameraToWorld * tmpvar_4).xyz; + vec3 tmpvar_6; + tmpvar_6 = (tmpvar_5 - unity_ShadowFadeCenterAndType.xyz); + vec3 tmpvar_7; + tmpvar_7 = (_LightPos.xyz - tmpvar_5); + lightDir_2 = normalize(tmpvar_7); + vec4 tmpvar_8; + tmpvar_8.w = 1.0; + tmpvar_8.xyz = tmpvar_5; + vec4 tmpvar_9; + tmpvar_9 = (_LightMatrix0 * tmpvar_8); + atten_1 = ((texture2DProj (_LightTexture0, tmpvar_9).w * float( + (tmpvar_9.w < 0.0) + )) * texture2D (_LightTextureB0, vec2((dot (tmpvar_7, tmpvar_7) * _LightPos.w))).w); + vec4 tmpvar_10; + tmpvar_10.w = 1.0; + tmpvar_10.xyz = tmpvar_5; + vec4 tmpvar_11; + tmpvar_11 = (unity_World2Shadow[0] * tmpvar_10); + vec4 shadows_12; + vec3 tmpvar_13; + tmpvar_13 = (tmpvar_11.xyz / tmpvar_11.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; + float tmpvar_15; + tmpvar_15 = (atten_1 * clamp (( + dot (tmpvar_14, vec4(0.25, 0.25, 0.25, 0.25)) + + + clamp (((mix (tmpvar_4.z, + sqrt(dot (tmpvar_6, tmpvar_6)) + , unity_ShadowFadeCenterAndType.w) * _LightShadowData.z) + _LightShadowData.w), 0.0, 1.0) + ), 0.0, 1.0)); + atten_1 = tmpvar_15; + vec4 tmpvar_16; + tmpvar_16 = texture2D (_CameraGBufferTexture1, tmpvar_3); + vec3 tmpvar_17; + tmpvar_17 = (_LightColor.xyz * tmpvar_15); + vec3 tmpvar_18; + tmpvar_18 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_3).xyz * 2.0) - 1.0)); + float tmpvar_19; + tmpvar_19 = max (0.0, dot (tmpvar_18, lightDir_2)); + vec3 viewDir_20; + viewDir_20 = -(normalize((tmpvar_5 - _WorldSpaceCameraPos))); + float tmpvar_21; + tmpvar_21 = (1.0 - tmpvar_16.w); + vec3 tmpvar_22; + tmpvar_22 = normalize((lightDir_2 + viewDir_20)); + float tmpvar_23; + tmpvar_23 = max (0.0, dot (tmpvar_18, viewDir_20)); + float tmpvar_24; + tmpvar_24 = max (0.0, dot (lightDir_2, tmpvar_22)); + float tmpvar_25; + tmpvar_25 = ((tmpvar_21 * tmpvar_21) * 0.797885); + float tmpvar_26; + float tmpvar_27; + tmpvar_27 = (10.0 / log2(( + ((1.0 - tmpvar_21) * 0.968) + + 0.03))); + tmpvar_26 = (tmpvar_27 * tmpvar_27); + float tmpvar_28; + tmpvar_28 = (0.5 + (( + (2.0 * tmpvar_24) + * tmpvar_24) * tmpvar_21)); + vec4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_3).xyz * (tmpvar_17 * + (((1.0 + ( + (tmpvar_28 - 1.0) + * + pow ((1.0001 - tmpvar_19), 5.0) + )) * (1.0 + ( + (tmpvar_28 - 1.0) + * + pow ((1.0001 - tmpvar_23), 5.0) + ))) * tmpvar_19) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_19 * (1.0 - tmpvar_25)) + + tmpvar_25) * ( + (tmpvar_23 * (1.0 - tmpvar_25)) + + tmpvar_25)))) * (pow (max (0.0, + dot (tmpvar_18, tmpvar_22) + ), tmpvar_26) * ((tmpvar_26 + 1.0) / 6.28319))) + * tmpvar_19) / 4.0)) * 3.14159) + * tmpvar_17) * (tmpvar_16.xyz + + ((1.0 - tmpvar_16.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_20, tmpvar_22)) + )), 5.0)) + ))); + gl_FragData[0] = exp2(-(tmpvar_29)); +} + diff --git a/shaders/unity/64-DeferredPointShadows.shader_test b/shaders/unity/64-DeferredPointShadows.shader_test new file mode 100644 index 0000000..c4cef02 --- /dev/null +++ b/shaders/unity/64-DeferredPointShadows.shader_test @@ -0,0 +1,168 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Internal-DeferredShading +# internal variant: POINT SHADOWS_CUBE SHADOWS_SOFT +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _ProjectionParams; + + +uniform float _LightAsQuad; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec4 o_2; + vec4 tmpvar_3; + tmpvar_3 = (tmpvar_1 * 0.5); + vec2 tmpvar_4; + tmpvar_4.x = tmpvar_3.x; + tmpvar_4.y = (tmpvar_3.y * _ProjectionParams.x); + o_2.xy = (tmpvar_4 + tmpvar_3.w); + o_2.zw = tmpvar_1.zw; + gl_Position = tmpvar_1; + xlv_TEXCOORD0 = o_2; + xlv_TEXCOORD1 = mix (((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(_LightAsQuad)); +} + +[fragment shader] +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ZBufferParams; +uniform vec4 _LightPositionRange; +uniform vec4 _LightShadowData; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightPos; +uniform vec4 _LightColor; +uniform mat4 _CameraToWorld; +uniform sampler2D _LightTextureB0; +uniform samplerCube _ShadowMapTexture; +uniform sampler2D _CameraGBufferTexture0; +uniform sampler2D _CameraGBufferTexture1; +uniform sampler2D _CameraGBufferTexture2; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +void main () +{ + float atten_1; + vec3 lightDir_2; + vec2 tmpvar_3; + tmpvar_3 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w); + vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_3).x) + + _ZBufferParams.y)))); + vec3 tmpvar_5; + tmpvar_5 = (_CameraToWorld * tmpvar_4).xyz; + vec3 tmpvar_6; + tmpvar_6 = (tmpvar_5 - _LightPos.xyz); + lightDir_2 = -(normalize(tmpvar_6)); + atten_1 = texture2D (_LightTextureB0, vec2((dot (tmpvar_6, tmpvar_6) * _LightPos.w))).w; + vec4 shadowVals_7; + shadowVals_7.x = textureCube (_ShadowMapTexture, (tmpvar_6 + vec3(0.0078125, 0.0078125, 0.0078125))).x; + shadowVals_7.y = textureCube (_ShadowMapTexture, (tmpvar_6 + vec3(-0.0078125, -0.0078125, 0.0078125))).x; + shadowVals_7.z = textureCube (_ShadowMapTexture, (tmpvar_6 + vec3(-0.0078125, 0.0078125, -0.0078125))).x; + shadowVals_7.w = textureCube (_ShadowMapTexture, (tmpvar_6 + vec3(0.0078125, -0.0078125, -0.0078125))).x; + bvec4 tmpvar_8; + tmpvar_8 = lessThan (shadowVals_7, vec4((( + sqrt(dot (tmpvar_6, tmpvar_6)) + * _LightPositionRange.w) * 0.97))); + vec4 tmpvar_9; + tmpvar_9 = _LightShadowData.xxxx; + float tmpvar_10; + if (tmpvar_8.x) { + tmpvar_10 = tmpvar_9.x; + } else { + tmpvar_10 = 1.0; + }; + float tmpvar_11; + if (tmpvar_8.y) { + tmpvar_11 = tmpvar_9.y; + } else { + tmpvar_11 = 1.0; + }; + float tmpvar_12; + if (tmpvar_8.z) { + tmpvar_12 = tmpvar_9.z; + } else { + tmpvar_12 = 1.0; + }; + float tmpvar_13; + if (tmpvar_8.w) { + tmpvar_13 = tmpvar_9.w; + } else { + tmpvar_13 = 1.0; + }; + vec4 tmpvar_14; + tmpvar_14.x = tmpvar_10; + tmpvar_14.y = tmpvar_11; + tmpvar_14.z = tmpvar_12; + tmpvar_14.w = tmpvar_13; + float tmpvar_15; + tmpvar_15 = (atten_1 * dot (tmpvar_14, vec4(0.25, 0.25, 0.25, 0.25))); + atten_1 = tmpvar_15; + vec4 tmpvar_16; + tmpvar_16 = texture2D (_CameraGBufferTexture1, tmpvar_3); + vec3 tmpvar_17; + tmpvar_17 = (_LightColor.xyz * tmpvar_15); + vec3 tmpvar_18; + tmpvar_18 = normalize(((texture2D (_CameraGBufferTexture2, tmpvar_3).xyz * 2.0) - 1.0)); + float tmpvar_19; + tmpvar_19 = max (0.0, dot (tmpvar_18, lightDir_2)); + vec3 viewDir_20; + viewDir_20 = -(normalize((tmpvar_5 - _WorldSpaceCameraPos))); + float tmpvar_21; + tmpvar_21 = (1.0 - tmpvar_16.w); + vec3 tmpvar_22; + tmpvar_22 = normalize((lightDir_2 + viewDir_20)); + float tmpvar_23; + tmpvar_23 = max (0.0, dot (tmpvar_18, viewDir_20)); + float tmpvar_24; + tmpvar_24 = max (0.0, dot (lightDir_2, tmpvar_22)); + float tmpvar_25; + tmpvar_25 = ((tmpvar_21 * tmpvar_21) * 0.797885); + float tmpvar_26; + float tmpvar_27; + tmpvar_27 = (10.0 / log2(( + ((1.0 - tmpvar_21) * 0.968) + + 0.03))); + tmpvar_26 = (tmpvar_27 * tmpvar_27); + float tmpvar_28; + tmpvar_28 = (0.5 + (( + (2.0 * tmpvar_24) + * tmpvar_24) * tmpvar_21)); + vec4 tmpvar_29; + tmpvar_29.w = 1.0; + tmpvar_29.xyz = ((texture2D (_CameraGBufferTexture0, tmpvar_3).xyz * (tmpvar_17 * + (((1.0 + ( + (tmpvar_28 - 1.0) + * + pow ((1.0001 - tmpvar_19), 5.0) + )) * (1.0 + ( + (tmpvar_28 - 1.0) + * + pow ((1.0001 - tmpvar_23), 5.0) + ))) * tmpvar_19) + )) + (( + (max (0.0, (( + ((1.0/((( + (tmpvar_19 * (1.0 - tmpvar_25)) + + tmpvar_25) * ( + (tmpvar_23 * (1.0 - tmpvar_25)) + + tmpvar_25)))) * (pow (max (0.0, + dot (tmpvar_18, tmpvar_22) + ), tmpvar_26) * ((tmpvar_26 + 1.0) / 6.28319))) + * tmpvar_19) / 4.0)) * 3.14159) + * tmpvar_17) * (tmpvar_16.xyz + + ((1.0 - tmpvar_16.xyz) * pow (abs((1.0 - + max (0.0, dot (viewDir_20, tmpvar_22)) + )), 5.0)) + ))); + gl_FragData[0] = exp2(-(tmpvar_29)); +} + diff --git a/shaders/unity/68.shader_test b/shaders/unity/68.shader_test new file mode 100644 index 0000000..d0d6b0d --- /dev/null +++ b/shaders/unity/68.shader_test @@ -0,0 +1,104 @@ +# Built-in shader from Unity 5.0.0b19: +# Hidden/Dof/DepthOfFieldHdr +# internal variant: +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = gl_MultiTexCoord0.xy; + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + xlv_TEXCOORD0 = tmpvar_1; + xlv_TEXCOORD1 = tmpvar_1; +} + +[fragment shader] +uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +uniform vec4 _Offsets; +vec3 DiscKernel[28]; +varying vec2 xlv_TEXCOORD1; +void main () +{ + DiscKernel[0] = vec3(0.62463, 0.54337, 0.8279); + DiscKernel[1] = vec3(-0.13414, -0.94488, 0.95435); + DiscKernel[2] = vec3(0.38772, -0.43475, 0.58253); + DiscKernel[3] = vec3(0.12126, -0.19282, 0.22778); + DiscKernel[4] = vec3(-0.20388, 0.11133, 0.2323); + DiscKernel[5] = vec3(0.83114, -0.29218, 0.881); + DiscKernel[6] = vec3(0.10759, -0.57839, 0.58831); + DiscKernel[7] = vec3(0.28285, 0.79036, 0.83945); + DiscKernel[8] = vec3(-0.36622, 0.39516, 0.53876); + DiscKernel[9] = vec3(0.75591, 0.21916, 0.78704); + DiscKernel[10] = vec3(-0.5261, 0.02386, 0.52664); + DiscKernel[11] = vec3(-0.88216, -0.24471, 0.91547); + DiscKernel[12] = vec3(-0.48888, -0.2933, 0.57011); + DiscKernel[13] = vec3(0.44014, -0.08558, 0.44838); + DiscKernel[14] = vec3(0.21179, 0.51373, 0.55567); + DiscKernel[15] = vec3(0.05483, 0.95701, 0.95858); + DiscKernel[16] = vec3(-0.59001, -0.70509, 0.91938); + DiscKernel[17] = vec3(-0.80065, 0.24631, 0.83768); + DiscKernel[18] = vec3(-0.19424, -0.18402, 0.26757); + DiscKernel[19] = vec3(-0.43667, 0.76751, 0.88304); + DiscKernel[20] = vec3(0.21666, 0.11602, 0.24577); + DiscKernel[21] = vec3(0.15696, -0.856, 0.87027); + DiscKernel[22] = vec3(-0.75821, 0.58363, 0.95682); + DiscKernel[23] = vec3(0.99284, -0.02904, 0.99327); + DiscKernel[24] = vec3(-0.22234, -0.57907, 0.62029); + DiscKernel[25] = vec3(0.55052, -0.66984, 0.86704); + DiscKernel[26] = vec3(0.46431, 0.28115, 0.5428); + DiscKernel[27] = vec3(-0.07214, 0.60554, 0.60982); + vec2 tmpvar_1; + tmpvar_1 = xlv_TEXCOORD1; + vec4 returnValue_2; + float sampleCount_4; + vec4 poissonScale_5; + vec4 sum_6; + vec4 centerTap_7; + vec4 tmpvar_8; + tmpvar_8 = texture2D (_MainTex, xlv_TEXCOORD1); + centerTap_7 = tmpvar_8; + poissonScale_5 = ((_MainTex_TexelSize.xyxy * tmpvar_8.w) * _Offsets.w); + float tmpvar_9; + tmpvar_9 = max ((tmpvar_8.w * 0.25), _Offsets.z); + sampleCount_4 = tmpvar_9; + sum_6 = (tmpvar_8 * tmpvar_9); + for (int l_3 = 0; l_3 < 28; l_3++) { + vec4 tmpvar_10; + tmpvar_10.xy = vec2(1.2, 1.2); + tmpvar_10.zw = DiscKernel[l_3].zz; + vec4 tmpvar_11; + tmpvar_11 = (tmpvar_1.xyxy + ((DiscKernel[l_3].xyxy * poissonScale_5.xyxy) / tmpvar_10)); + vec4 tmpvar_12; + tmpvar_12 = texture2D (_MainTex, tmpvar_11.xy); + vec4 tmpvar_13; + tmpvar_13 = texture2D (_MainTex, tmpvar_11.zw); + if (((tmpvar_12.w + tmpvar_13.w) > 0.0)) { + vec2 tmpvar_14; + tmpvar_14.y = 1.0; + tmpvar_14.x = (DiscKernel[l_3].z / 1.2); + vec2 tmpvar_15; + tmpvar_15.x = tmpvar_12.w; + tmpvar_15.y = tmpvar_13.w; + vec2 tmpvar_16; + vec2 tmpvar_17; + tmpvar_17 = clamp ((( + (tmpvar_15 - (centerTap_7.ww * tmpvar_14)) + - vec2(-0.265, -0.265)) / vec2(0.265, 0.265)), 0.0, 1.0); + tmpvar_16 = (tmpvar_17 * (tmpvar_17 * (3.0 - + (2.0 * tmpvar_17) + ))); + sum_6 = (sum_6 + ((tmpvar_12 * tmpvar_16.x) + (tmpvar_13 * tmpvar_16.y))); + sampleCount_4 = (sampleCount_4 + dot (tmpvar_16, vec2(1.0, 1.0))); + }; + }; + returnValue_2.xyz = (sum_6 / sampleCount_4).xyz; + returnValue_2.w = tmpvar_8.w; + gl_FragData[0] = returnValue_2; +} + diff --git a/shaders/unity/8.shader_test b/shaders/unity/8.shader_test new file mode 100644 index 0000000..3897d26 --- /dev/null +++ b/shaders/unity/8.shader_test @@ -0,0 +1,205 @@ +# Built-in shader from Unity 5.0.0b19: +# Skybox/Procedural +# internal variant: UNITY_COLORSPACE_GAMMA +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _WorldSpaceLightPos0; + +uniform mat4 _Object2World; +uniform vec3 _SkyTint; +uniform float _AtmosphereThickness; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +void main () +{ + vec3 tmpvar_1; + vec3 tmpvar_2; + vec4 tmpvar_3; + tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); + vec3 tmpvar_4; + tmpvar_4 = (1.0/(pow (mix (vec3(0.5, 0.42, 0.325), vec3(0.8, 0.72, 0.625), + (vec3(1.0, 1.0, 1.0) - _SkyTint) + ), vec3(4.0, 4.0, 4.0)))); + float tmpvar_5; + float cse_6; + cse_6 = pow (_AtmosphereThickness, 2.5); + tmpvar_5 = (mix (0.0, 0.0025, cse_6) * 20.0); + float tmpvar_7; + tmpvar_7 = (12.5664 * mix (0.0, 0.0025, cse_6)); + mat3 tmpvar_8; + tmpvar_8[0] = _Object2World[0].xyz; + tmpvar_8[1] = _Object2World[1].xyz; + tmpvar_8[2] = _Object2World[2].xyz; + vec3 tmpvar_9; + tmpvar_9 = normalize((tmpvar_8 * gl_Vertex.xyz)); + vec3 tmpvar_10; + tmpvar_10 = -(tmpvar_9); + if ((tmpvar_9.y >= 0.0)) { + float tmpvar_11; + tmpvar_11 = (1.0 - (dot (tmpvar_9, vec3(0.0, 1.0001, 0.0)) / 1.0001)); + float tmpvar_12; + tmpvar_12 = (exp((-0.00287 + + (tmpvar_11 * (0.459 + (tmpvar_11 * (3.83 + + (tmpvar_11 * (-6.8 + (tmpvar_11 * 5.25))) + )))) + )) * 0.246032); + float tmpvar_13; + tmpvar_13 = ((sqrt( + ((1.05062 + (tmpvar_9.y * tmpvar_9.y)) - 1.0) + ) - tmpvar_9.y) / 2.0); + float tmpvar_14; + tmpvar_14 = (tmpvar_13 * 40.0); + vec3 tmpvar_15; + tmpvar_15 = (tmpvar_9 * tmpvar_13); + vec3 tmpvar_16; + tmpvar_16 = (vec3(0.0, 1.0001, 0.0) + (tmpvar_15 * 0.5)); + float tmpvar_17; + tmpvar_17 = sqrt(dot (tmpvar_16, tmpvar_16)); + float tmpvar_18; + tmpvar_18 = exp((160.0 * (1.0 - tmpvar_17))); + float tmpvar_19; + tmpvar_19 = (1.0 - (dot (_WorldSpaceLightPos0.xyz, tmpvar_16) / tmpvar_17)); + float tmpvar_20; + tmpvar_20 = (1.0 - (dot (tmpvar_9, tmpvar_16) / tmpvar_17)); + vec3 tmpvar_21; + tmpvar_21 = (tmpvar_16 + tmpvar_15); + float tmpvar_22; + tmpvar_22 = sqrt(dot (tmpvar_21, tmpvar_21)); + float tmpvar_23; + tmpvar_23 = exp((160.0 * (1.0 - tmpvar_22))); + float tmpvar_24; + tmpvar_24 = (1.0 - (dot (_WorldSpaceLightPos0.xyz, tmpvar_21) / tmpvar_22)); + float tmpvar_25; + tmpvar_25 = (1.0 - (dot (tmpvar_9, tmpvar_21) / tmpvar_22)); + vec3 tmpvar_26; + tmpvar_26 = ((exp( + (-((tmpvar_12 + (tmpvar_18 * + ((0.25 * exp((-0.00287 + + (tmpvar_19 * (0.459 + (tmpvar_19 * (3.83 + + (tmpvar_19 * (-6.8 + (tmpvar_19 * 5.25))) + )))) + ))) - (0.25 * exp((-0.00287 + + (tmpvar_20 * (0.459 + (tmpvar_20 * (3.83 + + (tmpvar_20 * (-6.8 + (tmpvar_20 * 5.25))) + )))) + )))) + ))) * ((tmpvar_4 * tmpvar_7) + 0.0125664)) + ) * (tmpvar_18 * tmpvar_14)) + (exp( + (-((tmpvar_12 + (tmpvar_23 * + ((0.25 * exp((-0.00287 + + (tmpvar_24 * (0.459 + (tmpvar_24 * (3.83 + + (tmpvar_24 * (-6.8 + (tmpvar_24 * 5.25))) + )))) + ))) - (0.25 * exp((-0.00287 + + (tmpvar_25 * (0.459 + (tmpvar_25 * (3.83 + + (tmpvar_25 * (-6.8 + (tmpvar_25 * 5.25))) + )))) + )))) + ))) * ((tmpvar_4 * tmpvar_7) + 0.0125664)) + ) * (tmpvar_23 * tmpvar_14))); + tmpvar_1 = (tmpvar_26 * (tmpvar_4 * tmpvar_5)); + tmpvar_2 = (tmpvar_26 * 0.02); + } else { + float tmpvar_27; + tmpvar_27 = (-0.0001 / min (-1e-05, tmpvar_9.y)); + vec3 tmpvar_28; + tmpvar_28 = (vec3(0.0, 1.0001, 0.0) + (tmpvar_27 * tmpvar_9)); + float tmpvar_29; + float tmpvar_30; + tmpvar_30 = (1.0 - dot (-(tmpvar_9), tmpvar_28)); + tmpvar_29 = (0.25 * exp((-0.00287 + + (tmpvar_30 * (0.459 + (tmpvar_30 * (3.83 + + (tmpvar_30 * (-6.8 + (tmpvar_30 * 5.25))) + )))) + ))); + float tmpvar_31; + tmpvar_31 = (1.0 - dot (_WorldSpaceLightPos0.xyz, tmpvar_28)); + float tmpvar_32; + tmpvar_32 = (tmpvar_27 / 2.0); + vec3 tmpvar_33; + tmpvar_33 = (vec3(0.0, 1.0001, 0.0) + ((tmpvar_9 * tmpvar_32) * 0.5)); + float tmpvar_34; + tmpvar_34 = exp((160.0 * (1.0 - + sqrt(dot (tmpvar_33, tmpvar_33)) + ))); + vec3 tmpvar_35; + tmpvar_35 = exp((( + (0.9996 * tmpvar_29) + - + (tmpvar_34 * ((0.25 * exp( + (-0.00287 + (tmpvar_31 * (0.459 + (tmpvar_31 * + (3.83 + (tmpvar_31 * (-6.8 + (tmpvar_31 * 5.25)))) + )))) + )) + tmpvar_29)) + ) * ( + (tmpvar_4 * tmpvar_7) + + 0.0125664))); + tmpvar_1 = ((tmpvar_35 * (tmpvar_34 * + (tmpvar_32 * 40.0) + )) * ((tmpvar_4 * tmpvar_5) + 0.02)); + tmpvar_2 = clamp (tmpvar_35, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0)); + }; + gl_Position = tmpvar_3; + xlv_TEXCOORD0 = tmpvar_10; + xlv_TEXCOORD1 = tmpvar_1; + xlv_TEXCOORD2 = tmpvar_2; +} + +[fragment shader] +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 _LightColor0; +uniform float _Exposure; +uniform vec3 _GroundColor; +uniform float _SunSize; +varying vec3 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +void main () +{ + vec3 col_1; + col_1 = vec3(0.0, 0.0, 0.0); + if ((xlv_TEXCOORD0.y < 0.02)) { + vec3 tmpvar_2; + tmpvar_2 = normalize(xlv_TEXCOORD0); + float tmpvar_3; + tmpvar_3 = dot (_WorldSpaceLightPos0.xyz, tmpvar_2); + float tmpvar_4; + vec3 tmpvar_5; + tmpvar_5 = (_WorldSpaceLightPos0.xyz - -(tmpvar_2)); + float tmpvar_6; + tmpvar_6 = clamp ((sqrt( + dot (tmpvar_5, tmpvar_5) + ) / _SunSize), 0.0, 1.0); + float tmpvar_7; + tmpvar_7 = (1.0 - (tmpvar_6 * (tmpvar_6 * + (3.0 - (2.0 * tmpvar_6)) + ))); + tmpvar_4 = ((8000.0 * tmpvar_7) * tmpvar_7); + vec3 tmpvar_8; + tmpvar_8 = ((0.75 + (0.75 * + (tmpvar_3 * tmpvar_3) + )) * xlv_TEXCOORD1); + col_1 = tmpvar_8; + if ((xlv_TEXCOORD0.y < 0.0)) { + col_1 = (tmpvar_8 + ((tmpvar_4 * xlv_TEXCOORD2) * _LightColor0.xyz)); + } else { + col_1 = mix (col_1, (xlv_TEXCOORD1 + ( + (_GroundColor * _GroundColor) + * xlv_TEXCOORD2)), vec3((xlv_TEXCOORD0.y / 0.02))); + }; + } else { + col_1 = (xlv_TEXCOORD1 + ((_GroundColor * _GroundColor) * xlv_TEXCOORD2)); + }; + vec3 tmpvar_9; + tmpvar_9 = sqrt((col_1 * _Exposure)); + col_1 = tmpvar_9; + vec4 tmpvar_10; + tmpvar_10.w = 1.0; + tmpvar_10.xyz = tmpvar_9; + gl_FragData[0] = tmpvar_10; +} + diff --git a/shaders/unity/99-Water.shader_test b/shaders/unity/99-Water.shader_test new file mode 100644 index 0000000..eacd204 --- /dev/null +++ b/shaders/unity/99-Water.shader_test @@ -0,0 +1,206 @@ +# Built-in shader from Unity 5.0.0b19: +# FX/Water4 +# internal variant: WATER_EDGEBLEND_ON WATER_REFLECTIVE WATER_VERTEX_DISPLACEMENT_ON +# This shader GLSL dump is put under MIT license +[require] +GLSL >= 1.10 + +[vertex shader] +uniform vec4 _Time; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; + +uniform mat4 _Object2World; +uniform float _GerstnerIntensity; +uniform vec4 _BumpTiling; +uniform vec4 _BumpDirection; +uniform vec4 _GAmplitude; +uniform vec4 _GFrequency; +uniform vec4 _GSteepness; +uniform vec4 _GSpeed; +uniform vec4 _GDirectionAB; +uniform vec4 _GDirectionCD; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec4 xlv_TEXCOORD4; +void main () +{ + vec4 tmpvar_1; + tmpvar_1.w = gl_Vertex.w; + vec4 tmpvar_2; + vec4 tmpvar_3; + vec3 tmpvar_4; + tmpvar_4 = (_Object2World * gl_Vertex).xyz; + vec3 offsets_5; + vec4 tmpvar_6; + tmpvar_6 = ((_GSteepness.xxyy * _GAmplitude.xxyy) * _GDirectionAB); + vec4 tmpvar_7; + tmpvar_7 = ((_GSteepness.zzww * _GAmplitude.zzww) * _GDirectionCD); + vec4 tmpvar_8; + tmpvar_8.x = dot (_GDirectionAB.xy, tmpvar_4.xz); + tmpvar_8.y = dot (_GDirectionAB.zw, tmpvar_4.xz); + tmpvar_8.z = dot (_GDirectionCD.xy, tmpvar_4.xz); + tmpvar_8.w = dot (_GDirectionCD.zw, tmpvar_4.xz); + vec4 tmpvar_9; + tmpvar_9 = (_GFrequency * tmpvar_8); + vec4 cse_10; + cse_10 = (_Time.yyyy * _GSpeed); + vec4 tmpvar_11; + tmpvar_11 = cos((tmpvar_9 + cse_10)); + vec4 tmpvar_12; + tmpvar_12.xy = tmpvar_6.xz; + tmpvar_12.zw = tmpvar_7.xz; + offsets_5.x = dot (tmpvar_11, tmpvar_12); + vec4 tmpvar_13; + tmpvar_13.xy = tmpvar_6.yw; + tmpvar_13.zw = tmpvar_7.yw; + offsets_5.z = dot (tmpvar_11, tmpvar_13); + offsets_5.y = dot (sin((tmpvar_9 + cse_10)), _GAmplitude); + vec2 xzVtx_14; + xzVtx_14 = (tmpvar_4.xz + offsets_5.xz); + vec3 nrml_15; + nrml_15.y = 2.0; + vec4 tmpvar_16; + tmpvar_16 = ((_GFrequency.xxyy * _GAmplitude.xxyy) * _GDirectionAB); + vec4 tmpvar_17; + tmpvar_17 = ((_GFrequency.zzww * _GAmplitude.zzww) * _GDirectionCD); + vec4 tmpvar_18; + tmpvar_18.x = dot (_GDirectionAB.xy, xzVtx_14); + tmpvar_18.y = dot (_GDirectionAB.zw, xzVtx_14); + tmpvar_18.z = dot (_GDirectionCD.xy, xzVtx_14); + tmpvar_18.w = dot (_GDirectionCD.zw, xzVtx_14); + vec4 tmpvar_19; + tmpvar_19 = cos(((_GFrequency * tmpvar_18) + cse_10)); + vec4 tmpvar_20; + tmpvar_20.xy = tmpvar_16.xz; + tmpvar_20.zw = tmpvar_17.xz; + nrml_15.x = -(dot (tmpvar_19, tmpvar_20)); + vec4 tmpvar_21; + tmpvar_21.xy = tmpvar_16.yw; + tmpvar_21.zw = tmpvar_17.yw; + nrml_15.z = -(dot (tmpvar_19, tmpvar_21)); + nrml_15.xz = (nrml_15.xz * _GerstnerIntensity); + vec3 tmpvar_22; + tmpvar_22 = normalize(nrml_15); + nrml_15 = tmpvar_22; + tmpvar_1.xyz = (gl_Vertex.xyz + offsets_5); + tmpvar_3.xyz = (tmpvar_4 - _WorldSpaceCameraPos); + vec4 tmpvar_23; + tmpvar_23 = (gl_ModelViewProjectionMatrix * tmpvar_1); + vec4 grabPassPos_24; + vec4 o_25; + vec4 tmpvar_26; + tmpvar_26 = (tmpvar_23 * 0.5); + vec2 tmpvar_27; + tmpvar_27.x = tmpvar_26.x; + tmpvar_27.y = (tmpvar_26.y * _ProjectionParams.x); + o_25.xy = (tmpvar_27 + tmpvar_26.w); + o_25.zw = tmpvar_23.zw; + grabPassPos_24.xy = ((tmpvar_23.xy + tmpvar_23.w) * 0.5); + grabPassPos_24.zw = tmpvar_23.zw; + tmpvar_2.xyz = tmpvar_22; + tmpvar_3.w = clamp (offsets_5.y, 0.0, 1.0); + tmpvar_2.w = 1.0; + gl_Position = tmpvar_23; + xlv_TEXCOORD0 = tmpvar_2; + xlv_TEXCOORD1 = tmpvar_3; + xlv_TEXCOORD2 = (((_Object2World * tmpvar_1).xzxz + (_Time.xxxx * _BumpDirection)) * _BumpTiling); + xlv_TEXCOORD3 = o_25; + xlv_TEXCOORD4 = grabPassPos_24; +} + +[fragment shader] +uniform vec4 _ZBufferParams; +uniform sampler2D _BumpMap; +uniform sampler2D _ReflectionTex; +uniform sampler2D _RefractionTex; +uniform sampler2D _ShoreTex; +uniform sampler2D _CameraDepthTexture; +uniform vec4 _SpecularColor; +uniform vec4 _BaseColor; +uniform vec4 _ReflectionColor; +uniform vec4 _InvFadeParemeter; +uniform float _Shininess; +uniform vec4 _WorldLightDir; +uniform vec4 _DistortParams; +uniform float _FresnelScale; +uniform vec4 _Foam; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec4 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec4 xlv_TEXCOORD4; +void main () +{ + vec4 baseColor_1; + vec4 edgeBlendFactors_2; + vec4 rtRefractions_3; + vec3 worldNormal_4; + vec3 normal_5; + normal_5.xy = ((texture2D (_BumpMap, xlv_TEXCOORD2.xy).wy * 2.0) - 1.0); + 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 (_BumpMap, xlv_TEXCOORD2.zw).wy * 2.0) - 1.0); + normal_6.z = sqrt((1.0 - clamp ( + dot (normal_6.xy, normal_6.xy) + , 0.0, 1.0))); + vec3 tmpvar_7; + tmpvar_7 = normalize((xlv_TEXCOORD0.xyz + ( + (((normal_5 + normal_6) * 0.5).xxy * _DistortParams.x) + * vec3(1.0, 0.0, 1.0)))); + worldNormal_4 = tmpvar_7; + vec3 tmpvar_8; + tmpvar_8 = normalize(xlv_TEXCOORD1.xyz); + vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = ((tmpvar_7.xz * _DistortParams.y) * 10.0); + vec4 tmpvar_10; + tmpvar_10 = (xlv_TEXCOORD4 + tmpvar_9); + vec4 tmpvar_11; + tmpvar_11 = texture2DProj (_RefractionTex, xlv_TEXCOORD4); + rtRefractions_3 = texture2DProj (_RefractionTex, tmpvar_10); + vec4 tmpvar_12; + tmpvar_12 = texture2DProj (_ReflectionTex, (xlv_TEXCOORD3 + tmpvar_9)); + float tmpvar_13; + tmpvar_13 = (1.0/(((_ZBufferParams.z * texture2DProj (_CameraDepthTexture, tmpvar_10).x) + _ZBufferParams.w))); + if ((tmpvar_13 < xlv_TEXCOORD3.z)) { + rtRefractions_3 = tmpvar_11; + }; + vec4 tmpvar_14; + tmpvar_14 = clamp ((_InvFadeParemeter * ( + (1.0/(((_ZBufferParams.z * texture2DProj (_CameraDepthTexture, xlv_TEXCOORD3).x) + _ZBufferParams.w))) + - xlv_TEXCOORD3.w)), 0.0, 1.0); + edgeBlendFactors_2.xzw = tmpvar_14.xzw; + edgeBlendFactors_2.y = (1.0 - tmpvar_14.y); + worldNormal_4.xz = (tmpvar_7.xz * _FresnelScale); + vec4 tmpvar_15; + tmpvar_15 = (_BaseColor - ((xlv_TEXCOORD1.w * _InvFadeParemeter.w) * vec4(0.15, 0.03, 0.01, 0.0))); + vec4 coords_16; + coords_16 = (xlv_TEXCOORD2 * 2.0); + baseColor_1.xyz = ((mix ( + mix (rtRefractions_3, tmpvar_15, tmpvar_15.wwww) + , + mix (tmpvar_12, _ReflectionColor, _ReflectionColor.wwww) + , vec4( + clamp ((_DistortParams.w + ((1.0 - _DistortParams.w) * pow ( + clamp ((1.0 - max (dot ( + -(tmpvar_8) + , worldNormal_4), 0.0)), 0.0, 1.0) + , _DistortParams.z))), 0.0, 1.0) + )) + ( + max (0.0, pow (max (0.0, dot (tmpvar_7, + -(normalize((_WorldLightDir.xyz + tmpvar_8))) + )), _Shininess)) + * _SpecularColor)).xyz + (( + ((texture2D (_ShoreTex, coords_16.xy) * texture2D (_ShoreTex, coords_16.zw)) - 0.125) + .xyz * _Foam.x) * (edgeBlendFactors_2.y + + clamp ((xlv_TEXCOORD1.w - _Foam.y), 0.0, 1.0) + ))); + baseColor_1.w = edgeBlendFactors_2.x; + gl_FragData[0] = baseColor_1; +} + |