Commit 8e20b734 by Kai Westerkamp

subdiv level in render

parent 77ce866a
......@@ -8,6 +8,7 @@ MainWidget::MainWidget(Camera *cam)
wireframe = false;
rotation = true;
subdivision = new Subdivision(this);
subdivLevel = 0;
}
QSize MainWidget::minimumSizeHint() const
......@@ -134,6 +135,7 @@ void MainWidget::loadNewMesh(QString path){
void MainWidget::subdivide(int level){
subdivision->subdivide(mesh);
subdivLevel = level;
}
void MainWidget::setdebugOutput(bool output){
......@@ -211,7 +213,7 @@ void MainWidget::paintGL(){
subdevisionShader->setUniformValue("colorTexture",0);
subdevisionShader->setUniformValue("LightPos",QVector3D(0,100,100));
mesh->render(subdevisionShader,cam->getMatrix()*rot, m_projection);
mesh->render(subdevisionShader,cam->getMatrix()*rot, m_projection,subdivLevel);
subdevisionShader->release();
update();
......
......@@ -25,6 +25,7 @@ public:
bool rotation;
bool wireframe;
int subdivLevel;
public slots:
void loadNewMesh();
......
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