mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
107 lines
3.6 KiB
Text
107 lines
3.6 KiB
Text
varying vec4 xlv_FOG;
|
|
attribute vec4 TANGENT;
|
|
uniform vec4 unity_Scale;
|
|
uniform vec4 unity_SHC;
|
|
uniform vec4 unity_SHBr;
|
|
uniform vec4 unity_SHBg;
|
|
uniform vec4 unity_SHBb;
|
|
uniform vec4 unity_SHAr;
|
|
uniform vec4 unity_SHAg;
|
|
uniform vec4 unity_SHAb;
|
|
uniform vec3 unity_LightColor3;
|
|
uniform vec3 unity_LightColor2;
|
|
uniform vec3 unity_LightColor1;
|
|
uniform vec3 unity_LightColor0;
|
|
uniform vec4 unity_4LightPosZ0;
|
|
uniform vec4 unity_4LightPosY0;
|
|
uniform vec4 unity_4LightPosX0;
|
|
uniform vec4 unity_4LightAtten0;
|
|
uniform vec4 _WorldSpaceLightPos0;
|
|
uniform vec3 _WorldSpaceCameraPos;
|
|
uniform mat4 _World2Object;
|
|
uniform vec4 _ProjectionParams;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _MainTex_ST;
|
|
uniform vec4 _BumpMap_ST;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
|
|
tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
|
|
mat3 tmpvar_3;
|
|
tmpvar_3[0] = _Object2World[0].xyz;
|
|
tmpvar_3[1] = _Object2World[1].xyz;
|
|
tmpvar_3[2] = _Object2World[2].xyz;
|
|
vec3 tmpvar_4;
|
|
tmpvar_4 = (tmpvar_3 * (gl_Normal * unity_Scale.w));
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
|
|
mat3 tmpvar_6;
|
|
tmpvar_6[0].x = TANGENT.x;
|
|
tmpvar_6[0].y = tmpvar_5.x;
|
|
tmpvar_6[0].z = gl_Normal.x;
|
|
tmpvar_6[1].x = TANGENT.y;
|
|
tmpvar_6[1].y = tmpvar_5.y;
|
|
tmpvar_6[1].z = gl_Normal.y;
|
|
tmpvar_6[2].x = TANGENT.z;
|
|
tmpvar_6[2].y = tmpvar_5.z;
|
|
tmpvar_6[2].z = gl_Normal.z;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.w = 1.0;
|
|
tmpvar_7.xyz = _WorldSpaceCameraPos;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8.w = 1.0;
|
|
tmpvar_8.xyz = tmpvar_4;
|
|
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_4.xyzz * tmpvar_4.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);
|
|
vec3 tmpvar_12;
|
|
tmpvar_12 = (_Object2World * gl_Vertex).xyz;
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = (unity_4LightPosX0 - tmpvar_12.x);
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = (unity_4LightPosY0 - tmpvar_12.y);
|
|
vec4 tmpvar_15;
|
|
tmpvar_15 = (unity_4LightPosZ0 - tmpvar_12.z);
|
|
vec4 tmpvar_16;
|
|
tmpvar_16 = (((tmpvar_13 * tmpvar_13) + (tmpvar_14 * tmpvar_14)) + (tmpvar_15 * tmpvar_15));
|
|
vec4 tmpvar_17;
|
|
tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) * inversesqrt(tmpvar_16))) * (1.0/((1.0 + (tmpvar_16 * unity_4LightAtten0)))));
|
|
vec4 o_18;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19 = (tmpvar_2 * 0.5);
|
|
vec2 tmpvar_20;
|
|
tmpvar_20.x = tmpvar_19.x;
|
|
tmpvar_20.y = (tmpvar_19.y * _ProjectionParams.x);
|
|
o_18.xy = (tmpvar_20 + tmpvar_19.w);
|
|
o_18.zw = tmpvar_2.zw;
|
|
gl_Position = tmpvar_2;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_21.x = tmpvar_2.z;
|
|
xlv_FOG = tmpvar_21;
|
|
gl_TexCoord[0] = tmpvar_1;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.w = 0.0;
|
|
tmpvar_22.xyz = (tmpvar_6 * (((_World2Object * tmpvar_7).xyz * unity_Scale.w) - gl_Vertex.xyz));
|
|
gl_TexCoord[1] = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23.w = 0.0;
|
|
tmpvar_23.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz);
|
|
gl_TexCoord[2] = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24.w = 0.0;
|
|
tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)))) + ((((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) + (unity_LightColor2 * tmpvar_17.z)) + (unity_LightColor3 * tmpvar_17.w)));
|
|
gl_TexCoord[3] = tmpvar_24;
|
|
gl_TexCoord[4] = o_18;
|
|
}
|
|
|