/usr/include/vtk-5.8/vtkGLSLShader.h is in libvtk5-dev 5.8.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkGLSLShader.h
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.
=========================================================================*/
/*
* Copyright 2003 Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the
* U.S. Government. Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that this Notice and any
* statement of authorship are reproduced on all copies.
*/
// .NAME vtkGLSLShader - GLSL Shader
// .SECTION Description
// vtkGLSLShader is a concrete class that creates and compiles hardware
// shaders written in the OpenGL Shadering Language (GLSL, OpenGL2.0).
// While step linking a vertex and a fragment shader is performed by
// vtkGLSLShaderProgram, all shader parameters are initialized in this
// class.
//
// .Section vtkOpenGLExtensionManager
// All OpenGL calls are made through vtkOpenGLExtensionManager.
//
// .Section Supported Basic Shader Types:
//
// Scalar Types
// uniform float
// uniform int
// uniform int -- boolean scalar not yet tested
//
// Vector Types:
// uniform vec{2|3|4}
// uniform ivec{2|3|4}
// uniform bvec{2|3|4} -- boolean vector not yet tested
//
// Matrix Types:
// uniform mat{2|3|4}
//
// Texture Samplers:
// sample1D -- Not yet implemented in this cless.
// sample2D -- Not yet implemented in this class.
// sample3D -- Not yet implemented in this class.
// sampler1DShadow -- Not yet implemented in this class.
// sampler1DShadow -- Not yet implemented in this class.
//
// User-Defined structures:
// uniform struct
// NOTE: these must be defined and declared outside of the 'main' shader
// function.
//
//
// .SECTION Thanks
// Shader support in VTK includes key contributions by Gary Templet at
// Sandia National Labs.
#ifndef __vtkGLSLShader_h
#define __vtkGLSLShader_h
#include "vtkShader.h"
class vtkActor;
class vtkRenderer;
class vtkProperty;
class vtkLight;
class vtkCamera;
class vtkRenderWindow;
// Manages all shaders defined in the XML file
// especially the part about sending things to the card
class VTK_RENDERING_EXPORT vtkGLSLShader : public vtkShader
{
public:
static vtkGLSLShader *New();
vtkTypeMacro(vtkGLSLShader, vtkShader);
void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Called to compile the shader code.
// The subclasses must only compile the code in this method.
// Returns if the compile was successful.
// Subclasses should compile the code only if it was not
// already compiled.
virtual int Compile();
// Description:
// The vtkGLSLShaderProgram needs the shader handle for attaching.
unsigned int GetHandle() { return this->Shader; }
// Description:
// The Shader needs the id of the ShaderProgram
// to obtain uniform variable locations. This is set
// by vtkGLSLShaderProgram.
vtkSetMacro( Program, unsigned int );
vtkGetMacro( Program, unsigned int );
// Description:
// Release any graphics resources that are being consumed by this actor.
// The parameter window could be used to determine which graphic
// resources to release.
virtual void ReleaseGraphicsResources(vtkWindow *);
protected:
vtkGLSLShader();
virtual ~vtkGLSLShader();
// These are GLuints.
unsigned int Program;
unsigned int Shader;
int IsShader();
int IsCompiled();
// Description:
// Create an empty Shader context.
void LoadShader();
// Description:
// Equivalent to cgGLSetParameter and glUniform.
virtual void SetUniformParameter(const char* name, int numValues, const int* value);
virtual void SetUniformParameter(const char* name, int numValues, const float* value);
virtual void SetUniformParameter(const char* name, int numValues, const double* value);
// Description:
// Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
virtual void SetMatrixParameter(const char* name, int numValues,
int order, const float* value);
virtual void SetMatrixParameter(const char* name, int numValues,
int order, const double* value);
virtual void SetMatrixParameter(const char* name, const char* state_matix_type,
const char* transform_type);
virtual void SetSamplerParameter(const char* name, vtkTexture* texture,
int textureIndex);
private:
vtkGLSLShader(const vtkGLSLShader&); // Not Implemented
void operator=(const vtkGLSLShader&); // Not Implemented
int GetUniformLocation( const char* name );
};
#endif //__vtkGLSLShader_h
|