//============================================================================= // // Project: SharpImage // Module: shader-v-copyinvert.frag // Language: OpenGL Shading Language (GLSL) // Author: Dan Mueller // Date: $Date: 2007-09-26 15:20:34 +1000 (Wed, 26 Sep 2007) $ // Revision: $Revision: 26 $ // // Copyright (c) Queensland University of Technology (QUT) 2007. // All rights reserved. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the copyright notices for more information. // //============================================================================= uniform sampler3D sam3Tex0; // Sampler for transfer function uniform sampler3D sam3Tex1; // Sampler for value image void main() { // Interpolate images float value = texture3D( sam3Tex1, gl_TexCoord[1] ).a; float valueinvert = 1.0 - value; // Discard if no contribution // if (value <= 0.0) discard; // Set color otherwise gl_FragColor = vec4( valueinvert, valueinvert, valueinvert, 1.0 ); }