]> git.tdb.fi Git - r2c2.git/commitdiff
Rendering improvements
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2010 18:26:19 +0000 (18:26 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2010 18:26:19 +0000 (18:26 +0000)
source/3d/path.cpp
source/designer/designer.cpp
source/engineer/engineer.cpp

index e413ace021d2bec89cb7b132832b5b93919621db..b3b2fa1645ad367084d32535afc73bc5614a0a31 100644 (file)
@@ -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<<track.get_track().get_active_path() : paths);
                mask &= track.get_track().get_type().get_paths();
index eb2af23d06f48884927fc7ce1ccc1e4d440349c8..c6d253e30b275b76d4a62d9f29228ae480ee1815 100644 (file)
@@ -436,7 +436,10 @@ void Designer::render()
        {
                pipeline->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();
index 59aaeeca9f9e3aef5677ccc5196c7a0d6b57a1a1..5cf22ba0f2f9c8390f557a26fb000bd1f5a6c23d 100644 (file)
@@ -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);