mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
116 lines
4.1 KiB
Text
116 lines
4.1 KiB
Text
varying lowp vec4 xlv_TEXCOORD1;
|
|
varying highp vec2 xlv_TEXCOORD0;
|
|
varying highp vec4 xlv_SV_POSITION;
|
|
uniform highp mat4 glstate_matrix_mvp;
|
|
uniform highp vec3 _WorldSpaceCameraPos;
|
|
uniform highp mat4 _World2Object;
|
|
uniform highp float _VerticalBillboarding;
|
|
uniform highp float _TimeOnDuration;
|
|
uniform highp float _TimeOffDuration;
|
|
uniform highp vec4 _Time;
|
|
uniform highp float _SizeGrowStartDist;
|
|
uniform highp float _SizeGrowEndDist;
|
|
uniform highp float _NoiseAmount;
|
|
uniform highp float _Multiplier;
|
|
uniform highp float _MaxGrowSize;
|
|
uniform highp float _FadeOutDistNear;
|
|
uniform highp float _FadeOutDistFar;
|
|
uniform highp vec4 _Color;
|
|
uniform highp float _BlinkingTimeOffsScale;
|
|
uniform highp float _Bias;
|
|
attribute lowp vec4 _glesColor;
|
|
attribute highp vec4 _glesMultiTexCoord1;
|
|
attribute highp vec4 _glesMultiTexCoord0;
|
|
attribute mediump vec3 _glesNormal;
|
|
attribute highp vec4 _glesVertex;
|
|
void main ()
|
|
{
|
|
highp vec3 tmpvar_1;
|
|
highp vec4 tmpvar_2;
|
|
tmpvar_1 = _glesNormal;
|
|
tmpvar_2 = _glesColor;
|
|
lowp vec4 tmpvar_3;
|
|
highp vec3 localDir_4;
|
|
highp vec3 tmpvar_5;
|
|
tmpvar_5.z = 0.0;
|
|
tmpvar_5.xy = (vec2(0.5, 0.5) - tmpvar_2.xy);
|
|
highp vec3 tmpvar_6;
|
|
tmpvar_6 = (tmpvar_5 * _glesMultiTexCoord1.xyy);
|
|
highp vec3 tmpvar_7;
|
|
tmpvar_7 = (_glesVertex.xyz + tmpvar_6);
|
|
highp vec4 tmpvar_8;
|
|
tmpvar_8.w = 1.0;
|
|
tmpvar_8.xyz = _WorldSpaceCameraPos;
|
|
highp vec3 tmpvar_9;
|
|
tmpvar_9 = ((_World2Object * tmpvar_8).xyz - tmpvar_7);
|
|
localDir_4.xz = tmpvar_9.xz;
|
|
localDir_4.y = mix (0.0, tmpvar_9.y, _VerticalBillboarding);
|
|
highp float tmpvar_10;
|
|
tmpvar_10 = sqrt(dot (localDir_4, localDir_4));
|
|
highp vec3 dir_11;
|
|
dir_11 = (localDir_4 / tmpvar_10);
|
|
highp float tmpvar_12;
|
|
tmpvar_12 = abs(dir_11.y);
|
|
vec3 tmpvar_13;
|
|
if ((tmpvar_12 > 0.999)) {
|
|
tmpvar_13 = vec3(0.0, 0.0, 1.0);
|
|
} else {
|
|
tmpvar_13 = vec3(0.0, 1.0, 0.0);
|
|
};
|
|
highp vec3 tmpvar_14;
|
|
tmpvar_14 = normalize(((tmpvar_13.yzx * dir_11.zxy) - (tmpvar_13.zxy * dir_11.yzx)));
|
|
highp vec3 tmpvar_15;
|
|
tmpvar_15 = ((dir_11.yzx * tmpvar_14.zxy) - (dir_11.zxy * tmpvar_14.yzx));
|
|
highp float tmpvar_16;
|
|
tmpvar_16 = min ((max ((tmpvar_10 - _SizeGrowStartDist), 0.0) / _SizeGrowEndDist), 1.0);
|
|
highp vec3 tmpvar_17;
|
|
tmpvar_17 = ((tmpvar_7 - ((tmpvar_14 * tmpvar_6.x) + (tmpvar_15 * tmpvar_6.y))) + (((tmpvar_14 * tmpvar_1.x) + (tmpvar_15 * tmpvar_1.y)) * (((tmpvar_16 * tmpvar_16) * _MaxGrowSize) * tmpvar_2.w)));
|
|
highp float tmpvar_18;
|
|
tmpvar_18 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z));
|
|
highp float y_19;
|
|
y_19 = (_TimeOnDuration + _TimeOffDuration);
|
|
highp float tmpvar_20;
|
|
tmpvar_20 = (tmpvar_18 / y_19);
|
|
highp float tmpvar_21;
|
|
tmpvar_21 = (fract(abs(tmpvar_20)) * y_19);
|
|
highp float tmpvar_22;
|
|
if ((tmpvar_20 >= 0.0)) {
|
|
tmpvar_22 = tmpvar_21;
|
|
} else {
|
|
tmpvar_22 = -(tmpvar_21);
|
|
};
|
|
highp float t_23;
|
|
t_23 = max (min ((tmpvar_22 / (_TimeOnDuration * 0.25)), 1.0), 0.0);
|
|
highp float edge0_24;
|
|
edge0_24 = (_TimeOnDuration * 0.75);
|
|
highp float t_25;
|
|
t_25 = max (min (((tmpvar_22 - edge0_24) / (_TimeOnDuration - edge0_24)), 1.0), 0.0);
|
|
highp float tmpvar_26;
|
|
tmpvar_26 = ((t_23 * (t_23 * (3.0 - (2.0 * t_23)))) * (1.0 - (t_25 * (t_25 * (3.0 - (2.0 * t_25))))));
|
|
highp float tmpvar_27;
|
|
tmpvar_27 = (tmpvar_18 * (6.28319 / _TimeOnDuration));
|
|
highp float tmpvar_28;
|
|
tmpvar_28 = ((_NoiseAmount * (sin(tmpvar_27) * ((0.5 * cos(((tmpvar_27 * 0.6366) + 56.7272))) + 0.5))) + (1.0 - _NoiseAmount));
|
|
highp float tmpvar_29;
|
|
if ((_NoiseAmount < 0.01)) {
|
|
tmpvar_29 = tmpvar_26;
|
|
} else {
|
|
tmpvar_29 = tmpvar_28;
|
|
};
|
|
highp vec4 tmpvar_30;
|
|
tmpvar_30.w = 1.0;
|
|
tmpvar_30.xyz = tmpvar_17;
|
|
highp float tmpvar_31;
|
|
tmpvar_31 = clamp ((tmpvar_10 / _FadeOutDistNear), 0.0, 1.0);
|
|
highp float tmpvar_32;
|
|
tmpvar_32 = (1.0 - clamp ((max ((tmpvar_10 - _FadeOutDistFar), 0.0) * 0.2), 0.0, 1.0));
|
|
highp float tmpvar_33;
|
|
tmpvar_33 = (tmpvar_31 * tmpvar_31);
|
|
highp vec4 tmpvar_34;
|
|
tmpvar_34 = (((((tmpvar_33 * tmpvar_33) * (tmpvar_32 * tmpvar_32)) * _Color) * _Multiplier) * (tmpvar_29 + _Bias));
|
|
tmpvar_3 = tmpvar_34;
|
|
xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_30);
|
|
xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
|
|
xlv_TEXCOORD1 = tmpvar_3;
|
|
}
|
|
|