mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
38 lines
1.2 KiB
Text
38 lines
1.2 KiB
Text
uniform vec4 unity_Ambient;
|
|
uniform sampler2D _ParallaxMap;
|
|
uniform float _Parallax;
|
|
uniform sampler2D _MainTex;
|
|
uniform sampler2D _LightBuffer;
|
|
uniform sampler2D _Illum;
|
|
uniform vec4 _Color;
|
|
uniform sampler2D _BumpMap;
|
|
void main ()
|
|
{
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = gl_TexCoord[0];
|
|
vec4 col_2;
|
|
vec4 light_3;
|
|
vec2 tmpvar_4;
|
|
vec3 v_5;
|
|
vec3 tmpvar_6;
|
|
tmpvar_6 = normalize(gl_TexCoord[2].xyz);
|
|
v_5.xy = tmpvar_6.xy;
|
|
v_5.z = (tmpvar_6.z + 0.42);
|
|
tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z));
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color);
|
|
vec4 normal_8;
|
|
normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0);
|
|
normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y)));
|
|
vec4 tmpvar_9;
|
|
tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
|
|
light_3.w = tmpvar_9.w;
|
|
light_3.xyz = (tmpvar_9.xyz + unity_Ambient.xyz);
|
|
vec4 c_10;
|
|
c_10.xyz = (tmpvar_7.xyz * light_3.xyz);
|
|
c_10.w = tmpvar_7.w;
|
|
col_2.w = c_10.w;
|
|
col_2.xyz = (c_10.xyz + (tmpvar_7.xyz * texture2D (_Illum, (gl_TexCoord[1].xy + tmpvar_4)).w));
|
|
gl_FragData[0] = col_2;
|
|
}
|
|
|