mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
46 lines
1.4 KiB
Text
46 lines
1.4 KiB
Text
|
uniform sampler2D _TranslucencyMap;
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform vec4 _LightColor0;
|
||
|
uniform float _Cutoff;
|
||
|
uniform sampler2D _BumpSpecMap;
|
||
|
void main ()
|
||
|
{
|
||
|
vec3 tmpvar_1;
|
||
|
tmpvar_1 = gl_TexCoord[1].xyz;
|
||
|
vec3 tmpvar_2;
|
||
|
tmpvar_2 = gl_TexCoord[2].xyz;
|
||
|
vec4 c;
|
||
|
vec2 tmpvar_3;
|
||
|
tmpvar_3 = gl_TexCoord[0].xy;
|
||
|
vec4 tmpvar_4;
|
||
|
tmpvar_4 = texture2D (_MainTex, tmpvar_3);
|
||
|
vec3 tmpvar_5;
|
||
|
tmpvar_5 = (tmpvar_4.xyz * gl_Color.xyz);
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = texture2D (_TranslucencyMap, tmpvar_3);
|
||
|
float tmpvar_7;
|
||
|
tmpvar_7 = (tmpvar_4.w * gl_Color.w);
|
||
|
vec4 tmpvar_8;
|
||
|
tmpvar_8 = texture2D (_BumpSpecMap, tmpvar_3);
|
||
|
vec4 normal;
|
||
|
normal.xy = ((tmpvar_8.wy * 2.0) - 1.0);
|
||
|
normal.z = sqrt (((1.0 - (normal.x * normal.x)) - (normal.y * normal.y)));
|
||
|
vec3 tmpvar_9;
|
||
|
tmpvar_9 = normal.xyz;
|
||
|
float x;
|
||
|
x = (tmpvar_7 - _Cutoff);
|
||
|
if ((x < 0.0)) {
|
||
|
discard;
|
||
|
};
|
||
|
vec4 c_i0_i1;
|
||
|
float tmpvar_10;
|
||
|
tmpvar_10 = dot (tmpvar_9, tmpvar_1);
|
||
|
float tmpvar_11;
|
||
|
tmpvar_11 = max (0.0, -(tmpvar_10));
|
||
|
c_i0_i1.xyz = ((((tmpvar_5 * (max (0.0, ((tmpvar_10 * 0.5) + 0.5)) + ((tmpvar_6.xyz * tmpvar_11) * 2.0))) + ((pow (max (0.0, dot (tmpvar_9, normalize ((tmpvar_1 + normalize (tmpvar_2))))), (tmpvar_8.x * 128.0)) * tmpvar_6.w) * (1.0 - clamp (ceil (tmpvar_11), 0.0, 1.0)))) * _LightColor0.xyz) * 2.0);
|
||
|
c = c_i0_i1;
|
||
|
c.w = tmpvar_7;
|
||
|
gl_FragData[0] = c;
|
||
|
}
|
||
|
|