diff options
Diffstat (limited to 'examples/quick/scenegraph/fboitem/shaders/checker.frag')
-rw-r--r-- | examples/quick/scenegraph/fboitem/shaders/checker.frag | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/quick/scenegraph/fboitem/shaders/checker.frag b/examples/quick/scenegraph/fboitem/shaders/checker.frag new file mode 100644 index 0000000000..044b3bad58 --- /dev/null +++ b/examples/quick/scenegraph/fboitem/shaders/checker.frag @@ -0,0 +1,14 @@ +uniform lowp vec4 color1; +uniform lowp vec4 color2; +uniform highp vec2 pixelSize; + +varying highp vec2 qt_TexCoord0; + +void main() +{ + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); + if (tc.x != tc.y) + gl_FragColor = color1; + else + gl_FragColor = color2; +} |