MeVisLab Toolbox Reference
View2DShaderGLSL Class Reference

specialized shader that uses GLSL to implement a (up-to) 16 bit Hardware Lut More...

#include <View2DShaderGLSL.h>

Inheritance diagram for View2DShaderGLSL:
View2DTextureLUTShader View2DShader

Classes

struct  Shader
 Stores a full shader program for the given configuration. More...
 
struct  ShaderConfig
 Stores a shader configuration. More...
 

Public Member Functions

 View2DShaderGLSL ()
 
 ~View2DShaderGLSL () override
 
void bind (View2DTexture *texture, int tw, int th) override
 binds/activates the shader
 
const charname () override
 get the shader's name
 
void unbind () override
 deactivates the shader
 
- Public Member Functions inherited from View2DTextureLUTShader
 View2DTextureLUTShader ()
 
 ~View2DTextureLUTShader () override
 
void bindFilterKernelTexture () override
 bind the filter kernel texture
 
void bindLutTexture () override
 bind the lut texture to the current texture unit
 
float getLutHeightScaleFactor () override
 
SbVec2s getLutTextureSize () override
 
- Public Member Functions inherited from View2DShader
 View2DShader ()
 
virtual ~View2DShader ()
 
virtual void getRequiredTextureLayout (View2DTexture *texture, GLuint &format, GLuint &internalFormat, GLuint &transferDataType)
 returns the required texture layout that a GL texture must use, as GL_format enums and datatypes
 
virtual void setLut (View2DLut *newLut)
 sets the lut currently used
 
View2DLutgetLut ()
 gets the lut
 
void invalidateLut ()
 invalidate the lut
 

Static Public Member Functions

static bool mayUseShaders ()
 returns if GLSL shaders may be used
 
static bool runsInHardware ()
 returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)
 
- Static Public Member Functions inherited from View2DShader
static void applyTextureFilter (View2DTextureFilter filter)
 set the correct texture filtering on the currently bound texture
 

Additional Inherited Members

- Protected Member Functions inherited from View2DTextureLUTShader
void createLutTexture ()
 creates a 2D texture from the shader's LUT
 
void updateLutTexture ()
 upload the lut to the texture (texture must be already created)
 
void destroyLutTexture ()
 frees the lut texture
 
void createFilterKernelTexture ()
 create 1d filter kernel texture (using the approach described in section 20.2 of GPU Gems 2)
 
void destroyFilterKernelTexture ()
 destroy the filter kernel
 
- Static Protected Member Functions inherited from View2DTextureLUTShader
static GLint desiredLutTextureFormat ()
 
- Protected Attributes inherited from View2DTextureLUTShader
ml::GLTexture _lutTexture
 texture that stores the LUT data
 
GLint _lutTextureFormat
 
ml::GLTexture _kernelTexture
 
int _lutTextureWidth
 power-of-two width of lut texture
 
int _lutTextureHeight
 power-of-two height of lut texture
 
int _lutHeight
 number of COMPLETE texture rows used by the LUT (an additional row may be used partly)
 
- Protected Attributes inherited from View2DShader
View2DLut_lut
 pointer to the LUT data
 
ml::LUTDataId _lastLutChangeID
 id of last lut
 
int _lastLutSize
 last size of lut
 

Detailed Description

specialized shader that uses GLSL to implement a (up-to) 16 bit Hardware Lut

The RGBA LookupTable is loaded into a 2D texture of 256 pixels width and dynamic height. The texture lookups and color interpolation is done with two "assembly" fragment programs, one for bilinear interpolation and one for nearest neigbor interpolation. The shader interacts with the View2DTexture and it's bind message is called by each subtexture that the View2DTexture renders. This is done because the size of the textures changes and this size is needed as local parameters in the fragment program.

Definition at line 32 of file View2DShaderGLSL.h.

Constructor & Destructor Documentation

◆ View2DShaderGLSL()

View2DShaderGLSL::View2DShaderGLSL ( )

◆ ~View2DShaderGLSL()

View2DShaderGLSL::~View2DShaderGLSL ( )
override

Member Function Documentation

◆ bind()

void View2DShaderGLSL::bind ( View2DTexture * texture,
int tw,
int th )
overridevirtual

binds/activates the shader

Implements View2DShader.

◆ mayUseShaders()

static bool View2DShaderGLSL::mayUseShaders ( )
static

returns if GLSL shaders may be used

◆ name()

const char * View2DShaderGLSL::name ( )
overridevirtual

get the shader's name

Implements View2DShader.

◆ runsInHardware()

static bool View2DShaderGLSL::runsInHardware ( )
static

returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)

◆ unbind()

void View2DShaderGLSL::unbind ( )
overridevirtual

deactivates the shader

Implements View2DShader.


The documentation for this class was generated from the following file: