#pragma once #include "GLUtil.h" #include "BuiltinPipeline.h" #include "WithCamera.h" #include "SunShaderProgram.h" #include "SunBatch.h" namespace charcoal { namespace builtin { namespace sun { // TODO: May want to abstract this into a base pipeline class since this is the same as basic::Pipeline class Pipeline : public builtin::Pipeline, public WithCamera { public: void set_sun_direction(const vec3& direction) { m_sun_direction = direction; } void set_sun_color(const Color& color) { m_sun_color = color; } protected: void prepare_opengl() override { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); } void prepare_uniforms() override { glutil::uniform_matrix(0, get_camera()->get_world_to_view_matrix()); glutil::uniform_vec3(4, get_camera()->get_position()); glutil::uniform_uint(5, (unsigned int)m_lights.size()); glutil::uniform_lights(6, m_lights); } private: vec3 m_sun_direction; Color m_sun_color; }; } } }