#include <msp/gl/cylinder.h>
#include <msp/gl/environmentmap.h>
#include <msp/gl/framebuffer.h>
#include <msp/gl/cylinder.h>
#include <msp/gl/environmentmap.h>
#include <msp/gl/framebuffer.h>
/* The shadow map is focused on the part of the scene that contains the
pillars and the cube. Making the ground cast shadows as well would result
either in a very low spatial resolution of the shadow map, or ugly artifacts
as the ground crosses the shadow map boundary. */
shadow_scene.set_target(GL::Vector3(0, 0, 0), 10);
/* The shadow map is focused on the part of the scene that contains the
pillars and the cube. Making the ground cast shadows as well would result
either in a very low spatial resolution of the shadow map, or ugly artifacts
as the ground crosses the shadow map boundary. */
shadow_scene.set_target(GL::Vector3(0, 0, 0), 10);
light.set_position(GL::Vector4(0.5, -2, 3, 0));
lighting.attach(0, light);
light.set_position(GL::Vector4(0.5, -2, 3, 0));
lighting.attach(0, light);
// The skybox is rendered first
pipeline.add_pass(0, sky_scene);
// The skybox is rendered first
pipeline.add_pass(0, sky_scene);
/* Initialize a second pipeline to render the environment map. It has the
same renderables and passes, but no postprocessors or camera. */
env_pipeline.add_pass(0, sky_scene);
/* Initialize a second pipeline to render the environment map. It has the
same renderables and passes, but no postprocessors or camera. */
env_pipeline.add_pass(0, sky_scene);
skybox_tex.set_min_filter(GL::LINEAR);
skybox_tex.set_wrap(GL::CLAMP_TO_EDGE);
for(unsigned i=0; i<6; ++i)
skybox_tex.set_min_filter(GL::LINEAR);
skybox_tex.set_wrap(GL::CLAMP_TO_EDGE);
for(unsigned i=0; i<6; ++i)
sand_texture.set_min_filter(GL::LINEAR_MIPMAP_LINEAR);
sand_texture.set_max_anisotropy(4);
sand_texture.set_auto_generate_mipmap(true);
sand_texture.set_min_filter(GL::LINEAR_MIPMAP_LINEAR);
sand_texture.set_max_anisotropy(4);
sand_texture.set_auto_generate_mipmap(true);
cube_material.set_specular(GL::Color(1.0));
cube_material.set_shininess(120);
cube_material.set_reflectivity(0.5);
cube_material.set_specular(GL::Color(1.0));
cube_material.set_shininess(120);
cube_material.set_reflectivity(0.5);