mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
95 lines
3.2 KiB
Text
95 lines
3.2 KiB
Text
varying vec4 xlv_FOG;
|
|
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 _Splat3_ST;
|
|
uniform vec4 _Splat2_ST;
|
|
uniform vec4 _Splat1_ST;
|
|
uniform vec4 _Splat0_ST;
|
|
uniform vec4 _ProjectionParams;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _Control_ST;
|
|
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);
|
|
mat3 tmpvar_4;
|
|
tmpvar_4[0] = _Object2World[0].xyz;
|
|
tmpvar_4[1] = _Object2World[1].xyz;
|
|
tmpvar_4[2] = _Object2World[2].xyz;
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = (tmpvar_4 * (gl_Normal * unity_Scale.w));
|
|
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);
|
|
vec3 tmpvar_10;
|
|
tmpvar_10 = (_Object2World * gl_Vertex).xyz;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = (unity_4LightPosX0 - tmpvar_10.x);
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = (unity_4LightPosY0 - tmpvar_10.y);
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = (unity_4LightPosZ0 - tmpvar_10.z);
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = (((tmpvar_11 * tmpvar_11) + (tmpvar_12 * tmpvar_12)) + (tmpvar_13 * tmpvar_13));
|
|
vec4 tmpvar_15;
|
|
tmpvar_15 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_11 * tmpvar_5.x) + (tmpvar_12 * tmpvar_5.y)) + (tmpvar_13 * tmpvar_5.z)) * inversesqrt(tmpvar_14))) * (1.0/((1.0 + (tmpvar_14 * unity_4LightAtten0)))));
|
|
vec4 o_16;
|
|
vec4 tmpvar_17;
|
|
tmpvar_17 = (tmpvar_3 * 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_3.zw;
|
|
gl_Position = tmpvar_3;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_19.x = tmpvar_3.z;
|
|
xlv_FOG = tmpvar_19;
|
|
gl_TexCoord[0] = tmpvar_1;
|
|
gl_TexCoord[1] = tmpvar_2;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.zw = vec2(0.0, 0.0);
|
|
tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
|
|
gl_TexCoord[2] = tmpvar_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.w = 0.0;
|
|
tmpvar_21.xyz = tmpvar_5;
|
|
gl_TexCoord[3] = tmpvar_21;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.w = 0.0;
|
|
tmpvar_22.xyz = (((x1_8 + x2_7) + (unity_SHC.xyz * ((tmpvar_5.x * tmpvar_5.x) - (tmpvar_5.y * tmpvar_5.y)))) + ((((unity_LightColor0 * tmpvar_15.x) + (unity_LightColor1 * tmpvar_15.y)) + (unity_LightColor2 * tmpvar_15.z)) + (unity_LightColor3 * tmpvar_15.w)));
|
|
gl_TexCoord[4] = tmpvar_22;
|
|
gl_TexCoord[5] = o_16;
|
|
}
|
|
|