mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
78 lines
2 KiB
Text
78 lines
2 KiB
Text
|
#version 300 es
|
||
|
in vec4 _glesVertex;
|
||
|
in vec3 _glesNormal;
|
||
|
uniform mediump vec4 unity_LightColor[8];
|
||
|
uniform highp vec4 unity_LightPosition[8];
|
||
|
uniform highp ivec4 unity_VertexLightParams;
|
||
|
out lowp vec4 xlv_COLOR0;
|
||
|
void main ()
|
||
|
{
|
||
|
highp vec3 tmpvar_1;
|
||
|
highp vec3 tmpvar_2;
|
||
|
tmpvar_1 = _glesVertex.xyz;
|
||
|
tmpvar_2 = _glesNormal;
|
||
|
highp int j_3;
|
||
|
highp int j_4;
|
||
|
highp int il_5;
|
||
|
mediump vec3 lcolor_6;
|
||
|
mediump vec3 eyeNormal_7;
|
||
|
mediump vec4 color_8;
|
||
|
lowp vec4 tmpvar_9;
|
||
|
color_8 = vec4(0.0, 0.0, 0.0, 1.1);
|
||
|
eyeNormal_7 = tmpvar_2;
|
||
|
lcolor_6 = vec3(0.0, 0.0, 0.0);
|
||
|
il_5 = 0;
|
||
|
while (true) {
|
||
|
highp float tmpvar_10;
|
||
|
tmpvar_10 = min (8.0, float(unity_VertexLightParams.x));
|
||
|
if ((float(il_5) >= tmpvar_10)) {
|
||
|
break;
|
||
|
};
|
||
|
highp vec3 tmpvar_11;
|
||
|
tmpvar_11 = unity_LightPosition[il_5].xyz;
|
||
|
mediump vec3 dirToLight_12;
|
||
|
dirToLight_12 = tmpvar_11;
|
||
|
lcolor_6 = (lcolor_6 + min ((
|
||
|
(max (dot (eyeNormal_7, dirToLight_12), 0.0) * unity_LightColor[il_5].xyz)
|
||
|
* 0.5), vec3(1.0, 1.0, 1.0)));
|
||
|
il_5++;
|
||
|
};
|
||
|
color_8.xyz = lcolor_6;
|
||
|
j_4 = 0;
|
||
|
while (true) {
|
||
|
highp float tmpvar_13;
|
||
|
tmpvar_13 = min (float(unity_VertexLightParams.y), 4.0);
|
||
|
if ((j_4 >= int(tmpvar_13))) {
|
||
|
break;
|
||
|
};
|
||
|
color_8.xyz = (color_8.xyz + unity_LightColor[j_4].xyz);
|
||
|
j_4++;
|
||
|
};
|
||
|
j_3 = 0;
|
||
|
while (true) {
|
||
|
highp int tmpvar_14;
|
||
|
tmpvar_14 = min (unity_VertexLightParams.y, 4);
|
||
|
if ((j_3 >= tmpvar_14)) {
|
||
|
break;
|
||
|
};
|
||
|
color_8.xyz = (color_8.xyz * unity_LightColor[j_3].xyz);
|
||
|
j_3++;
|
||
|
};
|
||
|
tmpvar_9 = color_8;
|
||
|
highp vec4 tmpvar_15;
|
||
|
tmpvar_15.w = 1.0;
|
||
|
tmpvar_15.xyz = tmpvar_1;
|
||
|
xlv_COLOR0 = tmpvar_9;
|
||
|
gl_Position = tmpvar_15;
|
||
|
}
|
||
|
|
||
|
|
||
|
// stats: 27 alu 0 tex 6 flow
|
||
|
// inputs: 2
|
||
|
// #0: _glesVertex (high float) 4x1 [-1]
|
||
|
// #1: _glesNormal (high float) 3x1 [-1]
|
||
|
// uniforms: 3 (total size: 0)
|
||
|
// #0: unity_LightColor (medium float) 4x1 [8]
|
||
|
// #1: unity_LightPosition (high float) 4x1 [8]
|
||
|
// #2: unity_VertexLightParams (high int) 4x1 [-1]
|