mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
148 lines
5.2 KiB
Text
148 lines
5.2 KiB
Text
attribute highp vec4 _glesVertex;
|
|
attribute mediump vec3 _glesNormal;
|
|
attribute highp vec4 _glesMultiTexCoord0;
|
|
attribute highp vec4 _glesMultiTexCoord1;
|
|
attribute lowp vec4 _glesColor;
|
|
uniform highp mat4 _LightMatrix0;
|
|
uniform highp vec4 _MainTex_ST;
|
|
uniform highp mat4 _Object2World;
|
|
uniform highp vec4 _Scale;
|
|
uniform highp float _SquashAmount;
|
|
uniform highp vec4 _SquashPlaneNormal;
|
|
uniform highp vec4 _Time;
|
|
uniform highp vec4 _Wind;
|
|
uniform highp mat4 _World2Object;
|
|
uniform highp vec3 _WorldSpaceCameraPos;
|
|
uniform highp vec4 _WorldSpaceLightPos0;
|
|
uniform highp mat4 glstate_matrix_invtrans_modelview0;
|
|
uniform highp mat4 glstate_matrix_mvp;
|
|
uniform highp vec4 unity_Scale;
|
|
attribute vec4 TANGENT;
|
|
varying highp vec2 xlv_TEXCOORD0;
|
|
varying highp vec4 xlv_COLOR0;
|
|
varying highp vec3 xlv_TEXCOORD1;
|
|
varying highp vec3 xlv_TEXCOORD2;
|
|
varying highp vec2 xlv_TEXCOORD3;
|
|
void main ()
|
|
{
|
|
highp vec3 tmpvar_1;
|
|
highp vec4 tmpvar_2;
|
|
tmpvar_1 = _glesNormal;
|
|
tmpvar_2 = _glesColor;
|
|
highp vec3 binormal_3;
|
|
highp vec4 tmpvar_4;
|
|
highp vec4 tmpvar_5;
|
|
highp vec4 pos_6;
|
|
highp float isBillboard_7;
|
|
isBillboard_7 = (1.0 - abs(TANGENT.w));
|
|
highp vec4 tmpvar_8;
|
|
tmpvar_8.w = 0.0;
|
|
tmpvar_8.xyz = tmpvar_1;
|
|
highp vec4 tmpvar_9;
|
|
tmpvar_9.w = 0.0;
|
|
tmpvar_9.xyz = TANGENT.xyz;
|
|
highp vec4 tmpvar_10;
|
|
tmpvar_10.zw = vec2(0.0, 0.0);
|
|
tmpvar_10.xy = tmpvar_1.xy;
|
|
pos_6 = (_glesVertex + ((tmpvar_10 * glstate_matrix_invtrans_modelview0) * isBillboard_7));
|
|
highp vec3 tmpvar_11;
|
|
tmpvar_11 = mix (tmpvar_1, normalize((tmpvar_8 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_7));
|
|
highp vec4 tmpvar_12;
|
|
tmpvar_12.w = -1.0;
|
|
tmpvar_12.xyz = normalize((tmpvar_9 * glstate_matrix_invtrans_modelview0)).xyz;
|
|
highp vec4 tmpvar_13;
|
|
tmpvar_13 = mix (TANGENT, tmpvar_12, vec4(isBillboard_7));
|
|
tmpvar_4.w = pos_6.w;
|
|
tmpvar_5.w = tmpvar_13.w;
|
|
tmpvar_4.xyz = (pos_6.xyz * _Scale.xyz);
|
|
highp vec4 pos_14;
|
|
pos_14.w = tmpvar_4.w;
|
|
highp vec3 bend_15;
|
|
highp vec2 vWavesSum_16;
|
|
highp vec4 vWaves_17;
|
|
highp float fBranchPhase_18;
|
|
fBranchPhase_18 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_2.x);
|
|
highp vec2 tmpvar_19;
|
|
tmpvar_19.x = dot (tmpvar_4.xyz, vec3((tmpvar_2.y + fBranchPhase_18)));
|
|
tmpvar_19.y = fBranchPhase_18;
|
|
vWaves_17 = ((fract(
|
|
((_Time.yy + tmpvar_19).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
|
|
) * 2.0) - 1.0);
|
|
highp vec4 tmpvar_20;
|
|
tmpvar_20 = abs(((
|
|
fract((vWaves_17 + 0.5))
|
|
* 2.0) - 1.0));
|
|
highp vec4 tmpvar_21;
|
|
tmpvar_21 = ((tmpvar_20 * tmpvar_20) * (3.0 - (2.0 * tmpvar_20)));
|
|
vWaves_17 = tmpvar_21;
|
|
vWavesSum_16 = (tmpvar_21.xz + tmpvar_21.yw);
|
|
bend_15.xz = ((tmpvar_2.y * 0.1) * tmpvar_11).xz;
|
|
bend_15.y = (_glesMultiTexCoord1.y * 0.3);
|
|
pos_14.xyz = (tmpvar_4.xyz + ((
|
|
(vWavesSum_16.xyx * bend_15)
|
|
+
|
|
((_Wind.xyz * vWavesSum_16.y) * _glesMultiTexCoord1.y)
|
|
) * _Wind.w));
|
|
pos_14.xyz = (pos_14.xyz + (_glesMultiTexCoord1.x * _Wind.xyz));
|
|
highp vec3 tmpvar_22;
|
|
tmpvar_22 = mix ((pos_14.xyz - (
|
|
(dot (_SquashPlaneNormal.xyz, pos_14.xyz) + _SquashPlaneNormal.w)
|
|
* _SquashPlaneNormal.xyz)), pos_14.xyz, vec3(_SquashAmount));
|
|
highp vec4 tmpvar_23;
|
|
tmpvar_23.w = 1.0;
|
|
tmpvar_23.xyz = tmpvar_22;
|
|
tmpvar_4 = tmpvar_23;
|
|
highp vec4 tmpvar_24;
|
|
tmpvar_24.xyz = vec3(1.0, 1.0, 1.0);
|
|
tmpvar_24.w = tmpvar_2.w;
|
|
highp vec3 tmpvar_25;
|
|
tmpvar_25 = normalize(tmpvar_11);
|
|
tmpvar_5.xyz = normalize(tmpvar_13.xyz);
|
|
binormal_3 = (((tmpvar_25.yzx * tmpvar_5.zxy) - (tmpvar_25.zxy * tmpvar_5.yzx)) * tmpvar_13.w);
|
|
highp mat3 tmpvar_26;
|
|
tmpvar_26[0].x = tmpvar_5.x;
|
|
tmpvar_26[0].y = binormal_3.x;
|
|
tmpvar_26[0].z = tmpvar_25.x;
|
|
tmpvar_26[1].x = tmpvar_5.y;
|
|
tmpvar_26[1].y = binormal_3.y;
|
|
tmpvar_26[1].z = tmpvar_25.y;
|
|
tmpvar_26[2].x = tmpvar_5.z;
|
|
tmpvar_26[2].y = binormal_3.z;
|
|
tmpvar_26[2].z = tmpvar_25.z;
|
|
highp vec4 tmpvar_27;
|
|
tmpvar_27.w = 1.0;
|
|
tmpvar_27.xyz = _WorldSpaceCameraPos;
|
|
gl_Position = (glstate_matrix_mvp * tmpvar_23);
|
|
xlv_TEXCOORD0 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
xlv_COLOR0 = tmpvar_24;
|
|
xlv_TEXCOORD1 = (tmpvar_26 * (_World2Object * _WorldSpaceLightPos0).xyz);
|
|
xlv_TEXCOORD2 = (tmpvar_26 * ((
|
|
(_World2Object * tmpvar_27)
|
|
.xyz * unity_Scale.w) - tmpvar_22));
|
|
xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_23)).xy;
|
|
}
|
|
|
|
|
|
// stats: 71 alu 0 tex 0 flow
|
|
// inputs: 6
|
|
// #0: _glesVertex (high float) 4x1 [-1]
|
|
// #1: _glesNormal (medium float) 3x1 [-1]
|
|
// #2: _glesMultiTexCoord0 (high float) 4x1 [-1]
|
|
// #3: _glesMultiTexCoord1 (high float) 4x1 [-1]
|
|
// #4: _glesColor (low float) 4x1 [-1]
|
|
// #5: TANGENT (high float) 4x1 [-1]
|
|
// uniforms: 14 (total size: 0)
|
|
// #0: _LightMatrix0 (high float) 4x4 [-1]
|
|
// #1: _MainTex_ST (high float) 4x1 [-1]
|
|
// #2: _Object2World (high float) 4x4 [-1]
|
|
// #3: _Scale (high float) 4x1 [-1]
|
|
// #4: _SquashAmount (high float) 1x1 [-1]
|
|
// #5: _SquashPlaneNormal (high float) 4x1 [-1]
|
|
// #6: _Time (high float) 4x1 [-1]
|
|
// #7: _Wind (high float) 4x1 [-1]
|
|
// #8: _World2Object (high float) 4x4 [-1]
|
|
// #9: _WorldSpaceCameraPos (high float) 3x1 [-1]
|
|
// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1]
|
|
// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
|
|
// #12: glstate_matrix_mvp (high float) 4x4 [-1]
|
|
// #13: unity_Scale (high float) 4x1 [-1]
|