#include "vtkOutlineGlowUpscalePassFS.h" const char *vtkOutlineGlowUpscalePassFS = "//VTK::System::Dec\n" "\n" "// ============================================================================\n" "//\n" "// Program: Visualization Toolkit\n" "// Module: vtkOutlineGlowUpscalePassFS.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 outline glow pass to combine the original scene and the blurred image to form an outline\n" "\n" "in vec2 tcoordVC;\n" "uniform sampler2D scene;\n" "uniform sampler2D source;\n" "\n" "uniform float outlineIntensity;\n" "\n" "// the output of this shader\n" "//VTK::Output::Dec\n" "\n" "void main(void)\n" "{\n" " vec4 color = texture2D(scene, tcoordVC);\n" " if( length(color.rgb) > 0.0)\n" " {\n" " // If the pixel was filled in the original scene it not part of the outline\n" " gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);\n" " }\n" " else\n" " {\n" " vec4 blurredColor = texture2D(source,tcoordVC);\n" " float brightness = max(blurredColor.r, max(blurredColor.g, blurredColor.b));\n" " gl_FragData[0].rgb = blurredColor.rgb * outlineIntensity;\n" " gl_FragData[0].a = brightness * outlineIntensity;\n" " }\n" "}\n" "";