diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2015-01-12 14:50:36 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-01-12 19:07:09 +0100 |
commit | a33879b811e1c495ce0686edb6ab3a4e3a9539c4 (patch) | |
tree | 811b0073521d53c707b058ef6420b873baf5dfa7 /src/quick/scenegraph/shaders | |
parent | 3373f67d47a3f0e2a191dec4d7d97cc0a1b02e2d (diff) |
Clean up renderer visualization a bit.
viewport was currently unused and adreno 305 was confused by
the tweak.w > 0.0 when the input was 0.0f, so write it
in a slightly more straightforward manner.
Change-Id: I101ff71dcb04ca531e91cc5522876d71f368cdc8
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/quick/scenegraph/shaders')
-rw-r--r-- | src/quick/scenegraph/shaders/visualization.frag | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders/visualization.vert | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/scenegraph/shaders/visualization.frag b/src/quick/scenegraph/shaders/visualization.frag index 205b726c03..6cfeac1985 100644 --- a/src/quick/scenegraph/shaders/visualization.frag +++ b/src/quick/scenegraph/shaders/visualization.frag @@ -1,11 +1,11 @@ uniform lowp vec4 color; -uniform mediump vec4 tweak; // x,y -> width, height; z -> intensity of ; +uniform lowp float pattern; varying mediump vec2 pos; void main(void) { lowp vec4 c = color; - c.xyz += pow(max(sin(pos.x + pos.y), 0.0), 2.0) * tweak.z * 0.1; + c.xyz += pow(max(sin(pos.x + pos.y), 0.0), 2.0) * pattern * 0.1; gl_FragColor = c; } diff --git a/src/quick/scenegraph/shaders/visualization.vert b/src/quick/scenegraph/shaders/visualization.vert index 591eb12ed6..e110f51c99 100644 --- a/src/quick/scenegraph/shaders/visualization.vert +++ b/src/quick/scenegraph/shaders/visualization.vert @@ -2,8 +2,8 @@ attribute highp vec4 v; uniform highp mat4 matrix; uniform highp mat4 rotation; -// w -> apply 3d rotation and projection -uniform mediump vec4 tweak; +// set to 1 if projection is enabled +uniform bool projection; varying mediump vec2 pos; @@ -11,7 +11,7 @@ void main() { vec4 p = matrix * v; - if (tweak.w > 0.0) { + if (projection) { vec4 proj = rotation * p; gl_Position = vec4(proj.x, proj.y, 0, proj.z); } else { |