void GraphicsGL2::DrawScene(std::ostream & error_output) { renderscene.SetFlags(using_shaders); renderscene.SetFSAA(fsaa); renderscene.SetContrast(contrast); renderscene.SetSunDirection(light_direction); postprocess.SetContrast(contrast); postprocess.SetSunDirection(light_direction); // sort the two dimentional drawlist so we get correct ordering std::sort(dynamic_drawlist.twodim.begin(),dynamic_drawlist.twodim.end(),&SortDraworder); // do fast culling queries for static geometry per pass std::map <std::string, PtrVector <Drawable> > culled_static_drawlist; for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { CullScenePass(*i, culled_static_drawlist, error_output); } // draw the passes for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { DrawScenePass(*i, culled_static_drawlist, error_output); } }
void GRAPHICS_GL2::DrawScene(std::ostream & error_output) { renderscene.SetFlags(using_shaders); renderscene.SetFSAA(fsaa); if (reflection_status == REFLECTION_STATIC) renderscene.SetReflection(&static_reflection); renderscene.SetAmbient(static_ambient); renderscene.SetContrast(contrast); postprocess.SetContrast(contrast); // sort the two dimentional drawlist so we get correct ordering std::sort(dynamic_drawlist.twodim.begin(),dynamic_drawlist.twodim.end(),&SortDraworder); std::map <std::string, PTRVECTOR <DRAWABLE> > culled_static_drawlist; // do fast culling queries for static geometry per pass for (std::vector <GRAPHICS_CONFIG_PASS>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { CullScenePass(*i, culled_static_drawlist, error_output); } // construct light position MATHVECTOR <float, 3> lightposition(0,0,1); (-lightdirection).RotateVector(lightposition); renderscene.SetSunDirection(lightposition); postprocess.SetSunDirection(lightposition); // draw the passes for (std::vector <GRAPHICS_CONFIG_PASS>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { DrawScenePass(*i, culled_static_drawlist, error_output); } }
void GraphicsGL2::DrawScene(std::ostream & error_output) { renderscene.SetFSAA(fsaa); renderscene.SetContrast(contrast); renderscene.SetSunDirection(light_direction); postprocess.SetContrast(contrast); postprocess.SetSunDirection(light_direction); // sort the two dimentional drawlist so we get correct ordering std::sort(dynamic_drawlist.twodim.begin(), dynamic_drawlist.twodim.end(), &SortDraworder); // do fast culling queries for static geometry per pass std::map <std::string, PtrVector <Drawable> > culled_static_drawlist; for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { CullScenePass(*i, culled_static_drawlist, error_output); } // draw the passes for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { assert(!i->draw.empty()); if (i->draw.back() != "postprocess") DrawScenePass(*i, culled_static_drawlist, error_output); else DrawScenePassPost(*i, error_output); } // reset texture and draw buffer glstate.BindTexture(0, GL_TEXTURE_2D, 0); glstate.BindFramebuffer(GL_FRAMEBUFFER, 0); }
void GraphicsGL2::DrawScene(std::ostream & error_output) { // vertex object might have been modified ouside, reset it glstate.ResetVertexObject(); // draw the passes for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++) { assert(!i->draw.empty()); if (i->draw.back() != "postprocess") DrawScenePass(*i, error_output); else DrawScenePassPost(*i, error_output); } // reset texture and draw buffer glstate.BindTexture(0, GL_TEXTURE_2D, 0); glstate.BindFramebuffer(GL_FRAMEBUFFER, 0); }