diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-09-29 17:08:41 +0200 |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-10-02 17:57:17 +0200 |
commit | 385176ad28b3a79bcd196d2d529c4bf7abd4fcc0 (patch) | |
tree | e50e39712472bc672308dac1770261587b3f98b6 /src/opengl/gl2paintengineex/qglengineshadersource_p.h | |
parent | 4f7d94ca73556f3a40631ad07f565995f6f85176 (diff) |
Added support for drawing a pixmap multiple times in one call.
This is internal API.
It's possible to specify a horizontal and vertical scale, rotation,
opacity and source rectangle for each pixmap item.
Useful for particle effects.
Reviewed-by: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex/qglengineshadersource_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadersource_p.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 8ae86d333c..6712bf67f9 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -84,6 +84,20 @@ static const char* const qglslMainWithTexCoordsVertexShader = "\ textureCoords = textureCoordArray; \ }"; +static const char* const qglslMainWithTexCoordsAndOpacityVertexShader = "\ + attribute highp vec2 textureCoordArray; \ + attribute lowp float opacityArray; \ + varying highp vec2 textureCoords; \ + varying lowp float opacity; \ + uniform highp float depth; \ + void setPosition(); \ + void main(void) \ + { \ + setPosition(); \ + gl_Position.z = depth * gl_Position.w; \ + textureCoords = textureCoordArray; \ + opacity = opacityArray; \ + }"; static const char* const qglslPositionOnlyVertexShader = "\ attribute highp vec4 vertexCoordsArray;\ @@ -331,6 +345,12 @@ static const char* const qglslShockingPinkSrcFragmentShader = "\ return vec4(0.98, 0.06, 0.75, 1.0); \ }"; +static const char* const qglslMainFragmentShader_ImageArrays = "\ + varying lowp float opacity; \ + lowp vec4 srcPixel(); \ + void main() { \ + gl_FragColor = srcPixel() * opacity; \ + }"; static const char* const qglslMainFragmentShader_CMO = "\ uniform lowp float globalOpacity; \ |