/* DO NOT EDIT.
 * Generated by ../bin/vtkEncodeString
 * 
 * Define the vtkGPUVolumeRayCastMapper_MinIPFourDependentFS string.
 *
 * Generated from file: /home/dorado1/vtk/VTK5.10.1/VolumeRendering/vtkGPUVolumeRayCastMapper_MinIPFourDependentFS.glsl
 */
#include "vtkGPUVolumeRayCastMapper_MinIPFourDependentFS.h"
const char *vtkGPUVolumeRayCastMapper_MinIPFourDependentFS =
"/*=========================================================================\n"
"\n"
"  Program:   Visualization Toolkit\n"
"  Module:    vtkGPUVolumeRayCastMapper_MinIPFourDependentFS.glsl\n"
"\n"
"  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n"
"  All rights reserved.\n"
"  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n"
"\n"
"     This software is distributed WITHOUT ANY WARRANTY; without even\n"
"     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
"     PURPOSE.  See the above copyright notice for more information.\n"
"\n"
"=========================================================================*/\n"
"\n"
"// Fragment program with ray cast and 4-dependent-component Minimum Intensity\n"
"// Projection (MinIP) method.\n"
"// Compilation: header part and the projection part are inserted first.\n"
"// pos is defined and initialized in header\n"
"// rayDir is defined in header and initialized in the projection part\n"
"\n"
"#version 110\n"
"\n"
"uniform sampler3D dataSetTexture;\n"
"uniform sampler1D opacityTexture;\n"
"\n"
"uniform vec3 lowBounds;\n"
"uniform vec3 highBounds;\n"
"\n"
"// Entry position (global scope)\n"
"vec3 pos;\n"
"// Incremental vector in texture space (global scope)\n"
"vec3 rayDir;\n"
"\n"
"float tMax;\n"
"\n"
"// Sub-functions, depending on cropping mode\n"
"float initialMinValue();\n"
"vec4 initialColor();\n"
"void writeColorAndMinScalar(vec4 color,\n"
"                            vec4 opacity,\n"
"                            float minValue);\n"
"\n"
"void trace(void)\n"
"{\n"
"  // Max intensity is the lowest value.\n"
"  float minValue=initialMinValue();\n"
"  vec4 color=initialColor();\n"
"  bool inside=true;\n"
"  float t=0.0;\n"
"  vec4 sample;\n"
"  bool changed=false;\n"
"  \n"
"  // We NEED two nested while loops. It is a trick to work around hardware\n"
"  // limitation about the maximum number of loops.\n"
"  while(inside)\n"
"    {\n"
"    while(inside)\n"
"      {\n"
"      sample=texture3D(dataSetTexture,pos);\n"
"      if(sample.w<minValue)\n"
"        {\n"
"        changed=true;\n"
"        minValue=sample.w;\n"
"        color=sample;\n"
"        }\n"
"      pos=pos+rayDir;\n"
"      t+=1.0;\n"
"      \n"
"      // yes, t<tMax && all(greaterThanEqual(pos,lowBounds))\n"
"      // && all(lessThanEqual(pos,highBounds));\n"
"      // looks better but the latest nVidia 177.80 has a bug...\n"
"      inside=t<tMax && pos.x>=lowBounds.x && pos.y>=lowBounds.y\n"
"        && pos.z>=lowBounds.z && pos.x<=highBounds.x && pos.y<=highBounds.y\n"
"        && pos.z<=highBounds.z;\n"
"      }\n"
"    }\n"
"  \n"
"  if(changed)\n"
"    {\n"
"    vec4 opacity=texture1D(opacityTexture,minValue);\n"
"    writeColorAndMinScalar(color,opacity,minValue);\n"
"    }\n"
"  else\n"
"    {\n"
"    discard;\n"
"    }\n"
"}\n"
"\n";

