Пример #1
0
bool update(float delta_time) {
  // Rotate the teapot
  meshes["teapot"].get_transform().rotate(vec3(0.0f, 0.0f, half_pi<float>()) * delta_time);

  // *********************************
  // Update the shadow map properties from the spot light
  shadow.light_position = spot.get_position();
  shadow.light_dir = spot.get_direction();
  // *********************************

  // Press s to save
  if (glfwGetKey(renderer::get_window(), 'S') == GLFW_PRESS) {
    shadow.buffer->save("test.png");
  }

  cam.update(delta_time);

  return true;
}