mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
33 lines
803 B
Text
33 lines
803 B
Text
uniform sampler2D _MainTex;
|
|
uniform highp vec4 _TerrainTreeLightColors[4];
|
|
varying highp vec2 xlv_uv;
|
|
varying highp vec3 xlv_nl;
|
|
void main ()
|
|
{
|
|
lowp vec4 tmpvar_1;
|
|
highp vec3 tmpvar_2;
|
|
tmpvar_2 = xlv_nl;
|
|
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));
|
|
for (int j_3; j_3 < loopCount_4; j_3++) {
|
|
highp vec3 tmpvar_8;
|
|
tmpvar_8 = (light_5 + ((col_6.xyz *
|
|
tmpvar_2[j_3]
|
|
) * _TerrainTreeLightColors[j_3].xyz));
|
|
light_5 = tmpvar_8;
|
|
};
|
|
mediump vec4 tmpvar_9;
|
|
tmpvar_9.w = 1.0;
|
|
tmpvar_9.xyz = light_5;
|
|
tmpvar_1 = tmpvar_9;
|
|
gl_FragData[0] = tmpvar_1;
|
|
}
|
|
|
|
|
|
// inputs: 2, stats: 11 alu 1 tex 2 flow
|