diff options
Diffstat (limited to 'src/declarative/particles/defaultshaders')
-rw-r--r-- | src/declarative/particles/defaultshaders/imagefragment.shader | 15 | ||||
-rw-r--r-- | src/declarative/particles/defaultshaders/imagevertex.shader | 6 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/declarative/particles/defaultshaders/imagefragment.shader b/src/declarative/particles/defaultshaders/imagefragment.shader index 5286c8519a..c2341fe6ff 100644 --- a/src/declarative/particles/defaultshaders/imagefragment.shader +++ b/src/declarative/particles/defaultshaders/imagefragment.shader @@ -16,8 +16,6 @@ varying lowp float fFade; #ifdef TABLE varying lowp vec2 tt; uniform sampler2D colortable; -uniform sampler2D opacitytable; -uniform sampler2D sizetable; #endif void main() { @@ -25,20 +23,13 @@ void main() { gl_FragColor = mix(texture2D(texture, fTexS.xy), texture2D(texture, fTexS.zw), tt.y) * fColor * texture2D(colortable, tt) - * (texture2D(opacitytable, tt).w * qt_Opacity); + * qt_Opacity; #else #ifdef TABLE - highp vec2 tex = (((fTex - 0.5) / texture2D(sizetable, tt).w) + 0.5); - lowp vec4 color; - if(tex.x < 1.0 && tex.x > 0.0 && tex.y < 1.0 && tex.y > 0.0){//No CLAMP_TO_BORDER in ES2, so have to do it ourselves - color = texture2D(texture, tex);//TODO: Replace with uniform array in vertex shader - }else{ - color = vec4(0.,0.,0.,0.); - } - gl_FragColor = color + gl_FragColor = texture2D(texture, fTex) * fColor * texture2D(colortable, tt) - * (texture2D(opacitytable,tt).w * qt_Opacity); + * qt_Opacity; #else #ifdef DEFORM gl_FragColor = (texture2D(texture, fTex)) * fColor * qt_Opacity; 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.) |