mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
115 lines
3.9 KiB
Text
115 lines
3.9 KiB
Text
|
varying vec4 xlv_FOG;
|
||
|
attribute vec4 TANGENT;
|
||
|
uniform vec4 unity_Scale;
|
||
|
uniform vec4 _WorldSpaceLightPos0;
|
||
|
uniform vec3 _WorldSpaceCameraPos;
|
||
|
uniform mat4 _World2Object;
|
||
|
uniform vec4 _Wind;
|
||
|
uniform float _TimeX;
|
||
|
uniform vec4 _SquashPlaneNormal;
|
||
|
uniform float _SquashAmount;
|
||
|
uniform vec4 _Scale;
|
||
|
uniform mat4 _Object2World;
|
||
|
uniform vec4 _MainTex_ST;
|
||
|
uniform mat4 _LightMatrix0;
|
||
|
uniform vec4 _Color;
|
||
|
void main ()
|
||
|
{
|
||
|
vec4 tmpvar_1;
|
||
|
vec4 tmpvar_2;
|
||
|
float tmpvar_3;
|
||
|
tmpvar_3 = (1.0 - abs(TANGENT.w));
|
||
|
vec4 tmpvar_4;
|
||
|
tmpvar_4.w = 0.0;
|
||
|
tmpvar_4.xyz = gl_Normal;
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5.yw = vec2(0.0, 0.0);
|
||
|
tmpvar_5.x = gl_Normal.z;
|
||
|
tmpvar_5.z = -(gl_Normal.x);
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3));
|
||
|
vec3 tmpvar_7;
|
||
|
tmpvar_7 = mix (gl_Normal, normalize((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3));
|
||
|
vec4 tmpvar_8;
|
||
|
tmpvar_8.w = -1.0;
|
||
|
tmpvar_8.xyz = normalize((tmpvar_5 * gl_ModelViewMatrixInverseTranspose)).xyz;
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = mix (TANGENT, tmpvar_8, vec4(tmpvar_3));
|
||
|
tmpvar_1.w = tmpvar_6.w;
|
||
|
tmpvar_2.w = tmpvar_9.w;
|
||
|
tmpvar_1.xyz = (tmpvar_6.xyz * _Scale.xyz);
|
||
|
vec4 pos_10;
|
||
|
pos_10.w = tmpvar_1.w;
|
||
|
vec3 bend_11;
|
||
|
float tmpvar_12;
|
||
|
tmpvar_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
|
||
|
vec2 tmpvar_13;
|
||
|
tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12)));
|
||
|
tmpvar_13.y = tmpvar_12;
|
||
|
vec4 tmpvar_14;
|
||
|
tmpvar_14 = abs(((fract((((fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0));
|
||
|
vec4 tmpvar_15;
|
||
|
tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14)));
|
||
|
vec2 tmpvar_16;
|
||
|
tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw);
|
||
|
bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz;
|
||
|
bend_11.y = (gl_MultiTexCoord1.y * 0.3);
|
||
|
pos_10.xyz = (tmpvar_1.xyz + (((tmpvar_16.xyx * bend_11) + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y)) * _Wind.w));
|
||
|
pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
|
||
|
vec3 tmpvar_17;
|
||
|
tmpvar_17.xz = vec2(0.0, 0.0);
|
||
|
tmpvar_17.y = _SquashPlaneNormal.w;
|
||
|
vec3 tmpvar_18;
|
||
|
tmpvar_18 = mix ((pos_10.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount));
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19.w = 1.0;
|
||
|
tmpvar_19.xyz = tmpvar_18;
|
||
|
tmpvar_1 = tmpvar_19;
|
||
|
vec4 tmpvar_20;
|
||
|
tmpvar_20.xyz = (gl_Color.w * _Color.xyz);
|
||
|
tmpvar_20.w = _Color.w;
|
||
|
vec3 tmpvar_21;
|
||
|
tmpvar_21 = normalize(tmpvar_7);
|
||
|
tmpvar_2.xyz = normalize(tmpvar_9.xyz);
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = (gl_ModelViewProjectionMatrix * tmpvar_19);
|
||
|
vec3 tmpvar_23;
|
||
|
tmpvar_23 = (((tmpvar_21.yzx * tmpvar_2.zxy) - (tmpvar_21.zxy * tmpvar_2.yzx)) * tmpvar_9.w);
|
||
|
mat3 tmpvar_24;
|
||
|
tmpvar_24[0].x = tmpvar_2.x;
|
||
|
tmpvar_24[0].y = tmpvar_23.x;
|
||
|
tmpvar_24[0].z = tmpvar_21.x;
|
||
|
tmpvar_24[1].x = tmpvar_2.y;
|
||
|
tmpvar_24[1].y = tmpvar_23.y;
|
||
|
tmpvar_24[1].z = tmpvar_21.y;
|
||
|
tmpvar_24[2].x = tmpvar_2.z;
|
||
|
tmpvar_24[2].y = tmpvar_23.z;
|
||
|
tmpvar_24[2].z = tmpvar_21.z;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25.w = 1.0;
|
||
|
tmpvar_25.xyz = _WorldSpaceCameraPos;
|
||
|
gl_Position = tmpvar_22;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26.yzw = vec3(0.0, 0.0, 0.0);
|
||
|
tmpvar_26.x = tmpvar_22.z;
|
||
|
xlv_FOG = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_27.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
||
|
gl_TexCoord[0] = tmpvar_27;
|
||
|
gl_FrontColor = tmpvar_20;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28.w = 0.0;
|
||
|
tmpvar_28.xyz = (tmpvar_24 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - tmpvar_18));
|
||
|
gl_TexCoord[1] = tmpvar_28;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29.w = 0.0;
|
||
|
tmpvar_29.xyz = (tmpvar_24 * (((_World2Object * tmpvar_25).xyz * unity_Scale.w) - tmpvar_18));
|
||
|
gl_TexCoord[2] = tmpvar_29;
|
||
|
vec4 tmpvar_30;
|
||
|
tmpvar_30.w = 0.0;
|
||
|
tmpvar_30.xyz = (_LightMatrix0 * (_Object2World * tmpvar_19)).xyz;
|
||
|
gl_TexCoord[3] = tmpvar_30;
|
||
|
}
|
||
|
|