/* DO NOT EDIT.
 * Generated by ../bin/vtkEncodeString
 * 
 * Define the vtkSobelGradientMagnitudePassShader2_fs string.
 *
 * Generated from file: /home/dorado1/vtk/VTK5.10.1/Rendering/vtkSobelGradientMagnitudePassShader2_fs.glsl
 */
#include "vtkSobelGradientMagnitudePassShader2_fs.h"
const char *vtkSobelGradientMagnitudePassShader2_fs =
"// ============================================================================\n"
"//\n"
"//  Program:   Visualization Toolkit\n"
"//  Module:    vtkSobelGradientMagnitudePassShader2_fs.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 shader used by the second pass of the Sobel filter render pass.\n"
"\n"
"#version 110\n"
"\n"
"uniform sampler2D gx1;\n"
"uniform sampler2D gy1;\n"
"uniform float step; // 1/H\n"
"\n"
"void main(void)\n"
"{\n"
"  vec2 tcoord=gl_TexCoord[0].st;\n"
"  vec2 offset=vec2(0.0,step);\n"
"  \n"
"  // Gx\n"
"  \n"
"  vec4 tx1=texture2D(gx1,tcoord-offset);\n"
"  vec4 tx2=texture2D(gx1,tcoord);\n"
"  vec4 tx3=texture2D(gx1,tcoord+offset);\n"
"  \n"
"  // if clamped textures, rescale values from [0,1] to [-1,1]\n"
"  tx1=tx1*2.0-1.0;\n"
"  tx2=tx2*2.0-1.0;\n"
"  tx3=tx3*2.0-1.0;\n"
"  \n"
"  vec4 gx=(tx1+2.0*tx2+tx3)/4.0;\n"
"  \n"
"  // Gy\n"
"  \n"
"  vec4 ty1=texture2D(gy1,tcoord-offset);\n"
"  vec4 ty3=texture2D(gy1,tcoord+offset);\n"
"  \n"
"  vec4 gy=ty3-ty1;\n"
"  \n"
"  // the maximum gradient magnitude is sqrt(2.0) when for example gx=1 and\n"
"  // gy=1\n"
"//  gl_FragColor=sqrt((gx*gx+gy*gy)/2.0);\n"
"  gl_FragColor.rgb=sqrt((gx.rgb*gx.rgb+gy.rgb*gy.rgb)/2.0);\n"
"  gl_FragColor.a=1.0; // arbitrary choice.\n"
"}\n"
"\n";

