mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
55 lines
1.6 KiB
Text
55 lines
1.6 KiB
Text
uniform sampler2D _BumpSpecMap;
|
|
uniform float _Cutoff;
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _SpecColor;
|
|
uniform vec4 _TerrainTreeLightColors[4];
|
|
uniform vec3 _TranslucencyColor;
|
|
uniform sampler2D _TranslucencyMap;
|
|
void main ()
|
|
{
|
|
vec2 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0].xy;
|
|
vec3 tmpvar_2;
|
|
vec3 tmpvar_3;
|
|
tmpvar_2 = gl_TexCoord[3].xyz;
|
|
tmpvar_3 = gl_TexCoord[4].xyz;
|
|
vec4 c_4;
|
|
vec3 backContribs_5;
|
|
vec3 light_6;
|
|
float specular_7;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = texture2D (_MainTex, tmpvar_1);
|
|
float x_9;
|
|
x_9 = (tmpvar_8.w - _Cutoff);
|
|
if ((x_9 < 0.0)) {
|
|
discard;
|
|
};
|
|
vec3 tmpvar_10;
|
|
tmpvar_10 = (tmpvar_8.xyz * gl_TexCoord[1].xyz);
|
|
specular_7 = (texture2D (_BumpSpecMap, tmpvar_1).x * 128.0);
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = texture2D (_TranslucencyMap, tmpvar_1);
|
|
light_6 = (gl_LightModel.ambient.xyz * tmpvar_10);
|
|
backContribs_5 = (gl_TexCoord[2].xyz * tmpvar_11.z);
|
|
light_6 = (light_6 + ((
|
|
(tmpvar_10 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x))
|
|
+
|
|
(_SpecColor.xyz * (pow (tmpvar_3.x, specular_7) * tmpvar_11.w))
|
|
) * _TerrainTreeLightColors[0].xyz));
|
|
light_6 = (light_6 + ((
|
|
(tmpvar_10 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y))
|
|
+
|
|
(_SpecColor.xyz * (pow (tmpvar_3.y, specular_7) * tmpvar_11.w))
|
|
) * _TerrainTreeLightColors[1].xyz));
|
|
light_6 = (light_6 + ((
|
|
(tmpvar_10 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z))
|
|
+
|
|
(_SpecColor.xyz * (pow (tmpvar_3.z, specular_7) * tmpvar_11.w))
|
|
) * _TerrainTreeLightColors[2].xyz));
|
|
c_4.xyz = (light_6 * 2.0);
|
|
c_4.w = 1.0;
|
|
gl_FragData[0] = c_4;
|
|
}
|
|
|
|
|
|
// inputs: 1, stats: 35 alu 4 tex 1 flow
|