summaryrefslogtreecommitdiff
path: root/mainwin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mainwin.cc')
-rw-r--r--mainwin.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/mainwin.cc b/mainwin.cc
index 4ed76a9..dc0c8e8 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -419,6 +419,9 @@ static void renderGLviaOpenCSG(void *vp)
if (m->root_chain) {
std::vector<OpenCSG::Primitive*> primitives;
+ GLint e1 = glGetAttribLocation(m->screen->edgeshader_prog, "e1");
+ GLint e2 = glGetAttribLocation(m->screen->edgeshader_prog, "e2");
+ GLint e3 = glGetAttribLocation(m->screen->edgeshader_prog, "e3");
int j = 0;
for (int i = 0;; i++)
{
@@ -428,15 +431,15 @@ static void renderGLviaOpenCSG(void *vp)
{
OpenCSG::render(primitives, OpenCSG::Goldfeather, OpenCSG::NoDepthComplexitySampling);
glDepthFunc(GL_EQUAL);
+ glUseProgram(m->screen->edgeshader_prog);
for (; j < i; j++) {
if (m->root_chain->types[j] == CSGTerm::DIFFERENCE) {
- m->root_chain->polysets[j]->render_surface(PolySet::COLOR_CUTOUT);
- m->root_chain->polysets[j]->render_edges(PolySet::COLOR_CUTOUT);
+ m->root_chain->polysets[j]->render_surface(PolySet::COLOR_CUTOUT, e1, e2, e3);
} else {
- m->root_chain->polysets[j]->render_surface(PolySet::COLOR_MATERIAL);
- m->root_chain->polysets[j]->render_edges(PolySet::COLOR_MATERIAL);
+ m->root_chain->polysets[j]->render_surface(PolySet::COLOR_MATERIAL, e1, e2, e3);
}
}
+ glUseProgram(0);
for (unsigned int k = 0; k < primitives.size(); k++) {
delete primitives[k];
}
contact: Jan Huwald // Impressum