mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
65 lines
2.1 KiB
Text
65 lines
2.1 KiB
Text
uniform sampler2D _BumpMap;
|
|
uniform vec4 _Color;
|
|
uniform samplerCube _Cube;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _ReflectColor;
|
|
uniform sampler2D unity_Lightmap;
|
|
uniform sampler2D unity_LightmapInd;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = gl_TexCoord[2];
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = gl_TexCoord[3];
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = gl_TexCoord[4];
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = gl_TexCoord[5].xyz;
|
|
vec4 col_6;
|
|
vec4 light_7;
|
|
vec3 tmpvar_8;
|
|
tmpvar_8.x = tmpvar_2.w;
|
|
tmpvar_8.y = tmpvar_3.w;
|
|
tmpvar_8.z = tmpvar_4.w;
|
|
vec4 reflcol_9;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = texture2D (_MainTex, tmpvar_1.xy);
|
|
vec4 normal_11;
|
|
normal_11.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
|
|
normal_11.z = sqrt(((1.0 -
|
|
(normal_11.x * normal_11.x)
|
|
) - (normal_11.y * normal_11.y)));
|
|
vec3 tmpvar_12;
|
|
tmpvar_12.x = dot (tmpvar_2.xyz, normal_11.xyz);
|
|
tmpvar_12.y = dot (tmpvar_3.xyz, normal_11.xyz);
|
|
tmpvar_12.z = dot (tmpvar_4.xyz, normal_11.xyz);
|
|
reflcol_9 = (textureCube (_Cube, (tmpvar_8 - (2.0 *
|
|
(dot (tmpvar_12, tmpvar_8) * tmpvar_12)
|
|
))) * tmpvar_10.w);
|
|
light_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
|
|
light_7.xyz = (light_7.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_5.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_5.xy).xyz), vec3(clamp (tmpvar_5.z, 0.0, 1.0))));
|
|
vec4 c_13;
|
|
c_13.xyz = ((tmpvar_10 * _Color).xyz * light_7.xyz);
|
|
c_13.w = (reflcol_9.w * _ReflectColor.w);
|
|
col_6.w = c_13.w;
|
|
col_6.xyz = (c_13.xyz + (reflcol_9.xyz * _ReflectColor.xyz));
|
|
gl_FragData[0] = col_6;
|
|
}
|
|
|
|
|
|
// stats: 27 alu 6 tex 0 flow
|
|
// inputs: 1
|
|
// #0: gl_TexCoord (high float) 4x1 [6] loc 4
|
|
// uniforms: 2 (total size: 0)
|
|
// #0: _Color (high float) 4x1 [-1]
|
|
// #1: _ReflectColor (high float) 4x1 [-1]
|
|
// textures: 6
|
|
// #0: _BumpMap (high 2d) 0x0 [-1]
|
|
// #1: _Cube (high cube) 0x0 [-1]
|
|
// #2: _LightBuffer (high 2d) 0x0 [-1]
|
|
// #3: _MainTex (high 2d) 0x0 [-1]
|
|
// #4: unity_Lightmap (high 2d) 0x0 [-1]
|
|
// #5: unity_LightmapInd (high 2d) 0x0 [-1]
|