mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
45 lines
1.6 KiB
Text
45 lines
1.6 KiB
Text
varying vec2 xlv_TEXCOORD3;
|
|
varying vec3 xlv_TEXCOORD2;
|
|
varying vec3 xlv_TEXCOORD1;
|
|
varying vec4 xlv_COLOR0;
|
|
varying vec2 xlv_TEXCOORD0;
|
|
uniform float _TranslucencyViewDependency;
|
|
uniform sampler2D _TranslucencyMap;
|
|
uniform vec3 _TranslucencyColor;
|
|
uniform float _ShadowStrength;
|
|
uniform sampler2D _MainTex;
|
|
uniform sampler2D _LightTexture0;
|
|
uniform vec4 _LightColor0;
|
|
uniform float _Cutoff;
|
|
uniform vec4 _Color;
|
|
uniform sampler2D _BumpSpecMap;
|
|
void main ()
|
|
{
|
|
vec4 c_1;
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = texture2D (_TranslucencyMap, xlv_TEXCOORD0);
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = texture2D (_BumpSpecMap, xlv_TEXCOORD0);
|
|
vec4 normal_5;
|
|
normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0);
|
|
normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y)));
|
|
float x_6;
|
|
x_6 = (tmpvar_2.w - _Cutoff);
|
|
if ((x_6 < 0.0)) {
|
|
discard;
|
|
};
|
|
vec3 tmpvar_7;
|
|
tmpvar_7 = normalize(xlv_TEXCOORD2);
|
|
vec4 c_8;
|
|
float tmpvar_9;
|
|
tmpvar_9 = dot (normal_5.xyz, xlv_TEXCOORD1);
|
|
c_8.xyz = (((tmpvar_2.xyz * _Color.xyz) * xlv_COLOR0.w) * ((((mix (clamp (-(tmpvar_9), 0.0, 1.0), clamp (dot (tmpvar_7, -(xlv_TEXCOORD1)), 0.0, 1.0), _TranslucencyViewDependency) * tmpvar_3.z) * _TranslucencyColor) * 2.0) + max (0.0, ((tmpvar_9 * 0.6) + 0.4))));
|
|
c_8.xyz = ((c_8.xyz * _LightColor0.xyz) + (pow (max (0.0, dot (normal_5.xyz, normalize((xlv_TEXCOORD1 + tmpvar_7)))), (tmpvar_4.x * 128.0)) * (tmpvar_3.w * _Color.x)));
|
|
c_8.xyz = (c_8.xyz * mix (2.0, (texture2D (_LightTexture0, xlv_TEXCOORD3).w * 2.0), _ShadowStrength));
|
|
c_1.xyz = c_8.xyz;
|
|
c_1.w = tmpvar_2.w;
|
|
gl_FragData[0] = c_1;
|
|
}
|
|
|