/* DO NOT EDIT.
 * Generated by ../bin/vtkEncodeString
 * 
 * Define the vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS string.
 *
 * Generated from file: /home/dorado1/vtk/VTK5.10.1/VolumeRendering/vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS.glsl
 */
#include "vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS.h"
const char *vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS =
"/*=========================================================================\n"
"\n"
"  Program:   Visualization Toolkit\n"
"  Module:    vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS.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"
"// Perspective projection.\n"
"\n"
"#version 110\n"
"\n"
"// Entry position (global scope)\n"
"vec3 pos;\n"
"// Incremental vector in texture space (global scope)\n"
"vec3 rayDir;\n"
"\n"
"// Camera position in texture space\n"
"uniform vec3 cameraPosition;\n"
"// Sample distance in world space\n"
"uniform float sampleDistance;\n"
"// Matrix coefficients: diagonal (a11,a22,a33)\n"
"uniform vec3 matrix1;\n"
"// Matrix coefficients: others (2a12,2a23,2a13)\n"
"uniform vec3 matrix2;\n"
"\n"
"// Defined in the right projection method.\n"
"void incrementalRayDirection()\n"
"{\n"
"  // Direction of the ray in texture space, not normalized.\n"
"  rayDir=pos-cameraPosition;\n"
"  \n"
"  // x^2, y^2, z^2\n"
"  vec3 normDir=rayDir*rayDir;\n"
"  normDir.x=dot(normDir,matrix1);\n"
"  \n"
"  // xy,yz,zx\n"
"  vec3 coefs=rayDir*rayDir.yxz;\n"
"  coefs.x=dot(coefs,matrix2);\n"
"\n"
"  // n^2\n"
"  normDir.x=normDir.x+coefs.x;\n"
"  \n"
"  // 1/n\n"
"  // normDir=1/sqrt(normDir)\n"
"  normDir.x=inversesqrt(normDir.x);\n"
"  \n"
"  // Final scale factor for the ray direction in texture space\n"
"  // normDir=normDir*sampleDistance\n"
"  normDir.x=normDir.x*sampleDistance;\n"
"  // Now, rayDir is the incremental direction in texture space\n"
"  rayDir=rayDir*normDir.x;\n"
"}\n"
"\n";

