mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 08:41:31 -05:00
137 lines
4.3 KiB
Text
137 lines
4.3 KiB
Text
uniform vec4 _Color;
|
|
uniform mat4 _LightMatrix0;
|
|
uniform vec4 _MainTex_ST;
|
|
uniform mat4 _Object2World;
|
|
uniform vec4 _Scale;
|
|
uniform float _SquashAmount;
|
|
uniform vec4 _SquashPlaneNormal;
|
|
uniform float _TimeX;
|
|
uniform vec4 _Wind;
|
|
uniform mat4 _World2Object;
|
|
uniform vec3 _WorldSpaceCameraPos;
|
|
uniform vec4 _WorldSpaceLightPos0;
|
|
uniform vec4 unity_Scale;
|
|
attribute vec4 TANGENT;
|
|
varying vec4 xlv_FOG;
|
|
void main ()
|
|
{
|
|
vec3 binormal_1;
|
|
vec4 tmpvar_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_2.w = gl_Vertex.w;
|
|
tmpvar_3.w = TANGENT.w;
|
|
tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
|
|
vec4 pos_4;
|
|
pos_4.w = tmpvar_2.w;
|
|
vec3 bend_5;
|
|
vec2 vWavesSum_6;
|
|
vec4 vWaves_7;
|
|
float fBranchPhase_8;
|
|
fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
|
|
vec2 tmpvar_9;
|
|
tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8)));
|
|
tmpvar_9.y = fBranchPhase_8;
|
|
vWaves_7 = ((fract(
|
|
((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
|
|
) * 2.0) - 1.0);
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = abs(((
|
|
fract((vWaves_7 + 0.5))
|
|
* 2.0) - 1.0));
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10)));
|
|
vWaves_7 = tmpvar_11;
|
|
vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw);
|
|
bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz;
|
|
bend_5.y = (gl_MultiTexCoord1.y * 0.3);
|
|
pos_4.xyz = (tmpvar_2.xyz + ((
|
|
(vWavesSum_6.xyx * bend_5)
|
|
+
|
|
((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y)
|
|
) * _Wind.w));
|
|
pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
|
|
vec3 tmpvar_12;
|
|
tmpvar_12.xz = vec2(0.0, 0.0);
|
|
tmpvar_12.y = _SquashPlaneNormal.w;
|
|
vec3 tmpvar_13;
|
|
tmpvar_13 = mix ((pos_4.xyz + (
|
|
dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz))
|
|
* _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount));
|
|
vec4 tmpvar_14;
|
|
tmpvar_14.w = 1.0;
|
|
tmpvar_14.xyz = tmpvar_13;
|
|
tmpvar_2 = tmpvar_14;
|
|
vec4 tmpvar_15;
|
|
tmpvar_15.xyz = (gl_Color.w * _Color.xyz);
|
|
tmpvar_15.w = _Color.w;
|
|
vec3 tmpvar_16;
|
|
tmpvar_16 = normalize(gl_Normal);
|
|
tmpvar_3.xyz = normalize(TANGENT.xyz);
|
|
vec4 pos_17;
|
|
pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14);
|
|
binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w);
|
|
mat3 tmpvar_18;
|
|
tmpvar_18[0].x = tmpvar_3.x;
|
|
tmpvar_18[0].y = binormal_1.x;
|
|
tmpvar_18[0].z = tmpvar_16.x;
|
|
tmpvar_18[1].x = tmpvar_3.y;
|
|
tmpvar_18[1].y = binormal_1.y;
|
|
tmpvar_18[1].z = tmpvar_16.y;
|
|
tmpvar_18[2].x = tmpvar_3.z;
|
|
tmpvar_18[2].y = binormal_1.z;
|
|
tmpvar_18[2].z = tmpvar_16.z;
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.w = 1.0;
|
|
tmpvar_19.xyz = _WorldSpaceCameraPos;
|
|
gl_Position = pos_17;
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_20.x = pos_17.z;
|
|
xlv_FOG = 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[0] = tmpvar_21;
|
|
gl_FrontColor = tmpvar_15;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.w = 0.0;
|
|
tmpvar_22.xyz = (tmpvar_18 * ((
|
|
(_World2Object * _WorldSpaceLightPos0)
|
|
.xyz * unity_Scale.w) - tmpvar_13));
|
|
gl_TexCoord[1] = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23.w = 0.0;
|
|
tmpvar_23.xyz = (tmpvar_18 * ((
|
|
(_World2Object * tmpvar_19)
|
|
.xyz * unity_Scale.w) - tmpvar_13));
|
|
gl_TexCoord[2] = tmpvar_23;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24.w = 0.0;
|
|
tmpvar_24.xyz = (_LightMatrix0 * (_Object2World * tmpvar_14)).xyz;
|
|
gl_TexCoord[3] = tmpvar_24;
|
|
}
|
|
|
|
|
|
// stats: 64 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: 14 (total size: 0)
|
|
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #1: _Color (high float) 4x1 [-1]
|
|
// #2: _LightMatrix0 (high float) 4x4 [-1]
|
|
// #3: _MainTex_ST (high float) 4x1 [-1]
|
|
// #4: _Object2World (high float) 4x4 [-1]
|
|
// #5: _Scale (high float) 4x1 [-1]
|
|
// #6: _SquashAmount (high float) 1x1 [-1]
|
|
// #7: _SquashPlaneNormal (high float) 4x1 [-1]
|
|
// #8: _TimeX (high float) 1x1 [-1]
|
|
// #9: _Wind (high float) 4x1 [-1]
|
|
// #10: _World2Object (high float) 4x4 [-1]
|
|
// #11: _WorldSpaceCameraPos (high float) 3x1 [-1]
|
|
// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1]
|
|
// #13: unity_Scale (high float) 4x1 [-1]
|