mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
42 lines
1.1 KiB
Text
42 lines
1.1 KiB
Text
uniform vec4 _Color;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _MainTex;
|
|
uniform float _Parallax;
|
|
uniform sampler2D _ParallaxMap;
|
|
uniform vec4 unity_Ambient;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 light_2;
|
|
vec4 c_3;
|
|
vec3 v_4;
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = normalize(gl_TexCoord[1].xyz);
|
|
v_4.xy = tmpvar_5.xy;
|
|
v_4.z = (tmpvar_5.z + 0.42);
|
|
c_3 = (texture2D (_MainTex, (tmpvar_1.xy + (
|
|
((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0))
|
|
*
|
|
(tmpvar_5.xy / v_4.z)
|
|
))) * _Color);
|
|
light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
|
|
light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
|
|
vec4 c_6;
|
|
c_6.xyz = (c_3.xyz * light_2.xyz);
|
|
c_6.w = c_3.w;
|
|
gl_FragData[0] = c_6;
|
|
}
|
|
|
|
|
|
// stats: 13 alu 3 tex 0 flow
|
|
// inputs: 1
|
|
// #0: gl_TexCoord (high float) 4x1 [3] loc 4
|
|
// uniforms: 3 (total size: 0)
|
|
// #0: _Color (high float) 4x1 [-1]
|
|
// #1: _Parallax (high float) 1x1 [-1]
|
|
// #2: unity_Ambient (high float) 4x1 [-1]
|
|
// textures: 3
|
|
// #0: _LightBuffer (high 2d) 0x0 [-1]
|
|
// #1: _MainTex (high 2d) 0x0 [-1]
|
|
// #2: _ParallaxMap (high 2d) 0x0 [-1]
|