diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-26 13:29:48 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-26 13:29:48 (GMT) |
commit | cc913b4d8f8b62800223b1a86170077cf799dced (patch) | |
tree | 6516b214ef77a5da91d52772f535a0a24579693e /mainwin.cc | |
parent | cdc62b4f286ae24d162d940e09faafc75628c7e4 (diff) |
Clifford Wolf:
Added shader for pseudo-edges in opencsg mode
git-svn-id: http://svn.clifford.at/openscad/trunk@24 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'mainwin.cc')
-rw-r--r-- | mainwin.cc | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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]; } |