mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
36 lines
817 B
Text
36 lines
817 B
Text
|
varying highp vec3 xlv_nl;
|
||
|
varying highp vec2 xlv_uv;
|
||
|
uniform highp vec4 _TerrainTreeLightColors[4];
|
||
|
uniform sampler2D _MainTex;
|
||
|
void main ()
|
||
|
{
|
||
|
lowp vec4 tmpvar_1;
|
||
|
highp vec3 tmpvar_2;
|
||
|
tmpvar_2 = xlv_nl;
|
||
|
int j_3;
|
||
|
int loopCount_4;
|
||
|
mediump vec3 light_5;
|
||
|
lowp vec4 col_6;
|
||
|
lowp vec4 tmpvar_7;
|
||
|
tmpvar_7 = texture2D (_MainTex, xlv_uv);
|
||
|
col_6 = tmpvar_7;
|
||
|
light_5 = vec3(0.0, 0.0, 0.0);
|
||
|
loopCount_4 = int((tmpvar_7.w * 10.0));
|
||
|
j_3 = 0;
|
||
|
while (true) {
|
||
|
if ((j_3 >= loopCount_4)) {
|
||
|
break;
|
||
|
};
|
||
|
highp vec3 tmpvar_8;
|
||
|
tmpvar_8 = (light_5 + ((col_6.xyz * tmpvar_2[j_3]) * _TerrainTreeLightColors[j_3].xyz));
|
||
|
light_5 = tmpvar_8;
|
||
|
j_3 = (j_3 + 1);
|
||
|
};
|
||
|
mediump vec4 tmpvar_9;
|
||
|
tmpvar_9.w = 1.0;
|
||
|
tmpvar_9.xyz = light_5;
|
||
|
tmpvar_1 = tmpvar_9;
|
||
|
gl_FragData[0] = tmpvar_1;
|
||
|
}
|
||
|
|