mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
143 lines
4.8 KiB
Text
143 lines
4.8 KiB
Text
uniform vec4 _Control_ST;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _ProjectionParams;
|
|
uniform vec4 _Splat0_ST;
|
|
uniform vec4 _Splat1_ST;
|
|
uniform vec4 _Splat2_ST;
|
|
uniform vec4 _Splat3_ST;
|
|
uniform vec4 unity_4LightAtten0;
|
|
uniform vec4 unity_4LightPosX0;
|
|
uniform vec4 unity_4LightPosY0;
|
|
uniform vec4 unity_4LightPosZ0;
|
|
uniform vec3 unity_LightColor0;
|
|
uniform vec3 unity_LightColor1;
|
|
uniform vec3 unity_LightColor2;
|
|
uniform vec3 unity_LightColor3;
|
|
uniform vec4 unity_SHAb;
|
|
uniform vec4 unity_SHAg;
|
|
uniform vec4 unity_SHAr;
|
|
uniform vec4 unity_SHBb;
|
|
uniform vec4 unity_SHBg;
|
|
uniform vec4 unity_SHBr;
|
|
uniform vec4 unity_SHC;
|
|
uniform vec4 unity_Scale;
|
|
varying vec4 xlv_FOG;
|
|
void main ()
|
|
{
|
|
vec3 worldPos_1;
|
|
vec3 worldN_2;
|
|
vec4 tmpvar_3;
|
|
vec4 tmpvar_4;
|
|
vec4 pos_5;
|
|
pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex);
|
|
tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw);
|
|
tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw);
|
|
tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw);
|
|
tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw);
|
|
mat3 tmpvar_6;
|
|
tmpvar_6[0] = _Object2World[0].xyz;
|
|
tmpvar_6[1] = _Object2World[1].xyz;
|
|
tmpvar_6[2] = _Object2World[2].xyz;
|
|
worldN_2 = (tmpvar_6 * (gl_Normal * unity_Scale.w));
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.w = 1.0;
|
|
tmpvar_7.xyz = worldN_2;
|
|
vec3 x2_8;
|
|
vec4 vB_9;
|
|
vec3 x1_10;
|
|
x1_10.x = dot (unity_SHAr, tmpvar_7);
|
|
x1_10.y = dot (unity_SHAg, tmpvar_7);
|
|
x1_10.z = dot (unity_SHAb, tmpvar_7);
|
|
vB_9 = (worldN_2.xyzz * worldN_2.yzzx);
|
|
x2_8.x = dot (unity_SHBr, vB_9);
|
|
x2_8.y = dot (unity_SHBg, vB_9);
|
|
x2_8.z = dot (unity_SHBb, vB_9);
|
|
worldPos_1 = (_Object2World * gl_Vertex).xyz;
|
|
vec3 col_11;
|
|
vec4 diff_12;
|
|
vec4 ndotl_13;
|
|
vec4 lengthSq_14;
|
|
vec4 toLightZ_15;
|
|
vec4 toLightY_16;
|
|
vec4 toLightX_17;
|
|
toLightX_17 = (unity_4LightPosX0 - worldPos_1.x);
|
|
toLightY_16 = (unity_4LightPosY0 - worldPos_1.y);
|
|
toLightZ_15 = (unity_4LightPosZ0 - worldPos_1.z);
|
|
lengthSq_14 = (toLightX_17 * toLightX_17);
|
|
lengthSq_14 = (lengthSq_14 + (toLightY_16 * toLightY_16));
|
|
lengthSq_14 = (lengthSq_14 + (toLightZ_15 * toLightZ_15));
|
|
ndotl_13 = (toLightX_17 * worldN_2.x);
|
|
ndotl_13 = (ndotl_13 + (toLightY_16 * worldN_2.y));
|
|
ndotl_13 = (ndotl_13 + (toLightZ_15 * worldN_2.z));
|
|
vec4 tmpvar_18;
|
|
tmpvar_18 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_13 * inversesqrt(lengthSq_14)));
|
|
ndotl_13 = tmpvar_18;
|
|
diff_12 = (tmpvar_18 * (1.0/((1.0 +
|
|
(lengthSq_14 * unity_4LightAtten0)
|
|
))));
|
|
col_11 = (unity_LightColor0 * diff_12.x);
|
|
col_11 = (col_11 + (unity_LightColor1 * diff_12.y));
|
|
col_11 = (col_11 + (unity_LightColor2 * diff_12.z));
|
|
col_11 = (col_11 + (unity_LightColor3 * diff_12.w));
|
|
vec4 o_19;
|
|
o_19 = (pos_5 * 0.5);
|
|
vec2 tmpvar_20;
|
|
tmpvar_20.x = o_19.x;
|
|
tmpvar_20.y = (o_19.y * _ProjectionParams.x);
|
|
o_19.xy = (tmpvar_20 + o_19.w);
|
|
o_19.zw = pos_5.zw;
|
|
gl_Position = pos_5;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_21.x = pos_5.z;
|
|
xlv_FOG = tmpvar_21;
|
|
gl_TexCoord[0] = tmpvar_3;
|
|
gl_TexCoord[1] = tmpvar_4;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.zw = vec2(0.0, 0.0);
|
|
tmpvar_22.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
|
|
gl_TexCoord[2] = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23.w = 0.0;
|
|
tmpvar_23.xyz = worldN_2;
|
|
gl_TexCoord[3] = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24.w = 0.0;
|
|
tmpvar_24.xyz = (((x1_10 + x2_8) + (unity_SHC.xyz *
|
|
((worldN_2.x * worldN_2.x) - (worldN_2.y * worldN_2.y))
|
|
)) + col_11);
|
|
gl_TexCoord[4] = tmpvar_24;
|
|
gl_TexCoord[5] = o_19;
|
|
}
|
|
|
|
|
|
// stats: 63 alu 0 tex 0 flow
|
|
// inputs: 3
|
|
// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #1: gl_Normal (high float) 3x1 [-1] loc 2
|
|
// #2: gl_Vertex (high float) 4x1 [-1] loc 0
|
|
// uniforms: 24 (total size: 0)
|
|
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #1: _Control_ST (high float) 4x1 [-1]
|
|
// #2: _Object2World (high float) 4x4 [-1]
|
|
// #3: _ProjectionParams (high float) 4x1 [-1]
|
|
// #4: _Splat0_ST (high float) 4x1 [-1]
|
|
// #5: _Splat1_ST (high float) 4x1 [-1]
|
|
// #6: _Splat2_ST (high float) 4x1 [-1]
|
|
// #7: _Splat3_ST (high float) 4x1 [-1]
|
|
// #8: unity_4LightAtten0 (high float) 4x1 [-1]
|
|
// #9: unity_4LightPosX0 (high float) 4x1 [-1]
|
|
// #10: unity_4LightPosY0 (high float) 4x1 [-1]
|
|
// #11: unity_4LightPosZ0 (high float) 4x1 [-1]
|
|
// #12: unity_LightColor0 (high float) 3x1 [-1]
|
|
// #13: unity_LightColor1 (high float) 3x1 [-1]
|
|
// #14: unity_LightColor2 (high float) 3x1 [-1]
|
|
// #15: unity_LightColor3 (high float) 3x1 [-1]
|
|
// #16: unity_SHAb (high float) 4x1 [-1]
|
|
// #17: unity_SHAg (high float) 4x1 [-1]
|
|
// #18: unity_SHAr (high float) 4x1 [-1]
|
|
// #19: unity_SHBb (high float) 4x1 [-1]
|
|
// #20: unity_SHBg (high float) 4x1 [-1]
|
|
// #21: unity_SHBr (high float) 4x1 [-1]
|
|
// #22: unity_SHC (high float) 4x1 [-1]
|
|
// #23: unity_Scale (high float) 4x1 [-1]
|