mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
97 lines
3.2 KiB
Text
97 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;
|
||
|
vec3 x1;
|
||
|
x1.x = dot (unity_SHAr, tmpvar_6);
|
||
|
x1.y = dot (unity_SHAg, tmpvar_6);
|
||
|
x1.z = dot (unity_SHAb, tmpvar_6);
|
||
|
vec4 tmpvar_7;
|
||
|
tmpvar_7 = (tmpvar_5.xyzz * tmpvar_5.yzzx);
|
||
|
x2.x = dot (unity_SHBr, tmpvar_7);
|
||
|
x2.y = dot (unity_SHBg, tmpvar_7);
|
||
|
x2.z = dot (unity_SHBb, tmpvar_7);
|
||
|
vec3 tmpvar_8;
|
||
|
tmpvar_8 = (_Object2World * gl_Vertex).xyz;
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = (unity_4LightPosX0 - tmpvar_8.x);
|
||
|
vec4 tmpvar_10;
|
||
|
tmpvar_10 = (unity_4LightPosY0 - tmpvar_8.y);
|
||
|
vec4 tmpvar_11;
|
||
|
tmpvar_11 = (unity_4LightPosZ0 - tmpvar_8.z);
|
||
|
vec4 tmpvar_12;
|
||
|
tmpvar_12 = (((tmpvar_9 * tmpvar_9) + (tmpvar_10 * tmpvar_10)) + (tmpvar_11 * tmpvar_11));
|
||
|
vec4 tmpvar_13;
|
||
|
tmpvar_13 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_9 * tmpvar_5.x) + (tmpvar_10 * tmpvar_5.y)) + (tmpvar_11 * tmpvar_5.z)) * inversesqrt (tmpvar_12))) * (1.0/((1.0 + (tmpvar_12 * unity_4LightAtten0)))));
|
||
|
vec4 o_i0;
|
||
|
vec4 tmpvar_14;
|
||
|
tmpvar_14 = (tmpvar_3 * 0.5);
|
||
|
o_i0 = tmpvar_14;
|
||
|
vec2 tmpvar_15;
|
||
|
tmpvar_15.x = tmpvar_14.x;
|
||
|
tmpvar_15.y = (tmpvar_14.y * _ProjectionParams.x);
|
||
|
o_i0.xy = (tmpvar_15 + tmpvar_14.w);
|
||
|
o_i0.zw = tmpvar_3.zw;
|
||
|
gl_Position = tmpvar_3;
|
||
|
vec4 tmpvar_16;
|
||
|
tmpvar_16.yzw = vec3(0.0, 0.0, 0.0);
|
||
|
tmpvar_16.x = tmpvar_3.z;
|
||
|
xlv_FOG = tmpvar_16;
|
||
|
gl_TexCoord[0] = tmpvar_1;
|
||
|
gl_TexCoord[1] = tmpvar_2;
|
||
|
vec4 tmpvar_17;
|
||
|
tmpvar_17.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_17.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
|
||
|
gl_TexCoord[2] = tmpvar_17;
|
||
|
vec4 tmpvar_18;
|
||
|
tmpvar_18.w = 0.0;
|
||
|
tmpvar_18.xyz = tmpvar_5;
|
||
|
gl_TexCoord[3] = tmpvar_18;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19.w = 0.0;
|
||
|
tmpvar_19.xyz = (((x1 + x2) + (unity_SHC.xyz * ((tmpvar_5.x * tmpvar_5.x) - (tmpvar_5.y * tmpvar_5.y)))) + ((((unity_LightColor0 * tmpvar_13.x) + (unity_LightColor1 * tmpvar_13.y)) + (unity_LightColor2 * tmpvar_13.z)) + (unity_LightColor3 * tmpvar_13.w)));
|
||
|
gl_TexCoord[4] = tmpvar_19;
|
||
|
gl_TexCoord[5] = o_i0;
|
||
|
}
|
||
|
|