ProjectedTextures
Prototype software for spacial augmented reality applications.
|
#include <ShaderManager.h>
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 |
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.
ShaderManager::ShaderManager | ( | QWidget * | parent = 0 ) |
ShaderManager::~ShaderManager | ( | void | ) |
|
protected |
OpenGL initializations
|
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
|
protected |
renders virtual objects; coloring through color coded normals
|
protected |
renders virtual objects; coloring through vertex colors
|
protected |
is used to draw a ViewportSquare that fills
the screen and shows a texture