Commit 4ac72d51 authored by schultezub's avatar schultezub

added checkerboard pattern for transparent areas to DataContainerInspectorCanvas

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@298 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 93fc0af1
......@@ -35,6 +35,15 @@ out vec4 out_Color;
uniform Texture2D _texture;
uniform vec4 _color;
const vec4 checkerboardColor1 = vec4(0.75, 0.75, 0.75, 1.0);
const vec4 checkerboardColor2 = vec4(0.50, 0.50, 0.50, 1.0);
void main() {
out_Color = getElement2DNormalized(_texture, ex_TexCoord.xy);
// mix with fancy checkerboard pattern:
if ((mod(ex_TexCoord.x * 10.0, 2.0) > 1.0) ^^ (mod(ex_TexCoord.y * 10.0, 2.0) > 1.0))
out_Color = mix(checkerboardColor1, out_Color, out_Color.a);
else
out_Color = mix(checkerboardColor2, out_Color, out_Color.a);
}
......@@ -78,6 +78,7 @@ namespace TUMVis {
_paintShader->setAttributeLocation(0, "in_Position");
_paintShader->setAttributeLocation(1, "in_TexCoords");
// set this as painter to get notified when window size changes
setPainter(this, false);
}
......
......@@ -94,8 +94,8 @@ namespace TUMVis {
*/
void paint();
/// This is meant be overridden to adjust camera settings to new canvas dimensions
virtual void sizeChanged(const tgt::ivec2&);
/// This is meant be overridden to adjust camera settings to new canvas dimensions
virtual void sizeChanged(const tgt::ivec2&);
private slots:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment