mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-12 01:01:30 -05:00
35 lines
1 KiB
Text
35 lines
1 KiB
Text
|
uniform vec4 unity_Ambient;
|
||
|
uniform sampler2D _ParallaxMap;
|
||
|
uniform float _Parallax;
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform sampler2D _LightBuffer;
|
||
|
uniform vec4 _Color;
|
||
|
uniform sampler2D _BumpMap;
|
||
|
void main ()
|
||
|
{
|
||
|
vec4 tmpvar_1;
|
||
|
tmpvar_1 = gl_TexCoord[0];
|
||
|
vec4 light_2;
|
||
|
vec2 tmpvar_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);
|
||
|
tmpvar_3 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_5.xy / v_4.z));
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color);
|
||
|
vec4 normal_7;
|
||
|
normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0);
|
||
|
normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y)));
|
||
|
vec4 tmpvar_8;
|
||
|
tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
|
||
|
light_2.w = tmpvar_8.w;
|
||
|
light_2.xyz = (tmpvar_8.xyz + unity_Ambient.xyz);
|
||
|
vec4 c_9;
|
||
|
c_9.xyz = (tmpvar_6.xyz * light_2.xyz);
|
||
|
c_9.w = tmpvar_6.w;
|
||
|
gl_FragData[0] = c_9;
|
||
|
}
|
||
|
|