mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-12 09:11:18 -05:00
72 lines
2.2 KiB
Text
72 lines
2.2 KiB
Text
uniform sampler2D _BumpMap;
|
|
uniform vec4 _Color;
|
|
uniform samplerCube _Cube;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _MainTex;
|
|
uniform float _Parallax;
|
|
uniform sampler2D _ParallaxMap;
|
|
uniform vec4 _ReflectColor;
|
|
uniform vec4 unity_Ambient;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = gl_TexCoord[3];
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = gl_TexCoord[4];
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = gl_TexCoord[5];
|
|
vec4 col_5;
|
|
vec4 light_6;
|
|
vec3 tmpvar_7;
|
|
tmpvar_7.x = tmpvar_2.w;
|
|
tmpvar_7.y = tmpvar_3.w;
|
|
tmpvar_7.z = tmpvar_4.w;
|
|
vec4 reflcol_8;
|
|
vec2 tmpvar_9;
|
|
vec3 v_10;
|
|
vec3 tmpvar_11;
|
|
tmpvar_11 = normalize(gl_TexCoord[1].xyz);
|
|
v_10.xy = tmpvar_11.xy;
|
|
v_10.z = (tmpvar_11.z + 0.42);
|
|
tmpvar_9 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_11.xy / v_10.z));
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_9));
|
|
vec4 normal_13;
|
|
normal_13.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_9)).wy * 2.0) - 1.0);
|
|
normal_13.z = sqrt(((1.0 -
|
|
(normal_13.x * normal_13.x)
|
|
) - (normal_13.y * normal_13.y)));
|
|
vec3 tmpvar_14;
|
|
tmpvar_14.x = dot (tmpvar_2.xyz, normal_13.xyz);
|
|
tmpvar_14.y = dot (tmpvar_3.xyz, normal_13.xyz);
|
|
tmpvar_14.z = dot (tmpvar_4.xyz, normal_13.xyz);
|
|
reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 *
|
|
(dot (tmpvar_14, tmpvar_7) * tmpvar_14)
|
|
))) * tmpvar_12.w);
|
|
light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
|
|
light_6.xyz = (light_6.xyz + unity_Ambient.xyz);
|
|
vec4 c_15;
|
|
c_15.xyz = ((tmpvar_12 * _Color).xyz * light_6.xyz);
|
|
c_15.w = (reflcol_8.w * _ReflectColor.w);
|
|
col_5.w = c_15.w;
|
|
col_5.xyz = (c_15.xyz + (reflcol_8.xyz * _ReflectColor.xyz));
|
|
gl_FragData[0] = col_5;
|
|
}
|
|
|
|
|
|
// stats: 32 alu 5 tex 0 flow
|
|
// inputs: 1
|
|
// #0: gl_TexCoord (high float) 4x1 [6] loc 4
|
|
// uniforms: 4 (total size: 0)
|
|
// #0: _Color (high float) 4x1 [-1]
|
|
// #1: _Parallax (high float) 1x1 [-1]
|
|
// #2: _ReflectColor (high float) 4x1 [-1]
|
|
// #3: unity_Ambient (high float) 4x1 [-1]
|
|
// textures: 5
|
|
// #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: _ParallaxMap (high 2d) 0x0 [-1]
|