// ============================================================================ // // Program: Visualization Toolkit // Module: vtkShadowMapPassShader_vs.glsl // // Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen // All rights reserved. // See Copyright.txt or http://www.kitware.com/Copyright.htm for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. // // ============================================================================ // Vertex shader used by the shadow mapping render pass. #version 110 // NOTE: this shader is concatened on the fly by vtkShadowMapPass.cxx by adding // a line at the beginning like: // #define VTK_LIGHTING_NUMBER_OF_LIGHTS equal to the number of shadowing // lights. void propFuncVS(); // defined in vtkLighting_s.glsl void lightSeparateSpecularColor(gl_LightSourceParameters lightSource, gl_MaterialParameters m, vec3 surfacePosEyeCoords, vec3 n, bool twoSided, inout vec4 cpri, inout vec4 csec); void initBlackColors(out vec4 cpri, out vec4 csec); // input are // uniform gl_TextureMatrix[VTK_LIGHTING_NUMBER_OF_LIGHTS]; varying vec4 shadowCoord[VTK_LIGHTING_NUMBER_OF_LIGHTS]; varying vec4 frontColors[VTK_LIGHTING_NUMBER_OF_LIGHTS]; void main(void) { vec4 heyeCoords=gl_ModelViewMatrix*gl_Vertex; vec3 eyeCoords=heyeCoords.xyz/heyeCoords.w; vec3 n=gl_NormalMatrix*gl_Normal; n=normalize(n); int i=0; while(i