From: Mikko Rasa Date: Sun, 10 Oct 2010 18:26:19 +0000 (+0000) Subject: Rendering improvements X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e8987fa39c3275a0a293b011e83bccd322e0958a;p=r2c2.git Rendering improvements --- diff --git a/source/3d/path.cpp b/source/3d/path.cpp index e413ace..b3b2fa1 100644 --- a/source/3d/path.cpp +++ b/source/3d/path.cpp @@ -63,7 +63,7 @@ void Path3D::set_layer(float l) void Path3D::render(const GL::Tag &tag) const { - if(tag==0) + if(tag=="unlit") { unsigned mask = (automatic ? 1<render_all(); GL::enable(GL_CULL_FACE); - overlay->render(0); + { + GL::Bind bind_blend(GL::Blend::alpha()); + overlay->render(0); + } GL::Bind bind_depth(GL::DepthTest::lequal()); manipulator.render(); diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index 59aaeec..5cf22ba 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -97,14 +97,20 @@ Engineer::Engineer(int argc, char **argv): DataFile::load(arrow_mesh, "arrow.mesh"); pipeline.set_camera(&camera); - pipeline.add_renderable(layout_3d.get_scene()); + pipeline.add_renderable_for_pass(layout_3d.get_scene(), 0); + pipeline.add_renderable_for_pass(layout_3d.get_path_scene(), "unlit"); - light.set_position(0, -0.259, 0.966, 0); + light.set_position(GL::Vector4(0, -0.259, 0.966, 0)); + light.set_diffuse(GL::Color(0.9)); + lighting.set_ambient(GL::Color(0.4)); lighting.attach(0, light); - GL::PipelinePass &pass = pipeline.add_pass(0); - pass.depth_test = &GL::DepthTest::lequal(); - pass.lighting = &lighting; + GL::PipelinePass *pass = &pipeline.add_pass(0); + pass->depth_test = &GL::DepthTest::lequal(); + pass->lighting = &lighting; + + pass = &pipeline.add_pass("unlit"); + pass->depth_test = &GL::DepthTest::lequal(); view_all(); @@ -192,10 +198,6 @@ void Engineer::tick() GL::Framebuffer::system().clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT); pipeline.render_all(); - { - GL::Bind depth(GL::DepthTest::lequal()); - layout_3d.get_path_scene().render(); - } { GL::Bind blend(GL::Blend::alpha()); overlay->render(0);