//============================================================================= // // Project: SharpImage // Module: shader-vm-noadjust.frag // Language: OpenGL Shading Language (GLSL) // Author: Dan Mueller // Date: $Date: 2007-10-01 06:48:46 +1000 (Mon, 01 Oct 2007) $ // Revision: $Revision: 27 $ // // 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 uniform sampler3D sam3Tex2; // Sampler for gradient image void main() { // Interpolate images float value = texture3D( sam3Tex1, gl_TexCoord[1] ).a; float grad = texture3D( sam3Tex2, gl_TexCoord[2] ).a; // Interpolate transfer function vec3 pos3Tf = vec3( value, 1.0-grad, 0.0 ); vec4 val4Tf = texture3D( sam3Tex0, pos3Tf ); // Discard if no contribution if (val4Tf.a <= 0.0) discard; // Set color gl_FragColor = val4Tf; }