mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 08:41:31 -05:00
156 lines
5.1 KiB
Text
156 lines
5.1 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;
|
|
vec4 pos_4;
|
|
float isBillboard_5;
|
|
isBillboard_5 = (1.0 - abs(TANGENT.w));
|
|
vec4 tmpvar_6;
|
|
tmpvar_6.w = 0.0;
|
|
tmpvar_6.xyz = gl_Normal;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7.yw = vec2(0.0, 0.0);
|
|
tmpvar_7.x = gl_Normal.z;
|
|
tmpvar_7.z = -(gl_Normal.x);
|
|
pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5));
|
|
vec3 tmpvar_8;
|
|
tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5));
|
|
vec4 tmpvar_9;
|
|
tmpvar_9.w = -1.0;
|
|
tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz;
|
|
vec4 tmpvar_10;
|
|
tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5));
|
|
tmpvar_2.w = pos_4.w;
|
|
tmpvar_3.w = tmpvar_10.w;
|
|
tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz);
|
|
vec4 pos_11;
|
|
pos_11.w = tmpvar_2.w;
|
|
vec3 bend_12;
|
|
vec2 vWavesSum_13;
|
|
vec4 vWaves_14;
|
|
float fBranchPhase_15;
|
|
fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
|
|
vec2 tmpvar_16;
|
|
tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15)));
|
|
tmpvar_16.y = fBranchPhase_15;
|
|
vWaves_14 = ((fract(
|
|
((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
|
|
) * 2.0) - 1.0);
|
|
vec4 tmpvar_17;
|
|
tmpvar_17 = abs(((
|
|
fract((vWaves_14 + 0.5))
|
|
* 2.0) - 1.0));
|
|
vec4 tmpvar_18;
|
|
tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17)));
|
|
vWaves_14 = tmpvar_18;
|
|
vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw);
|
|
bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz;
|
|
bend_12.y = (gl_MultiTexCoord1.y * 0.3);
|
|
pos_11.xyz = (tmpvar_2.xyz + ((
|
|
(vWavesSum_13.xyx * bend_12)
|
|
+
|
|
((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y)
|
|
) * _Wind.w));
|
|
pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
|
|
vec3 tmpvar_19;
|
|
tmpvar_19.xz = vec2(0.0, 0.0);
|
|
tmpvar_19.y = _SquashPlaneNormal.w;
|
|
vec3 tmpvar_20;
|
|
tmpvar_20 = mix ((pos_11.xyz + (
|
|
dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz))
|
|
* _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount));
|
|
vec4 tmpvar_21;
|
|
tmpvar_21.w = 1.0;
|
|
tmpvar_21.xyz = tmpvar_20;
|
|
tmpvar_2 = tmpvar_21;
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.xyz = (gl_Color.w * _Color.xyz);
|
|
tmpvar_22.w = _Color.w;
|
|
vec3 tmpvar_23;
|
|
tmpvar_23 = normalize(tmpvar_8);
|
|
tmpvar_3.xyz = normalize(tmpvar_10.xyz);
|
|
vec4 pos_24;
|
|
pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21);
|
|
binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w);
|
|
mat3 tmpvar_25;
|
|
tmpvar_25[0].x = tmpvar_3.x;
|
|
tmpvar_25[0].y = binormal_1.x;
|
|
tmpvar_25[0].z = tmpvar_23.x;
|
|
tmpvar_25[1].x = tmpvar_3.y;
|
|
tmpvar_25[1].y = binormal_1.y;
|
|
tmpvar_25[1].z = tmpvar_23.y;
|
|
tmpvar_25[2].x = tmpvar_3.z;
|
|
tmpvar_25[2].y = binormal_1.z;
|
|
tmpvar_25[2].z = tmpvar_23.z;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26.w = 1.0;
|
|
tmpvar_26.xyz = _WorldSpaceCameraPos;
|
|
gl_Position = pos_24;
|
|
vec4 tmpvar_27;
|
|
tmpvar_27.yzw = vec3(0.0, 0.0, 0.0);
|
|
tmpvar_27.x = pos_24.z;
|
|
xlv_FOG = tmpvar_27;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28.zw = vec2(0.0, 0.0);
|
|
tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
gl_TexCoord[0] = tmpvar_28;
|
|
gl_FrontColor = tmpvar_22;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29.w = 0.0;
|
|
tmpvar_29.xyz = (tmpvar_25 * ((
|
|
(_World2Object * _WorldSpaceLightPos0)
|
|
.xyz * unity_Scale.w) - tmpvar_20));
|
|
gl_TexCoord[1] = tmpvar_29;
|
|
vec4 tmpvar_30;
|
|
tmpvar_30.w = 0.0;
|
|
tmpvar_30.xyz = (tmpvar_25 * ((
|
|
(_World2Object * tmpvar_26)
|
|
.xyz * unity_Scale.w) - tmpvar_20));
|
|
gl_TexCoord[2] = tmpvar_30;
|
|
vec4 tmpvar_31;
|
|
tmpvar_31.w = 0.0;
|
|
tmpvar_31.xyz = (_LightMatrix0 * (_Object2World * tmpvar_21)).xyz;
|
|
gl_TexCoord[3] = tmpvar_31;
|
|
}
|
|
|
|
|
|
// stats: 79 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: 15 (total size: 0)
|
|
// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
|
|
// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
|
|
// #2: _Color (high float) 4x1 [-1]
|
|
// #3: _LightMatrix0 (high float) 4x4 [-1]
|
|
// #4: _MainTex_ST (high float) 4x1 [-1]
|
|
// #5: _Object2World (high float) 4x4 [-1]
|
|
// #6: _Scale (high float) 4x1 [-1]
|
|
// #7: _SquashAmount (high float) 1x1 [-1]
|
|
// #8: _SquashPlaneNormal (high float) 4x1 [-1]
|
|
// #9: _TimeX (high float) 1x1 [-1]
|
|
// #10: _Wind (high float) 4x1 [-1]
|
|
// #11: _World2Object (high float) 4x4 [-1]
|
|
// #12: _WorldSpaceCameraPos (high float) 3x1 [-1]
|
|
// #13: _WorldSpaceLightPos0 (high float) 4x1 [-1]
|
|
// #14: unity_Scale (high float) 4x1 [-1]
|