mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
30 lines
770 B
Text
30 lines
770 B
Text
uniform vec4 unity_Ambient;
|
|
uniform sampler2D _MainTex;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _DecalTex;
|
|
uniform vec4 _Color;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 light_2;
|
|
vec4 c_3;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
|
|
c_3.w = tmpvar_4.w;
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw);
|
|
c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www);
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (c_3 * _Color);
|
|
c_3 = tmpvar_6;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
|
|
light_2.w = tmpvar_7.w;
|
|
light_2.xyz = (tmpvar_7.xyz + unity_Ambient.xyz);
|
|
vec4 c_8;
|
|
c_8.xyz = (tmpvar_6.xyz * light_2.xyz);
|
|
c_8.w = tmpvar_6.w;
|
|
gl_FragData[0] = c_8;
|
|
}
|
|
|