mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
169 lines
5.3 KiB
Text
169 lines
5.3 KiB
Text
#version 300 es
|
|
uniform highp float _Bias;
|
|
uniform highp float _BlinkingTimeOffsScale;
|
|
uniform highp vec4 _Color;
|
|
uniform highp float _FadeOutDistFar;
|
|
uniform highp float _FadeOutDistNear;
|
|
uniform highp float _MaxGrowSize;
|
|
uniform highp float _Multiplier;
|
|
uniform highp float _NoiseAmount;
|
|
uniform highp float _SizeGrowEndDist;
|
|
uniform highp float _SizeGrowStartDist;
|
|
uniform highp vec4 _Time;
|
|
uniform highp float _TimeOffDuration;
|
|
uniform highp float _TimeOnDuration;
|
|
uniform highp float _VerticalBillboarding;
|
|
uniform highp mat4 _World2Object;
|
|
uniform highp vec3 _WorldSpaceCameraPos;
|
|
uniform highp mat4 glstate_matrix_mvp;
|
|
in highp vec4 _inVertex;
|
|
in mediump vec3 _inNormal;
|
|
in highp vec4 _uv0;
|
|
in highp vec4 _uv1;
|
|
in lowp vec4 _color;
|
|
out highp vec4 xlv_SV_POSITION;
|
|
out highp vec2 xlv_TEXCOORD0;
|
|
out lowp vec4 xlv_TEXCOORD1;
|
|
void main ()
|
|
{
|
|
highp vec3 tmpvar_1;
|
|
highp vec4 tmpvar_2;
|
|
tmpvar_1 = _inNormal;
|
|
tmpvar_2 = _color;
|
|
lowp vec4 tmpvar_3;
|
|
highp float noiseWave_4;
|
|
highp float noiseTime_5;
|
|
highp float wave_6;
|
|
highp float time_7;
|
|
highp vec3 BBLocalPos_8;
|
|
highp vec3 localDir_9;
|
|
highp vec3 centerLocal_10;
|
|
highp vec3 centerOffs_11;
|
|
highp vec3 tmpvar_12;
|
|
tmpvar_12.z = 0.0;
|
|
tmpvar_12.xy = (vec2(0.5, 0.5) - tmpvar_2.xy);
|
|
centerOffs_11 = (tmpvar_12 * _uv1.xyy);
|
|
centerLocal_10 = (_inVertex.xyz + centerOffs_11);
|
|
highp vec4 tmpvar_13;
|
|
tmpvar_13.w = 1.0;
|
|
tmpvar_13.xyz = _WorldSpaceCameraPos;
|
|
localDir_9 = ((_World2Object * tmpvar_13).xyz - centerLocal_10);
|
|
localDir_9.y = (localDir_9.y * _VerticalBillboarding);
|
|
highp float tmpvar_14;
|
|
tmpvar_14 = sqrt(dot (localDir_9, localDir_9));
|
|
highp vec3 dir_15;
|
|
dir_15 = (localDir_9 / tmpvar_14);
|
|
highp float tmpvar_16;
|
|
tmpvar_16 = abs(dir_15.y);
|
|
vec3 tmpvar_17;
|
|
if ((tmpvar_16 > 0.999)) {
|
|
tmpvar_17 = vec3(0.0, 0.0, 1.0);
|
|
} else {
|
|
tmpvar_17 = vec3(0.0, 1.0, 0.0);
|
|
};
|
|
highp vec3 tmpvar_18;
|
|
tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx)));
|
|
highp vec3 tmpvar_19;
|
|
tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx));
|
|
highp float tmpvar_20;
|
|
tmpvar_20 = min ((max (
|
|
(tmpvar_14 - _SizeGrowStartDist)
|
|
, 0.0) / _SizeGrowEndDist), 1.0);
|
|
BBLocalPos_8 = ((centerLocal_10 - (
|
|
(tmpvar_18 * centerOffs_11.x)
|
|
+
|
|
(tmpvar_19 * centerOffs_11.y)
|
|
)) + ((
|
|
(tmpvar_18 * tmpvar_1.x)
|
|
+
|
|
(tmpvar_19 * tmpvar_1.y)
|
|
) * (
|
|
(tmpvar_20 * tmpvar_20)
|
|
*
|
|
(_MaxGrowSize * tmpvar_2.w)
|
|
)));
|
|
time_7 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z));
|
|
highp float y_21;
|
|
y_21 = (_TimeOnDuration + _TimeOffDuration);
|
|
highp float tmpvar_22;
|
|
tmpvar_22 = (time_7 / y_21);
|
|
highp float tmpvar_23;
|
|
tmpvar_23 = (fract(abs(tmpvar_22)) * y_21);
|
|
highp float tmpvar_24;
|
|
if ((tmpvar_22 >= 0.0)) {
|
|
tmpvar_24 = tmpvar_23;
|
|
} else {
|
|
tmpvar_24 = -(tmpvar_23);
|
|
};
|
|
highp float tmpvar_25;
|
|
tmpvar_25 = clamp ((tmpvar_24 / (_TimeOnDuration * 0.25)), 0.0, 1.0);
|
|
highp float edge0_26;
|
|
edge0_26 = (_TimeOnDuration * 0.75);
|
|
highp float tmpvar_27;
|
|
tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_TimeOnDuration - edge0_26)), 0.0, 1.0);
|
|
wave_6 = ((tmpvar_25 * (tmpvar_25 *
|
|
(3.0 - (2.0 * tmpvar_25))
|
|
)) * (1.0 - (tmpvar_27 *
|
|
(tmpvar_27 * (3.0 - (2.0 * tmpvar_27)))
|
|
)));
|
|
noiseTime_5 = (time_7 * (6.28319 / _TimeOnDuration));
|
|
noiseWave_4 = ((_NoiseAmount * (
|
|
sin(noiseTime_5)
|
|
*
|
|
((0.5 * cos((
|
|
(noiseTime_5 * 0.6366)
|
|
+ 56.7272))) + 0.5)
|
|
)) + (1.0 - _NoiseAmount));
|
|
highp float tmpvar_28;
|
|
if ((_NoiseAmount < 0.01)) {
|
|
tmpvar_28 = wave_6;
|
|
} else {
|
|
tmpvar_28 = noiseWave_4;
|
|
};
|
|
wave_6 = (tmpvar_28 + _Bias);
|
|
highp vec4 tmpvar_29;
|
|
tmpvar_29.w = 1.0;
|
|
tmpvar_29.xyz = BBLocalPos_8;
|
|
highp float ffadeout_30;
|
|
highp float nfadeout_31;
|
|
highp float tmpvar_32;
|
|
tmpvar_32 = clamp ((tmpvar_14 / _FadeOutDistNear), 0.0, 1.0);
|
|
ffadeout_30 = (1.0 - clamp ((
|
|
max ((tmpvar_14 - _FadeOutDistFar), 0.0)
|
|
* 0.2), 0.0, 1.0));
|
|
ffadeout_30 = (ffadeout_30 * ffadeout_30);
|
|
nfadeout_31 = (tmpvar_32 * tmpvar_32);
|
|
nfadeout_31 = (nfadeout_31 * nfadeout_31);
|
|
nfadeout_31 = (nfadeout_31 * ffadeout_30);
|
|
tmpvar_3 = ((nfadeout_31 * _Color) * (_Multiplier * wave_6));
|
|
xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_29);
|
|
xlv_TEXCOORD0 = _uv0.xy;
|
|
xlv_TEXCOORD1 = tmpvar_3;
|
|
}
|
|
|
|
|
|
// stats: 95 alu 0 tex 3 flow
|
|
// inputs: 5
|
|
// #0: _inVertex (high float) 4x1 [-1]
|
|
// #1: _inNormal (medium float) 3x1 [-1]
|
|
// #2: _uv0 (high float) 4x1 [-1]
|
|
// #3: _uv1 (high float) 4x1 [-1]
|
|
// #4: _color (low float) 4x1 [-1]
|
|
// uniforms: 17 (total size: 0)
|
|
// #0: _Bias (high float) 1x1 [-1]
|
|
// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1]
|
|
// #2: _Color (high float) 4x1 [-1]
|
|
// #3: _FadeOutDistFar (high float) 1x1 [-1]
|
|
// #4: _FadeOutDistNear (high float) 1x1 [-1]
|
|
// #5: _MaxGrowSize (high float) 1x1 [-1]
|
|
// #6: _Multiplier (high float) 1x1 [-1]
|
|
// #7: _NoiseAmount (high float) 1x1 [-1]
|
|
// #8: _SizeGrowEndDist (high float) 1x1 [-1]
|
|
// #9: _SizeGrowStartDist (high float) 1x1 [-1]
|
|
// #10: _Time (high float) 4x1 [-1]
|
|
// #11: _TimeOffDuration (high float) 1x1 [-1]
|
|
// #12: _TimeOnDuration (high float) 1x1 [-1]
|
|
// #13: _VerticalBillboarding (high float) 1x1 [-1]
|
|
// #14: _World2Object (high float) 4x4 [-1]
|
|
// #15: _WorldSpaceCameraPos (high float) 3x1 [-1]
|
|
// #16: glstate_matrix_mvp (high float) 4x4 [-1]
|