diff options
Diffstat (limited to 'src/declarative/particles/defaultshaders/deformablevertex.shader')
-rw-r--r-- | src/declarative/particles/defaultshaders/deformablevertex.shader | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/declarative/particles/defaultshaders/deformablevertex.shader b/src/declarative/particles/defaultshaders/deformablevertex.shader index 001998435f..ab6acde36d 100644 --- a/src/declarative/particles/defaultshaders/deformablevertex.shader +++ b/src/declarative/particles/defaultshaders/deformablevertex.shader @@ -8,6 +8,7 @@ attribute lowp vec4 vColor; uniform highp mat4 qt_Matrix; uniform highp float timestamp; +uniform highp float entry; varying highp vec2 fTex; varying lowp vec4 fColor; @@ -24,6 +25,18 @@ void main() { if (t < 0. || t > 1.) currentSize = 0.; + lowp float fFade = 1.; + + if (entry == 1.){ + highp float fadeIn = min(t * 10., 1.); + highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.)); + fFade = fadeIn * fadeOut; + }else if(entry == 2.){ + highp float sizeIn = min(t * 10., 1.); + highp float sizeOut = 1. - max(0., min((t - 0.75) * 4., 1.)); + currentSize = currentSize * sizeIn * sizeOut; + } + highp vec2 pos; highp float rotation = vRotation.x + vRotation.y * t * vData.y; if(vRotation.z == 1.0){ @@ -48,8 +61,5 @@ void main() { gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1); - highp float fadeIn = min(t * 10., 1.); - highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.)); - - fColor = vColor * (fadeIn * fadeOut); + fColor = vColor * fFade; } |