Commit ad28fd9c by Philipp Adolf

Fix variable names

parent 067556e5
......@@ -109,14 +109,23 @@ void MainWidget::initializeGL(){
QString vertSource = QLatin1String(":/subdivide.vert");
QString tesselationControlSource = QLatin1String(":/subdivide.tcs");
QString tesselationEvaluationSource = QLatin1String(":/subdivide.tes");
QString tesselationControlSource2 = QLatin1String(":/subdivideRegular.tcs");
QString tesselationEvaluationSource2 = QLatin1String(":/subdivideRegular.tes");
QString tesselationControlSourceRegular = QLatin1String(":/subdivideRegular.tcs");
QString tesselationEvaluationSourceRegular = QLatin1String(":/subdivideRegular.tes");
QString geometrySource = QLatin1String(":/subdivide.geo");
QString fragSource = QLatin1String(":/subdivide.frag");
subdevisionShader = initShaderProgram(vertSource,tesselationControlSource,tesselationEvaluationSource,geometrySource,fragSource);
regularShader = initShaderProgram(vertSource,tesselationControlSource2,tesselationEvaluationSource2,geometrySource,fragSource);
subdivisionShader = initShaderProgram(vertSource,
tesselationControlSource,
tesselationEvaluationSource,
geometrySource,
fragSource);
regularShader = initShaderProgram(
vertSource,
tesselationControlSourceRegular,
tesselationEvaluationSourceRegular,
geometrySource,
fragSource);
subdivision->init();
//loadNewMesh( "../Models/demon_head.3ds");
......@@ -227,27 +236,27 @@ void MainWidget::paintGL(){
}
subdevisionShader->bind();
subdevisionShader->setUniformValue("wireframe",wireframe);
subdevisionShader->setUniformValue("colorTexture",0);
subdevisionShader->setUniformValue("LightPos",QVector3D(0,100,100));
subdevisionShader->setUniformValue("subdiv",1);
subdivisionShader->bind();
subdivisionShader->setUniformValue("wireframe",wireframe);
subdivisionShader->setUniformValue("colorTexture",0);
subdivisionShader->setUniformValue("LightPos",QVector3D(0,100,100));
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){
glEnable (GL_BLEND);
glDepthMask(GL_FALSE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
subdevisionShader->setUniformValue("wireframe",false);
mesh->render(subdevisionShader,cam->getMatrix()*rot, m_projection,0,false);
subdivisionShader->setUniformValue("wireframe",false);
mesh->render(subdivisionShader,cam->getMatrix()*rot, m_projection,0,false);
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);
}
subdevisionShader->release();
subdivisionShader->release();
......
......@@ -53,7 +53,7 @@ private:
Camera *cam;
QOpenGLShaderProgram* subdevisionShader;
QOpenGLShaderProgram* subdivisionShader;
QOpenGLShaderProgram* regularShader;
QMatrix4x4 m_projection;
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