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 More...
 
const char * name () override
 get the shader's name More...
 
void unbind () override
 deactivates the shader More...
 
- Public Member Functions inherited from View2DTextureLUTShader
 View2DTextureLUTShader ()
 
 ~View2DTextureLUTShader () override
 
void bindFilterKernelTexture () override
 bind the filter kernel texture More...
 
void bindLutTexture () override
 bind the lut texture to the current texture unit More...
 
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 More...
 
virtual void setLut (View2DLut *newLut)
 sets the lut currently used More...
 
View2DLutgetLut ()
 gets the lut More...
 
void invalidateLut ()
 invalidate the lut More...
 

Static Public Member Functions

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

Additional Inherited Members

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

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: