diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-08-23 18:20:58 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-24 10:11:29 +0200 |
commit | 017265b9383cbd616aaa2f5fee17dae8e28a161b (patch) | |
tree | 49e45cd13a00f0ccf2c3641b1256dd3d2904842b /src/declarative/particles/defaultshaders/imagevertex.shader | |
parent | e6c0633a9c386817017a97dac9e541a45f42fd7f (diff) |
Switch from textures to uniform arrays for size/opacity tables
Change-Id: Iafc5eaa80f68345cc3b14fe0b2d997c1af435419
Reviewed-on: http://codereview.qt.nokia.com/3388
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/declarative/particles/defaultshaders/imagevertex.shader')
-rw-r--r-- | src/declarative/particles/defaultshaders/imagevertex.shader | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/particles/defaultshaders/imagevertex.shader b/src/declarative/particles/defaultshaders/imagevertex.shader index a572d73050..e1033c9165 100644 --- a/src/declarative/particles/defaultshaders/imagevertex.shader +++ b/src/declarative/particles/defaultshaders/imagevertex.shader @@ -20,6 +20,8 @@ uniform highp mat4 qt_Matrix; uniform highp float timestamp; #ifdef TABLE varying lowp vec2 tt;//y is progress if Sprite mode +uniform highp float sizetable[64]; +uniform highp float opacitytable[64]; #endif #ifdef SPRITE varying highp vec4 fTexS; @@ -69,6 +71,10 @@ void main() { highp float fadeIn = min(t * 10., 1.); highp float fadeOut = 1. - clamp((t - 0.75) * 4.,0., 1.); +#ifdef TABLE + currentSize = currentSize * sizetable[int(floor(t*64.))]; + fade = fade * opacitytable[int(floor(t*64.))]; +#endif if (entry == 1.) fade = fadeIn * fadeOut; else if(entry == 2.) |