mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
90 lines
3 KiB
Text
90 lines
3 KiB
Text
|
attribute vec4 TANGENT;
|
||
|
uniform mat4 _World2Shadow3;
|
||
|
uniform mat4 _World2Shadow2;
|
||
|
uniform mat4 _World2Shadow1;
|
||
|
uniform mat4 _World2Shadow;
|
||
|
uniform vec4 _Wind;
|
||
|
uniform float _TimeX;
|
||
|
uniform vec4 _SquashPlaneNormal;
|
||
|
uniform float _SquashAmount;
|
||
|
uniform vec4 _Scale;
|
||
|
uniform mat4 _Object2World;
|
||
|
uniform vec4 _MainTex_ST;
|
||
|
uniform vec4 _LightShadowData;
|
||
|
uniform vec4 _Color;
|
||
|
void main ()
|
||
|
{
|
||
|
vec2 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 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_3));
|
||
|
tmpvar_2 = tmpvar_5;
|
||
|
tmpvar_2.xyz = (tmpvar_5.xyz * _Scale.xyz);
|
||
|
vec4 pos_i0;
|
||
|
pos_i0 = tmpvar_2;
|
||
|
vec3 bend;
|
||
|
float tmpvar_6;
|
||
|
tmpvar_6 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
|
||
|
vec2 tmpvar_7;
|
||
|
tmpvar_7.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + tmpvar_6)));
|
||
|
tmpvar_7.y = tmpvar_6;
|
||
|
vec4 tmpvar_8;
|
||
|
tmpvar_8 = abs (((fract ((((fract (((_TimeX + tmpvar_7).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0));
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = ((tmpvar_8 * tmpvar_8) * (3.0 - (2.0 * tmpvar_8)));
|
||
|
vec2 tmpvar_10;
|
||
|
tmpvar_10 = (tmpvar_9.xz + tmpvar_9.yw);
|
||
|
bend = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize ((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3)));
|
||
|
bend.y = (gl_MultiTexCoord1.y * 0.3);
|
||
|
pos_i0.xyz = (tmpvar_2.xyz + (((tmpvar_10.xyx * bend) + ((_Wind.xyz * tmpvar_10.y) * gl_MultiTexCoord1.y)) * _Wind.w));
|
||
|
pos_i0.xyz = (pos_i0.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
|
||
|
vec3 tmpvar_11;
|
||
|
tmpvar_11.xz = vec2(0.0, 0.0);
|
||
|
tmpvar_11.y = _SquashPlaneNormal.w;
|
||
|
vec4 tmpvar_12;
|
||
|
tmpvar_12.w = 1.0;
|
||
|
tmpvar_12.xyz = mix ((pos_i0.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_11 - pos_i0.xyz)) * _SquashPlaneNormal.xyz)), pos_i0.xyz, vec3(_SquashAmount));
|
||
|
tmpvar_2 = tmpvar_12;
|
||
|
vec4 tmpvar_13;
|
||
|
tmpvar_13.xyz = (gl_Color.w * _Color.xyz);
|
||
|
tmpvar_13.w = _Color.w;
|
||
|
float tmpvar_14;
|
||
|
tmpvar_14 = -((gl_ModelViewMatrix * tmpvar_12).z);
|
||
|
tmpvar_1.x = tmpvar_14;
|
||
|
tmpvar_1.y = ((tmpvar_14 * _LightShadowData.z) + _LightShadowData.w);
|
||
|
vec4 tmpvar_15;
|
||
|
tmpvar_15 = (_Object2World * tmpvar_12);
|
||
|
gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_12);
|
||
|
vec4 tmpvar_16;
|
||
|
tmpvar_16.w = 0.0;
|
||
|
tmpvar_16.xyz = (_World2Shadow * tmpvar_15).xyz;
|
||
|
gl_TexCoord[0] = tmpvar_16;
|
||
|
vec4 tmpvar_17;
|
||
|
tmpvar_17.w = 0.0;
|
||
|
tmpvar_17.xyz = (_World2Shadow1 * tmpvar_15).xyz;
|
||
|
gl_TexCoord[1] = tmpvar_17;
|
||
|
vec4 tmpvar_18;
|
||
|
tmpvar_18.w = 0.0;
|
||
|
tmpvar_18.xyz = (_World2Shadow2 * tmpvar_15).xyz;
|
||
|
gl_TexCoord[2] = tmpvar_18;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19.w = 0.0;
|
||
|
tmpvar_19.xyz = (_World2Shadow3 * tmpvar_15).xyz;
|
||
|
gl_TexCoord[3] = tmpvar_19;
|
||
|
vec4 tmpvar_20;
|
||
|
tmpvar_20.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_20.xy = tmpvar_1;
|
||
|
gl_TexCoord[4] = tmpvar_20;
|
||
|
vec4 tmpvar_21;
|
||
|
tmpvar_21.zw = vec2(0.0, 0.0);
|
||
|
tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
||
|
gl_TexCoord[5] = tmpvar_21;
|
||
|
gl_FrontColor = tmpvar_13;
|
||
|
}
|
||
|
|