summaryrefslogtreecommitdiffstats
path: root/examples/effects
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-08-25 14:22:09 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-08-25 14:36:48 (GMT)
commit22e2ba1e5e3345b99f41b62b9984ca6871579122 (patch)
treecdfaf0953a296ea016cba4598a521351185b0eed /examples/effects
parent03bfdba7d45ddbf086376a20568a49525dddf845 (diff)
downloadQt-22e2ba1e5e3345b99f41b62b9984ca6871579122.zip
Qt-22e2ba1e5e3345b99f41b62b9984ca6871579122.tar.gz
Qt-22e2ba1e5e3345b99f41b62b9984ca6871579122.tar.bz2
Fixed documentation and use of incorrect entry point for custom shaders.
The entry point has been changed to be customShader, taking source image and texture coordinates as parameters. Reviewed-by: Tom
Diffstat (limited to 'examples/effects')
-rw-r--r--examples/effects/customshader/customshadereffect.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/effects/customshader/customshadereffect.cpp b/examples/effects/customshader/customshadereffect.cpp
index 58e2f3d..08e4324 100644
--- a/examples/effects/customshader/customshadereffect.cpp
+++ b/examples/effects/customshader/customshadereffect.cpp
@@ -43,10 +43,8 @@
#include <QGLShaderProgram>
static char const colorizeShaderCode[] =
- "varying highp vec2 textureCoords;\n"
- "uniform sampler2D imageTexture;\n"
"uniform lowp vec4 effectColor;\n"
- "lowp vec4 srcPixel() {\n"
+ "mediump vec4 customShader(sampler2D imageTexture, vec2 textureCoords) {\n"
" vec4 src = texture2D(imageTexture, textureCoords);\n"
" float gray = dot(src.rgb, vec3(0.212671, 0.715160, 0.072169));\n"
" vec4 colorize = 1.0-((1.0-gray)*(1.0-effectColor));\n"