Commit ad28fd9c by Philipp Adolf

Fix variable names

parent 067556e5
...@@ -109,14 +109,23 @@ void MainWidget::initializeGL(){ ...@@ -109,14 +109,23 @@ void MainWidget::initializeGL(){
QString vertSource = QLatin1String(":/subdivide.vert"); QString vertSource = QLatin1String(":/subdivide.vert");
QString tesselationControlSource = QLatin1String(":/subdivide.tcs"); QString tesselationControlSource = QLatin1String(":/subdivide.tcs");
QString tesselationEvaluationSource = QLatin1String(":/subdivide.tes"); QString tesselationEvaluationSource = QLatin1String(":/subdivide.tes");
QString tesselationControlSource2 = QLatin1String(":/subdivideRegular.tcs"); QString tesselationControlSourceRegular = QLatin1String(":/subdivideRegular.tcs");
QString tesselationEvaluationSource2 = QLatin1String(":/subdivideRegular.tes"); QString tesselationEvaluationSourceRegular = QLatin1String(":/subdivideRegular.tes");
QString geometrySource = QLatin1String(":/subdivide.geo"); QString geometrySource = QLatin1String(":/subdivide.geo");
QString fragSource = QLatin1String(":/subdivide.frag"); QString fragSource = QLatin1String(":/subdivide.frag");
subdevisionShader = initShaderProgram(vertSource,tesselationControlSource,tesselationEvaluationSource,geometrySource,fragSource); subdivisionShader = initShaderProgram(vertSource,
regularShader = initShaderProgram(vertSource,tesselationControlSource2,tesselationEvaluationSource2,geometrySource,fragSource); tesselationControlSource,
tesselationEvaluationSource,
geometrySource,
fragSource);
regularShader = initShaderProgram(
vertSource,
tesselationControlSourceRegular,
tesselationEvaluationSourceRegular,
geometrySource,
fragSource);
subdivision->init(); subdivision->init();
//loadNewMesh( "../Models/demon_head.3ds"); //loadNewMesh( "../Models/demon_head.3ds");
...@@ -227,27 +236,27 @@ void MainWidget::paintGL(){ ...@@ -227,27 +236,27 @@ void MainWidget::paintGL(){
} }
subdevisionShader->bind(); subdivisionShader->bind();
subdevisionShader->setUniformValue("wireframe",wireframe); subdivisionShader->setUniformValue("wireframe",wireframe);
subdevisionShader->setUniformValue("colorTexture",0); subdivisionShader->setUniformValue("colorTexture",0);
subdevisionShader->setUniformValue("LightPos",QVector3D(0,100,100)); subdivisionShader->setUniformValue("LightPos",QVector3D(0,100,100));
subdevisionShader->setUniformValue("subdiv",1); subdivisionShader->setUniformValue("subdiv",1);
mesh->render(subdevisionShader,cam->getMatrix()*rot, m_projection,subdivLevel,false); mesh->render(subdivisionShader,cam->getMatrix()*rot, m_projection,subdivLevel,false);
if(subdivLevel>0){ if(subdivLevel>0){
glEnable (GL_BLEND); glEnable (GL_BLEND);
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
subdevisionShader->setUniformValue("wireframe",false); subdivisionShader->setUniformValue("wireframe",false);
mesh->render(subdevisionShader,cam->getMatrix()*rot, m_projection,0,false); mesh->render(subdivisionShader,cam->getMatrix()*rot, m_projection,0,false);
glDisable(GL_BLEND); glDisable(GL_BLEND);
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
} }
subdevisionShader->release(); subdivisionShader->release();
......
...@@ -53,7 +53,7 @@ private: ...@@ -53,7 +53,7 @@ private:
Camera *cam; Camera *cam;
QOpenGLShaderProgram* subdevisionShader; QOpenGLShaderProgram* subdivisionShader;
QOpenGLShaderProgram* regularShader; QOpenGLShaderProgram* regularShader;
QMatrix4x4 m_projection; QMatrix4x4 m_projection;
QTime startTime; QTime startTime;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment