CG_Labs  2021.2
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
assignment2.cpp File Reference
#include "assignment2.hpp"
#include "config.hpp"
#include "core/Bonobo.h"
#include "core/FPSCamera.h"
#include "core/helpers.hpp"
#include "core/node.hpp"
#include "core/opengl.hpp"
#include "core/ShaderProgramManager.hpp"
#include <imgui.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <tinyfiledialogs.h>
#include <array>
#include <clocale>
#include <cstdlib>
#include <stdexcept>

Classes

struct  anonymous_namespace{assignment2.cpp}::ViewProjTransforms
 
struct  anonymous_namespace{assignment2.cpp}::GeometryTextureData
 
struct  anonymous_namespace{assignment2.cpp}::GBufferShaderLocations
 
struct  anonymous_namespace{assignment2.cpp}::FillShadowmapShaderLocations
 
struct  anonymous_namespace{assignment2.cpp}::AccumulateLightsShaderLocations
 

Namespaces

 constant
 
 anonymous_namespace{assignment2.cpp}
 

Macros

#define GLM_FORCE_PURE   1
 

Typedefs

using anonymous_namespace{assignment2.cpp}::Textures = std::array< GLuint, toU(Texture::Count)>
 
using anonymous_namespace{assignment2.cpp}::Samplers = std::array< GLuint, toU(Sampler::Count)>
 
using anonymous_namespace{assignment2.cpp}::FBOs = std::array< GLuint, toU(FBO::Count)>
 
using anonymous_namespace{assignment2.cpp}::ElapsedTimeQueries = std::array< GLuint, toU(ElapsedTimeQuery::Count)>
 
using anonymous_namespace{assignment2.cpp}::UBOs = std::array< GLuint, toU(UBO::Count)>
 

Enumerations

enum class  anonymous_namespace{assignment2.cpp}::Texture : uint32_t {
  anonymous_namespace{assignment2.cpp}::DepthBuffer = 0u , anonymous_namespace{assignment2.cpp}::ShadowMap , anonymous_namespace{assignment2.cpp}::GBufferDiffuse , anonymous_namespace{assignment2.cpp}::GBufferSpecular ,
  anonymous_namespace{assignment2.cpp}::GBufferWorldSpaceNormal , anonymous_namespace{assignment2.cpp}::LightDiffuseContribution , anonymous_namespace{assignment2.cpp}::LightSpecularContribution , anonymous_namespace{assignment2.cpp}::Result ,
  anonymous_namespace{assignment2.cpp}::Count
}
 
enum class  anonymous_namespace{assignment2.cpp}::Sampler : uint32_t { anonymous_namespace{assignment2.cpp}::Nearest = 0u , anonymous_namespace{assignment2.cpp}::Linear , anonymous_namespace{assignment2.cpp}::Mipmaps , anonymous_namespace{assignment2.cpp}::Count }
 
enum class  anonymous_namespace{assignment2.cpp}::FBO : uint32_t {
  anonymous_namespace{assignment2.cpp}::GBuffer = 0u , anonymous_namespace{assignment2.cpp}::ShadowMap , anonymous_namespace{assignment2.cpp}::LightAccumulation , anonymous_namespace{assignment2.cpp}::Resolve ,
  anonymous_namespace{assignment2.cpp}::FinalWithDepth , anonymous_namespace{assignment2.cpp}::Count
}
 
enum class  anonymous_namespace{assignment2.cpp}::ElapsedTimeQuery : uint32_t {
  anonymous_namespace{assignment2.cpp}::GbufferGeneration = 0u , anonymous_namespace{assignment2.cpp}::ShadowMap0Generation , anonymous_namespace{assignment2.cpp}::Light0Accumulation = ShadowMap0Generation + static_cast<uint32_t>(constant::lights_nb) , anonymous_namespace{assignment2.cpp}::Resolve = Light0Accumulation + static_cast<uint32_t>(constant::lights_nb) ,
  anonymous_namespace{assignment2.cpp}::ConeWireframe , anonymous_namespace{assignment2.cpp}::GUI , anonymous_namespace{assignment2.cpp}::CopyToFramebuffer , anonymous_namespace{assignment2.cpp}::Count
}
 
enum class  anonymous_namespace{assignment2.cpp}::UBO : uint32_t { anonymous_namespace{assignment2.cpp}::CameraViewProjTransforms = 0u , anonymous_namespace{assignment2.cpp}::LightViewProjTransforms , anonymous_namespace{assignment2.cpp}::Count }
 

Functions

template<class E >
constexpr auto anonymous_namespace{assignment2.cpp}::toU (E const &e)
 
Textures anonymous_namespace{assignment2.cpp}::createTextures (GLsizei framebuffer_width, GLsizei framebuffer_height)
 
Samplers anonymous_namespace{assignment2.cpp}::createSamplers ()
 
FBOs anonymous_namespace{assignment2.cpp}::createFramebufferObjects (Textures const &textures)
 
ElapsedTimeQueries anonymous_namespace{assignment2.cpp}::createElapsedTimeQueries ()
 
UBOs anonymous_namespace{assignment2.cpp}::createUniformBufferObjects ()
 
void anonymous_namespace{assignment2.cpp}::fillGBufferShaderLocations (GLuint gbuffer_shader, GBufferShaderLocations &locations)
 
void anonymous_namespace{assignment2.cpp}::fillShadowmapShaderLocations (GLuint shadowmap_shader, FillShadowmapShaderLocations &locations)
 
void anonymous_namespace{assignment2.cpp}::fillAccumulateLightsShaderLocations (GLuint accumulate_lights_shader, AccumulateLightsShaderLocations &locations)
 
bonobo::mesh_data anonymous_namespace{assignment2.cpp}::loadCone ()
 
int main ()
 

Variables

constexpr uint32_t constant::shadowmap_res_x = 1024
 
constexpr uint32_t constant::shadowmap_res_y = 1024
 
constexpr float constant::scale_lengths = 100.0f
 
constexpr size_t constant::lights_nb = 4
 
constexpr float constant::light_intensity = 72.0f * (scale_lengths * scale_lengths)
 
constexpr float constant::light_angle_falloff = glm::radians(37.0f)
 

Macro Definition Documentation

◆ GLM_FORCE_PURE

#define GLM_FORCE_PURE   1

Function Documentation

◆ main()

int main ( )