/* DO NOT EDIT. * Generated by ../../bin/vtkEncodeString-8.1 * * Define the vtkStickMapperVS string. * * Generated from file: /Volumes/Data/workspace/med-macos-free/ExtProjs/VTK/Rendering/OpenGL2/glsl/vtkStickMapperVS.glsl */ #include "vtkStickMapperVS.h" const char *vtkStickMapperVS = "//VTK::System::Dec\n" "\n" "/*=========================================================================\n" "\n" " Program: Visualization Toolkit\n" " Module: vtkSphereMapperVS.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" "// this shader implements imposters in OpenGL for Spheres\n" "\n" "attribute vec4 vertexMC;\n" "attribute vec3 orientMC;\n" "attribute vec4 offsetMC;\n" "attribute float radiusMC;\n" "\n" "// optional normal declaration\n" "//VTK::Normal::Dec\n" "\n" "//VTK::Picking::Dec\n" "\n" "// Texture coordinates\n" "//VTK::TCoord::Dec\n" "\n" "uniform mat3 normalMatrix; // transform model coordinate directions to view coordinates\n" "\n" "// material property values\n" "//VTK::Color::Dec\n" "\n" "// clipping plane vars\n" "//VTK::Clip::Dec\n" "\n" "// camera and actor matrix values\n" "//VTK::Camera::Dec\n" "\n" "varying vec4 vertexVCVSOutput;\n" "varying float radiusVCVSOutput;\n" "varying float lengthVCVSOutput;\n" "varying vec3 centerVCVSOutput;\n" "varying vec3 orientVCVSOutput;\n" "\n" "uniform int cameraParallel;\n" "\n" "void main()\n" "{\n" " //VTK::Picking::Impl\n" "\n" " //VTK::Color::Impl\n" "\n" " //VTK::Normal::Impl\n" "\n" " //VTK::TCoord::Impl\n" "\n" " //VTK::Clip::Impl\n" "\n" " vertexVCVSOutput = MCVCMatrix * vertexMC;\n" " centerVCVSOutput = vertexVCVSOutput.xyz;\n" " radiusVCVSOutput = radiusMC;\n" " lengthVCVSOutput = length(orientMC);\n" " orientVCVSOutput = normalMatrix * normalize(orientMC);\n" "\n" " // make sure it is pointing out of the screen\n" " if (orientVCVSOutput.z < 0.0)\n" " {\n" " orientVCVSOutput = -orientVCVSOutput;\n" " }\n" "\n" " // make the basis\n" " vec3 xbase;\n" " vec3 ybase;\n" " vec3 dir = vec3(0.0,0.0,1.0);\n" " if (cameraParallel == 0)\n" " {\n" " dir = normalize(-vertexVCVSOutput.xyz);\n" " }\n" " if (abs(dot(dir,orientVCVSOutput)) == 1.0)\n" " {\n" " xbase = normalize(cross(vec3(0.0,1.0,0.0),orientVCVSOutput));\n" " ybase = cross(xbase,orientVCVSOutput);\n" " }\n" " else\n" " {\n" " xbase = normalize(cross(orientVCVSOutput,dir));\n" " ybase = cross(orientVCVSOutput,xbase);\n" " }\n" "\n" " vec3 offsets = offsetMC.xyz*2.0-1.0;\n" " vertexVCVSOutput.xyz = vertexVCVSOutput.xyz +\n" " radiusVCVSOutput*offsets.x*xbase +\n" " radiusVCVSOutput*offsets.y*ybase +\n" " 0.5*lengthVCVSOutput*offsets.z*orientVCVSOutput;\n" "\n" " gl_Position = VCDCMatrix * vertexVCVSOutput;\n" "}\n" "\n";