mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
130 lines
4.2 KiB
Text
130 lines
4.2 KiB
Text
uniform vec4 _Color;
|
|
uniform vec4 _LightShadowData;
|
|
uniform vec4 _MainTex_ST;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _Scale;
|
|
uniform float _SquashAmount;
|
|
uniform vec4 _SquashPlaneNormal;
|
|
uniform float _TimeX;
|
|
uniform vec4 _Wind;
|
|
uniform mat4 _World2Shadow;
|
|
uniform mat4 _World2Shadow1;
|
|
uniform mat4 _World2Shadow2;
|
|
uniform mat4 _World2Shadow3;
|
|
attribute vec4 TANGENT;
|
|
void main ()
|
|
{
|
|
vec4 wpos_1;
|
|
float z_2;
|
|
vec2 tmpvar_3;
|
|
vec4 tmpvar_4;
|
|
vec4 pos_5;
|
|
float isBillboard_6;
|
|
isBillboard_6 = (1.0 - abs(TANGENT.w));
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.w = 0.0;
|
|
tmpvar_7.xyz = gl_Normal;
|
|
pos_5 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_6));
|
|
tmpvar_4.w = pos_5.w;
|
|
tmpvar_4.xyz = (pos_5.xyz * _Scale.xyz);
|
|
vec4 pos_8;
|
|
pos_8.w = tmpvar_4.w;
|
|
vec3 bend_9;
|
|
vec2 vWavesSum_10;
|
|
vec4 vWaves_11;
|
|
float fBranchPhase_12;
|
|
fBranchPhase_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
|
|
vec2 tmpvar_13;
|
|
tmpvar_13.x = dot (tmpvar_4.xyz, vec3((gl_Color.y + fBranchPhase_12)));
|
|
tmpvar_13.y = fBranchPhase_12;
|
|
vWaves_11 = ((fract(
|
|
((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
|
|
) * 2.0) - 1.0);
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = abs(((
|
|
fract((vWaves_11 + 0.5))
|
|
* 2.0) - 1.0));
|
|
vec4 tmpvar_15;
|
|
tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14)));
|
|
vWaves_11 = tmpvar_15;
|
|
vWavesSum_10 = (tmpvar_15.xz + tmpvar_15.yw);
|
|
bend_9.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize(
|
|
(tmpvar_7 * gl_ModelViewMatrixInverseTranspose)
|
|
).xyz, vec3(isBillboard_6))).xz;
|
|
bend_9.y = (gl_MultiTexCoord1.y * 0.3);
|
|
pos_8.xyz = (tmpvar_4.xyz + ((
|
|
(vWavesSum_10.xyx * bend_9)
|
|
+
|
|
((_Wind.xyz * vWavesSum_10.y) * gl_MultiTexCoord1.y)
|
|
) * _Wind.w));
|
|
pos_8.xyz = (pos_8.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
|
|
vec3 tmpvar_16;
|
|
tmpvar_16.xz = vec2(0.0, 0.0);
|
|
tmpvar_16.y = _SquashPlaneNormal.w;
|
|
vec4 tmpvar_17;
|
|
tmpvar_17.w = 1.0;
|
|
tmpvar_17.xyz = mix ((pos_8.xyz + (
|
|
dot (_SquashPlaneNormal.xyz, (tmpvar_16 - pos_8.xyz))
|
|
* _SquashPlaneNormal.xyz)), pos_8.xyz, vec3(_SquashAmount));
|
|
tmpvar_4 = tmpvar_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18.xyz = (gl_Color.w * _Color.xyz);
|
|
tmpvar_18.w = _Color.w;
|
|
z_2 = -((gl_ModelViewMatrix * tmpvar_17).z);
|
|
tmpvar_3.x = z_2;
|
|
tmpvar_3.y = ((z_2 * _LightShadowData.z) + _LightShadowData.w);
|
|
wpos_1 = (_Object2World * tmpvar_17);
|
|
gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_17);
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.w = 0.0;
|
|
tmpvar_19.xyz = (_World2Shadow * wpos_1).xyz;
|
|
gl_TexCoord[0] = tmpvar_19;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.w = 0.0;
|
|
tmpvar_20.xyz = (_World2Shadow1 * wpos_1).xyz;
|
|
gl_TexCoord[1] = tmpvar_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.w = 0.0;
|
|
tmpvar_21.xyz = (_World2Shadow2 * wpos_1).xyz;
|
|
gl_TexCoord[2] = tmpvar_21;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.w = 0.0;
|
|
tmpvar_22.xyz = (_World2Shadow3 * wpos_1).xyz;
|
|
gl_TexCoord[3] = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23.zw = vec2(0.0, 0.0);
|
|
tmpvar_23.xy = tmpvar_3;
|
|
gl_TexCoord[4] = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24.zw = vec2(0.0, 0.0);
|
|
tmpvar_24.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
gl_TexCoord[5] = tmpvar_24;
|
|
gl_FrontColor = tmpvar_18;
|
|
}
|
|
|
|
|
|
// stats: 66 alu 0 tex 0 flow
|
|
// inputs: 6
|
|
// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
|
|
// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
|
|
// #2: gl_Color (high float) 4x1 [-1] loc 3
|
|
// #3: gl_Normal (high float) 3x1 [-1] loc 2
|
|
// #4: gl_Vertex (high float) 4x1 [-1] loc 0
|
|
// #5: TANGENT (high float) 4x1 [-1]
|
|
// uniforms: 16 (total size: 0)
|
|
// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
|
|
// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #2: gl_ModelViewMatrix (high float) 4x4 [-1]
|
|
// #3: _Color (high float) 4x1 [-1]
|
|
// #4: _LightShadowData (high float) 4x1 [-1]
|
|
// #5: _MainTex_ST (high float) 4x1 [-1]
|
|
// #6: _Object2World (high float) 4x4 [-1]
|
|
// #7: _Scale (high float) 4x1 [-1]
|
|
// #8: _SquashAmount (high float) 1x1 [-1]
|
|
// #9: _SquashPlaneNormal (high float) 4x1 [-1]
|
|
// #10: _TimeX (high float) 1x1 [-1]
|
|
// #11: _Wind (high float) 4x1 [-1]
|
|
// #12: _World2Shadow (high float) 4x4 [-1]
|
|
// #13: _World2Shadow1 (high float) 4x4 [-1]
|
|
// #14: _World2Shadow2 (high float) 4x4 [-1]
|
|
// #15: _World2Shadow3 (high float) 4x4 [-1]
|