Commit 8e20b734 by Kai Westerkamp

subdiv level in render

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