mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
29 lines
1 KiB
Text
29 lines
1 KiB
Text
uniform sampler2D unity_LightmapInd;
|
|
uniform sampler2D unity_Lightmap;
|
|
uniform sampler2D _Splat3;
|
|
uniform sampler2D _Splat2;
|
|
uniform sampler2D _Splat1;
|
|
uniform sampler2D _Splat0;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _Control;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = gl_TexCoord[1];
|
|
vec3 tmpvar_3;
|
|
tmpvar_3 = gl_TexCoord[4].xyz;
|
|
vec4 light;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = texture2D (_Control, tmpvar_1.xy);
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = -(log2 (texture2DProj (_LightBuffer, gl_TexCoord[3])));
|
|
light = tmpvar_5;
|
|
light.xyz = (tmpvar_5.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_3.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_3.xy).xyz), vec3(clamp (tmpvar_3.z, 0.0, 1.0))));
|
|
vec4 c;
|
|
c.xyz = (((((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light.xyz);
|
|
c.w = 0.0;
|
|
gl_FragData[0] = c;
|
|
}
|
|
|