mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
39 lines
1.1 KiB
Text
39 lines
1.1 KiB
Text
uniform sampler2D _BumpMap;
|
|
uniform vec4 _Color;
|
|
uniform sampler2D _Illum;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _SpecColor;
|
|
uniform vec4 unity_Ambient;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 col_2;
|
|
vec4 light_3;
|
|
vec2 tmpvar_4;
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy);
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (tmpvar_5 * _Color);
|
|
vec4 normal_7;
|
|
normal_7.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0);
|
|
normal_7.z = sqrt(((1.0 -
|
|
(normal_7.x * normal_7.x)
|
|
) - (normal_7.y * normal_7.y)));
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
|
|
light_3.w = tmpvar_8.w;
|
|
light_3.xyz = (tmpvar_8.xyz + unity_Ambient.xyz);
|
|
vec4 c_9;
|
|
float tmpvar_10;
|
|
tmpvar_10 = (tmpvar_8.w * tmpvar_5.w);
|
|
c_9.xyz = ((tmpvar_6.xyz * light_3.xyz) + ((light_3.xyz * _SpecColor.xyz) * tmpvar_10));
|
|
c_9.w = (tmpvar_6.w + (tmpvar_10 * _SpecColor.w));
|
|
col_2.w = c_9.w;
|
|
col_2.xyz = (c_9.xyz + (tmpvar_6.xyz * texture2D (_Illum, tmpvar_1.zw).w));
|
|
gl_FragData[0] = col_2;
|
|
}
|
|
|
|
|
|
// inputs: 1, stats: 20 alu 4 tex 0 flow
|