diff options
Diffstat (limited to 'shaders/unity/38.shader_test')
-rw-r--r-- | shaders/unity/38.shader_test | 411 |
1 files changed, 411 insertions, 0 deletions
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; +} + |