Skip to content

Instantly share code, notes, and snippets.

@valyard
Last active November 22, 2017 09:00
Show Gist options
  • Save valyard/758ac3faee6be4315a84f52cd3aaeebb to your computer and use it in GitHub Desktop.
Save valyard/758ac3faee6be4315a84f52cd3aaeebb to your computer and use it in GitHub Desktop.
#version 300 es
precision highp float;
precision highp int;
uniform mediump vec4 _WorldSpaceLightPos0;
uniform mediump vec4 unity_SHAr;
uniform mediump vec4 unity_SHAg;
uniform mediump vec4 unity_SHAb;
uniform mediump vec4 unity_FogColor;
uniform mediump vec4 unity_SpecCube0_HDR;
uniform mediump vec4 _LightColor0;
uniform mediump vec4 _Color;
uniform mediump float _BumpScale;
uniform mediump float _GlossMapScale;
uniform mediump float _OcclusionStrength;
uniform lowp sampler2D _MainTex;
uniform lowp sampler2D _MetallicGlossMap;
uniform lowp sampler2D _BumpMap;
uniform lowp sampler2D _OcclusionMap;
uniform lowp samplerCube unity_SpecCube0;
in highp vec4 vs_TEXCOORD0;
in mediump vec3 vs_TEXCOORD1;
in highp float vs_TEXCOORD7;
in mediump vec4 vs_TEXCOORD2;
in mediump vec4 vs_TEXCOORD3;
in mediump vec4 vs_TEXCOORD4;
in mediump vec4 vs_TEXCOORD5;
layout(location = 0) out mediump vec4 SV_Target0;
mediump vec4 u_xlat16_0;
lowp vec4 u_xlat10_0;
mediump vec4 u_xlat16_1;
mediump vec3 u_xlat16_2;
vec3 u_xlat3;
mediump vec3 u_xlat16_3;
lowp vec3 u_xlat10_3;
mediump vec3 u_xlat16_4;
mediump vec4 u_xlat16_5;
mediump vec3 u_xlat16_6;
mediump vec3 u_xlat16_7;
mediump vec3 u_xlat16_9;
mediump float u_xlat16_11;
mediump float u_xlat16_13;
mediump float u_xlat16_14;
mediump float u_xlat16_19;
mediump float u_xlat16_25;
mediump float u_xlat16_26;
float u_xlat27;
lowp float u_xlat10_27;
mediump float u_xlat16_29;
void main()
{
//SAMPLE
u_xlat10_0.xyz = texture(_BumpMap, vs_TEXCOORD0.xy).xyz;
//MAD
u_xlat16_1.xyz = u_xlat10_0.xyz * vec3(2.0, 2.0, 2.0) + vec3(-1.0, -1.0, -1.0);
//MUL
u_xlat16_1.xy = u_xlat16_1.xy * vec2(_BumpScale);
//MUL
u_xlat16_2.xyz = u_xlat16_1.yyy * vs_TEXCOORD3.xyz;
//MAD
u_xlat16_1.xyw = vs_TEXCOORD2.xyz * u_xlat16_1.xxx + u_xlat16_2.xyz;
//MAD
u_xlat16_1.xyz = vs_TEXCOORD4.xyz * u_xlat16_1.zzz + u_xlat16_1.xyw;
//DP3
u_xlat16_25 = dot(u_xlat16_1.xyz, u_xlat16_1.xyz);
//RSQ
u_xlat16_25 = inversesqrt(u_xlat16_25);
//MUL
u_xlat16_0.xyz = vec3(u_xlat16_25) * u_xlat16_1.xyz;
//MOV
u_xlat16_0.w = 1.0;
//DP4
u_xlat16_1.x = dot(unity_SHAr, u_xlat16_0);
//DP4
u_xlat16_1.y = dot(unity_SHAg, u_xlat16_0);
//DP4
u_xlat16_1.z = dot(unity_SHAb, u_xlat16_0);
//ADD
u_xlat16_1.xyz = u_xlat16_1.xyz + vs_TEXCOORD5.xyz;
//MAX
u_xlat16_1.xyz = max(u_xlat16_1.xyz, vec3(0.0, 0.0, 0.0));
//LOG
u_xlat16_3.xyz = log2(u_xlat16_1.xyz);
//MUL
u_xlat16_3.xyz = u_xlat16_3.xyz * vec3(0.416666657, 0.416666657, 0.416666657);
//EXP
u_xlat16_3.xyz = exp2(u_xlat16_3.xyz);
//MAD
u_xlat16_3.xyz = u_xlat16_3.xyz * vec3(1.05499995, 1.05499995, 1.05499995) + vec3(-0.0549999997, -0.0549999997, -0.0549999997);
//MAX
u_xlat16_3.xyz = max(u_xlat16_3.xyz, vec3(0.0, 0.0, 0.0));
//SAMPLE
u_xlat10_27 = texture(_OcclusionMap, vs_TEXCOORD0.xy).y;
//ADD
u_xlat16_1.x = (-_OcclusionStrength) + 1.0;
//MAD
u_xlat16_1.x = u_xlat10_27 * _OcclusionStrength + u_xlat16_1.x;
//MUL
u_xlat16_9.xyz = u_xlat16_1.xxx * u_xlat16_3.xyz;
//SAMPLE
u_xlat10_3.xyz = texture(_MainTex, vs_TEXCOORD0.xy).xyz;
//MUL
u_xlat16_4.xyz = u_xlat10_3.xyz * _Color.xyz;
//MAD
u_xlat16_2.xyz = _Color.xyz * u_xlat10_3.xyz + vec3(-0.220916301, -0.220916301, -0.220916301);
//SAMPLE
u_xlat10_3.xy = texture(_MetallicGlossMap, vs_TEXCOORD0.xy).xw;
//MAD
u_xlat16_26 = (-u_xlat10_3.x) * 0.779083729 + 0.779083729;
//MUL
u_xlat16_5.xyz = vec3(u_xlat16_26) * u_xlat16_4.xyz;
//MAD
u_xlat16_26 = u_xlat10_3.y * _GlossMapScale + (-u_xlat16_26);
//ADD
u_xlat16_26 = u_xlat16_26 + 1.0;
#ifdef UNITY_ADRENO_ES3
u_xlat16_26 = min(max(u_xlat16_26, 0.0), 1.0);
#else
u_xlat16_26 = clamp(u_xlat16_26, 0.0, 1.0);
#endif
//MUL
u_xlat16_9.xyz = u_xlat16_9.xyz * u_xlat16_5.xyz;
//DP3
u_xlat16_29 = dot(vs_TEXCOORD1.xyz, vs_TEXCOORD1.xyz);
//RSQ
u_xlat16_29 = inversesqrt(u_xlat16_29);
//MAD
u_xlat16_6.xyz = (-vs_TEXCOORD1.xyz) * vec3(u_xlat16_29) + _WorldSpaceLightPos0.xyz;
//MUL
u_xlat16_7.xyz = vec3(u_xlat16_29) * vs_TEXCOORD1.xyz;
//DP3
u_xlat16_29 = dot(u_xlat16_6.xyz, u_xlat16_6.xyz);
//MAX
u_xlat16_19 = max(u_xlat16_29, 0.00100000005);
//RSQ
u_xlat16_29 = inversesqrt(u_xlat16_19);
//MUL
u_xlat16_6.xyz = vec3(u_xlat16_29) * u_xlat16_6.xyz;
//DP3
u_xlat16_29 = dot(u_xlat16_0.xyz, u_xlat16_6.xyz);
#ifdef UNITY_ADRENO_ES3
u_xlat16_29 = min(max(u_xlat16_29, 0.0), 1.0);
#else
u_xlat16_29 = clamp(u_xlat16_29, 0.0, 1.0);
#endif
//DP3
u_xlat16_6.x = dot(_WorldSpaceLightPos0.xyz, u_xlat16_6.xyz);
#ifdef UNITY_ADRENO_ES3
u_xlat16_6.x = min(max(u_xlat16_6.x, 0.0), 1.0);
#else
u_xlat16_6.x = clamp(u_xlat16_6.x, 0.0, 1.0);
#endif
//MAX
u_xlat16_19 = max(u_xlat16_6.x, 0.319999993);
//MUL
u_xlat16_29 = u_xlat16_29 * u_xlat16_29;
//MAD
u_xlat16_6.x = (-u_xlat10_3.y) * _GlossMapScale + 1.0;
//MAD
u_xlat16_2.xyz = u_xlat10_3.xxx * u_xlat16_2.xyz + vec3(0.220916301, 0.220916301, 0.220916301);
//MUL
u_xlat16_14 = u_xlat16_6.x * u_xlat16_6.x;
//MAD
u_xlat16_3.x = u_xlat16_14 * u_xlat16_14 + -1.0;
//MAD
u_xlat16_3.x = u_xlat16_29 * u_xlat16_3.x + 1.00001001;
//MAD
u_xlat16_11 = u_xlat16_6.x * u_xlat16_6.x + 1.5;
//MUL
u_xlat16_11 = u_xlat16_11 * u_xlat16_19;
//MUL
u_xlat16_3.x = u_xlat16_3.x * u_xlat16_11;
//DIV
u_xlat16_3.x = u_xlat16_14 / u_xlat16_3.x;
//MUL
u_xlat16_29 = u_xlat16_6.x * u_xlat16_14;
//MAD
u_xlat16_29 = (-u_xlat16_29) * 0.280000001 + 1.0;
//ADD
u_xlat16_3.x = u_xlat16_3.x + -9.99999975e-05;
//MAX
u_xlat16_14 = max(u_xlat16_3.x, 0.0);
//MIN
u_xlat16_14 = min(u_xlat16_14, 100.0);
//MAD
u_xlat16_5.xyz = vec3(u_xlat16_14) * u_xlat16_2.xyz + u_xlat16_5.xyz;
//MUL
u_xlat16_5.xyz = u_xlat16_5.xyz * _LightColor0.xyz;
//DP3
u_xlat16_14 = dot(u_xlat16_0.xyz, _WorldSpaceLightPos0.xyz);
#ifdef UNITY_ADRENO_ES3
u_xlat16_14 = min(max(u_xlat16_14, 0.0), 1.0);
#else
u_xlat16_14 = clamp(u_xlat16_14, 0.0, 1.0);
#endif
//MAD
u_xlat16_9.xyz = u_xlat16_5.xyz * vec3(u_xlat16_14) + u_xlat16_9.xyz;
//MAD
u_xlat16_5.x = (-u_xlat16_6.x) * 0.699999988 + 1.70000005;
//MUL
u_xlat16_5.x = u_xlat16_5.x * u_xlat16_6.x;
//MUL
u_xlat16_5.x = u_xlat16_5.x * 6.0;
//DP3
u_xlat16_13 = dot(u_xlat16_7.xyz, u_xlat16_0.xyz);
//ADD
u_xlat16_13 = u_xlat16_13 + u_xlat16_13;
//MAD
u_xlat16_6.xyz = u_xlat16_0.xyz * (-vec3(u_xlat16_13)) + u_xlat16_7.xyz;
//DP3
u_xlat16_13 = dot(u_xlat16_0.xyz, (-u_xlat16_7.xyz));
#ifdef UNITY_ADRENO_ES3
u_xlat16_13 = min(max(u_xlat16_13, 0.0), 1.0);
#else
u_xlat16_13 = clamp(u_xlat16_13, 0.0, 1.0);
#endif
//ADD
u_xlat16_13 = (-u_xlat16_13) + 1.0;
//MUL
u_xlat16_13 = u_xlat16_13 * u_xlat16_13;
//MUL
u_xlat16_13 = u_xlat16_13 * u_xlat16_13;
//SAMPLE_L
u_xlat10_0 = textureLod(unity_SpecCube0, u_xlat16_6.xyz, u_xlat16_5.x);
//ADD
u_xlat16_5.x = u_xlat10_0.w + -1.0;
//MAD
u_xlat16_5.x = unity_SpecCube0_HDR.w * u_xlat16_5.x + 1.0;
//MUL
u_xlat16_5.x = u_xlat16_5.x * unity_SpecCube0_HDR.x;
//MUL
u_xlat16_6.xyz = u_xlat10_0.xyz * u_xlat16_5.xxx;
//MUL
u_xlat16_6.xyz = u_xlat16_1.xxx * u_xlat16_6.xyz;
//MUL
u_xlat16_5.xzw = vec3(u_xlat16_29) * u_xlat16_6.xyz;
//ADD
u_xlat16_6.xyz = (-u_xlat16_2.xyz) + vec3(u_xlat16_26);
//MAD
u_xlat16_2.xyz = vec3(u_xlat16_13) * u_xlat16_6.xyz + u_xlat16_2.xyz;
//MAD
u_xlat16_1.xyz = u_xlat16_5.xzw * u_xlat16_2.xyz + u_xlat16_9.xyz;
//ADD
u_xlat16_3.xyz = u_xlat16_1.xyz + (-unity_FogColor.xyz);
//MOV
u_xlat27 = vs_TEXCOORD7;
#ifdef UNITY_ADRENO_ES3
u_xlat27 = min(max(u_xlat27, 0.0), 1.0);
#else
u_xlat27 = clamp(u_xlat27, 0.0, 1.0);
#endif
//MAD
u_xlat3.xyz = vec3(u_xlat27) * u_xlat16_3.xyz + unity_FogColor.xyz;
//MOV
SV_Target0.xyz = u_xlat3.xyz;
//MOV
SV_Target0.w = 1.0;
//RET
return;
}
#version 300 es
uniform vec3 _WorldSpaceCameraPos;
uniform mediump vec4 unity_SHBr;
uniform mediump vec4 unity_SHBg;
uniform mediump vec4 unity_SHBb;
uniform mediump vec4 unity_SHC;
uniform vec4 hlslcc_mtx4x4unity_ObjectToWorld[4];
uniform vec4 hlslcc_mtx4x4unity_WorldToObject[4];
uniform vec4 unity_WorldTransformParams;
uniform vec4 hlslcc_mtx4x4unity_MatrixVP[4];
uniform vec4 unity_FogParams;
uniform vec4 _MainTex_ST;
uniform vec4 _DetailAlbedoMap_ST;
uniform mediump float _UVSec;
in highp vec4 in_POSITION0;
in mediump vec3 in_NORMAL0;
in highp vec2 in_TEXCOORD0;
in highp vec2 in_TEXCOORD1;
in mediump vec4 in_TANGENT0;
out highp vec4 vs_TEXCOORD0;
out mediump vec3 vs_TEXCOORD1;
out highp float vs_TEXCOORD7;
out mediump vec4 vs_TEXCOORD2;
out mediump vec4 vs_TEXCOORD3;
out mediump vec4 vs_TEXCOORD4;
out mediump vec4 vs_TEXCOORD5;
out highp vec3 vs_TEXCOORD8;
vec4 u_xlat0;
mediump vec4 u_xlat16_0;
bool u_xlatb0;
vec4 u_xlat1;
mediump vec3 u_xlat16_2;
mediump vec3 u_xlat16_3;
float u_xlat12;
void main()
{
//MUL
u_xlat0 = in_POSITION0.yyyy * hlslcc_mtx4x4unity_ObjectToWorld[1];
//MAD
u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0] * in_POSITION0.xxxx + u_xlat0;
//MAD
u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[2] * in_POSITION0.zzzz + u_xlat0;
//ADD
u_xlat0 = u_xlat0 + hlslcc_mtx4x4unity_ObjectToWorld[3];
//MUL
u_xlat1 = u_xlat0.yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
//MAD
u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[0] * u_xlat0.xxxx + u_xlat1;
//MAD
u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[2] * u_xlat0.zzzz + u_xlat1;
//MAD
u_xlat0 = hlslcc_mtx4x4unity_MatrixVP[3] * u_xlat0.wwww + u_xlat1;
//MOV
gl_Position = u_xlat0;
//MUL
u_xlat0.x = u_xlat0.z * unity_FogParams.x;
//MUL
u_xlat0.x = u_xlat0.x * (-u_xlat0.x);
//EXP
vs_TEXCOORD7 = exp2(u_xlat0.x);
//EQ
#ifdef UNITY_ADRENO_ES3
u_xlatb0 = !!(_UVSec==0.0);
#else
u_xlatb0 = _UVSec==0.0;
#endif
//MOVC
u_xlat0.xy = (bool(u_xlatb0)) ? in_TEXCOORD0.xy : in_TEXCOORD1.xy;
//MAD
vs_TEXCOORD0.zw = u_xlat0.xy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw;
//MAD
vs_TEXCOORD0.xy = in_TEXCOORD0.xy * _MainTex_ST.xy + _MainTex_ST.zw;
//MUL
u_xlat0.xyz = in_POSITION0.yyy * hlslcc_mtx4x4unity_ObjectToWorld[1].xyz;
//MAD
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[0].xyz * in_POSITION0.xxx + u_xlat0.xyz;
//MAD
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[2].xyz * in_POSITION0.zzz + u_xlat0.xyz;
//MAD
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[3].xyz * in_POSITION0.www + u_xlat0.xyz;
//ADD
u_xlat1.xyz = u_xlat0.xyz + (-_WorldSpaceCameraPos.xyz);
//MOV
vs_TEXCOORD8.xyz = u_xlat0.xyz;
//MOV
vs_TEXCOORD1.xyz = u_xlat1.xyz;
//MUL
u_xlat0.xyz = in_TANGENT0.yyy * hlslcc_mtx4x4unity_ObjectToWorld[1].xyz;
//MAD
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[0].xyz * in_TANGENT0.xxx + u_xlat0.xyz;
//MAD
u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[2].xyz * in_TANGENT0.zzz + u_xlat0.xyz;
//DP3
u_xlat12 = dot(u_xlat0.xyz, u_xlat0.xyz);
//RSQ
u_xlat12 = inversesqrt(u_xlat12);
//MUL
u_xlat0.xyz = vec3(u_xlat12) * u_xlat0.xyz;
//MOV
vs_TEXCOORD2.xyz = u_xlat0.xyz;
//MOV
vs_TEXCOORD2.w = 0.0;
//DP3
u_xlat1.x = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[0].xyz);
//DP3
u_xlat1.y = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[1].xyz);
//DP3
u_xlat1.z = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[2].xyz);
//DP3
u_xlat12 = dot(u_xlat1.xyz, u_xlat1.xyz);
//RSQ
u_xlat12 = inversesqrt(u_xlat12);
//MUL
u_xlat1.xyz = vec3(u_xlat12) * u_xlat1.xyz;
//MUL
u_xlat16_2.xyz = u_xlat0.yzx * u_xlat1.zxy;
//MAD
u_xlat16_2.xyz = u_xlat1.yzx * u_xlat0.zxy + (-u_xlat16_2.xyz);
//MUL
u_xlat0.x = in_TANGENT0.w * unity_WorldTransformParams.w;
//MUL
vs_TEXCOORD3.xyz = u_xlat0.xxx * u_xlat16_2.xyz;
//MOV
vs_TEXCOORD3.w = 0.0;
//MOV
vs_TEXCOORD4.xyz = u_xlat1.xyz;
//MOV
vs_TEXCOORD4.w = 0.0;
//MUL
u_xlat16_2.x = u_xlat1.y * u_xlat1.y;
//MAD
u_xlat16_2.x = u_xlat1.x * u_xlat1.x + (-u_xlat16_2.x);
//MUL
u_xlat16_0 = u_xlat1.yzzx * u_xlat1.xyzz;
//DP4
u_xlat16_3.x = dot(unity_SHBr, u_xlat16_0);
//DP4
u_xlat16_3.y = dot(unity_SHBg, u_xlat16_0);
//DP4
u_xlat16_3.z = dot(unity_SHBb, u_xlat16_0);
//MAD
vs_TEXCOORD5.xyz = unity_SHC.xyz * u_xlat16_2.xxx + u_xlat16_3.xyz;
//MOV
vs_TEXCOORD5.w = 0.0;
//RET
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment