ProjectedTextures
Prototype software for spacial augmented reality applications.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ShaderManager Class Reference

#include <ShaderManager.h>

Inheritance diagram for ShaderManager:

Public Member Functions

 ShaderManager (QWidget *parent=0)
 
 ~ShaderManager (void)
 
QOpenGLShaderProgram * prepareViewportTexture ()
 
QOpenGLShaderProgram * prepareVertexColor (QMatrix4x4 modelMatrix, QMatrix4x4 viewMatrix, QMatrix4x4 projMatrix, int colorSet, bool enableLambert, bool enableSpecular, QVector3D lightPos, QVector3D cameraPos, bool enableIntensityCorrection=false, float shininess=20.0f, QVector3D specularColor=QVector3D(1.0f, 1.0f, 1.0f))
 
QOpenGLShaderProgram * prepareNormal (QMatrix4x4 modelMatrix, QMatrix4x4 viewMatrix, QMatrix4x4 projMatrix)
 

Protected Member Functions

void initializeGL ()
 
void initShaders ()
 

Protected Attributes

QOpenGLShaderProgram viewportTexture
 
QOpenGLShaderProgram vertexColor
 
QOpenGLShaderProgram normal
 

Detailed Description

Compiles and links predefined shader programs and assigns their attribute locations. If this QGLWidget is given to another one as a "share widget", the OpenGL context is shared and the other widget can use the shaders that have been created here.

Constructor & Destructor Documentation

ShaderManager::ShaderManager ( QWidget *  parent = 0)
ShaderManager::~ShaderManager ( void  )

Member Function Documentation

void ShaderManager::initializeGL ( )
protected

OpenGL initializations

void ShaderManager::initShaders ( )
protected

compile and link all shaders and assign their attribute locations

QOpenGLShaderProgram * ShaderManager::prepareNormal ( QMatrix4x4  modelMatrix,
QMatrix4x4  viewMatrix,
QMatrix4x4  projMatrix 
)

prepare the normal shader right before use: bind it and set all uniforms (as given by the function parameters)

QOpenGLShaderProgram * ShaderManager::prepareVertexColor ( QMatrix4x4  modelMatrix,
QMatrix4x4  viewMatrix,
QMatrix4x4  projMatrix,
int  colorSet,
bool  enableLambert,
bool  enableSpecular,
QVector3D  lightPos,
QVector3D  cameraPos,
bool  enableIntensityCorrection = false,
float  shininess = 20.0f,
QVector3D  specularColor = QVector3D(1.0f,1.0f,1.0f) 
)

prepare the vertex color shader right before use: bind it and set all uniforms (as given by the function parameters)

QOpenGLShaderProgram * ShaderManager::prepareViewportTexture ( )

prepare the viewport texture shader right before use: bind it and set its uniforms

Member Data Documentation

QOpenGLShaderProgram ShaderManager::normal
protected

renders virtual objects; coloring through color coded normals

QOpenGLShaderProgram ShaderManager::vertexColor
protected

renders virtual objects; coloring through vertex colors

QOpenGLShaderProgram ShaderManager::viewportTexture
protected
 is used to draw a ViewportSquare that fills 

the screen and shows a texture


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