mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
48 lines
1.7 KiB
Text
48 lines
1.7 KiB
Text
|
uniform sampler2D _TranslucencyMap;
|
||
|
uniform vec3 _TranslucencyColor;
|
||
|
uniform vec4 _TerrainTreeLightColors[4];
|
||
|
uniform vec4 _SpecColor;
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform float _Cutoff;
|
||
|
uniform sampler2D _BumpSpecMap;
|
||
|
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);
|
||
|
float tmpvar_12;
|
||
|
tmpvar_12 = (pow (tmpvar_3.x, specular_7) * tmpvar_11.w);
|
||
|
light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x)) + (_SpecColor.xyz * tmpvar_12)) * _TerrainTreeLightColors[0].xyz));
|
||
|
float tmpvar_13;
|
||
|
tmpvar_13 = (pow (tmpvar_3.y, specular_7) * tmpvar_11.w);
|
||
|
light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y)) + (_SpecColor.xyz * tmpvar_13)) * _TerrainTreeLightColors[1].xyz));
|
||
|
float tmpvar_14;
|
||
|
tmpvar_14 = (pow (tmpvar_3.z, specular_7) * tmpvar_11.w);
|
||
|
light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z)) + (_SpecColor.xyz * tmpvar_14)) * _TerrainTreeLightColors[2].xyz));
|
||
|
c_4.xyz = (light_6 * 2.0);
|
||
|
c_4.w = 1.0;
|
||
|
gl_FragData[0] = c_4;
|
||
|
}
|
||
|
|