diff options
Diffstat (limited to 'src/declarative/particles/defaultshaders/tabledfragment.shader')
-rw-r--r-- | src/declarative/particles/defaultshaders/tabledfragment.shader | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/declarative/particles/defaultshaders/tabledfragment.shader b/src/declarative/particles/defaultshaders/tabledfragment.shader new file mode 100644 index 0000000000..e92d8050eb --- /dev/null +++ b/src/declarative/particles/defaultshaders/tabledfragment.shader @@ -0,0 +1,23 @@ +uniform sampler2D texture; +uniform sampler2D colortable; +uniform sampler2D opacitytable; +uniform sampler2D sizetable; +uniform lowp float qt_Opacity; + +varying highp vec2 fTex; +varying lowp vec4 fColor; +varying lowp float tt; + +void main() { + highp vec2 tex = (((fTex - 0.5) / texture2D(sizetable, vec2(tt, 0.5)).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); + }else{ + color = vec4(0.,0.,0.,0.); + } + gl_FragColor = color + * fColor + * texture2D(colortable, vec2(tt, 0.5)) + * (texture2D(opacitytable, vec2(tt, 0.5)).w * qt_Opacity); +} |