Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
Render System

Files

file  camera_system.hpp
 Contains headers for the system and structs used by the engine's camera system.
 
file  framebuffer.hpp
 File containing wrapper over OpenGL Framebuffers and related objects.
 
file  instance.hpp
 A wrapper over regular shader attributes intended to be used as "instance" attributes, i.e., ones that change after what would traditionally be one-or-more draw calls in the same render stage.
 
file  light.hpp
 A file that contains definitions for different types of lights, as components to entities, supported by the engine.
 
file  material.hpp
 Functions related to rendering materials.
 
file  mesh.hpp
 A file containing the ToyMaker::StaticMesh class and related structures.
 
file  model.hpp
 Classes, constructors for this engine's representation of 3D models.
 
file  render_stage.hpp
 A file containing render stage related classes, this engine's representation of a single "step" in a graphics pipeline.
 
file  render_system.hpp
 Contains definitions relating to the render system defined for this object.
 
file  shader_program.hpp
 A file containing class definitions for wrappers over OpenGL shader programs.
 
file  shapegen.hpp
 Contains classes used to construct some common procedurally generated meshes and models.
 
file  texture.hpp
 Header containing definitions of classes and functions related to loading and using Texture resources.
 
file  vertex.hpp
 Contains engine's built-in vertex definitions, along with their associated attribute locations in the engine's built-in shader programs. A wrapper over OpenGL shader attributes.
 

Classes

struct  ToyMaker::CameraProperties
 Struct that encapsulates properties which define the (geometric) aspects of a scene camera. More...
 
class  ToyMaker::CameraSystem
 System responsible for managing all active cameras belonging to this world, tracking and updating associated projection and view matrices. More...
 
class  ToyMaker::RBO
 Wrapper class over OpenGL RBOs. More...
 
class  ToyMaker::Framebuffer
 A wrapper class over OpenGL framebuffers. More...
 
class  ToyMaker::FramebufferFromDescription
 Constructs a Framebuffer from its description in JSON. More...
 
struct  ToyMaker::InstanceAttributeDescriptor
 A struct describing the name and type of each attribute designated as an instance attribute. More...
 
struct  ToyMaker::InstanceLayout
 Object representing the layout of one set of related attributes representing (presumably) one object or instance. More...
 
class  ToyMaker::BaseInstanceAllocator
 Class that is responsible for taking an instance layout and correctly uploading it to the GPU. More...
 
class  ToyMaker::BuiltinModelMatrixAllocator
 An instance allocator initialized with the built in model matrix layout object. More...
 
struct  ToyMaker::LightEmissionData
 A struct, used as a component, describing the emissive properties of the light it represents per the Blinn-Phong shading model. More...
 
class  ToyMaker::LightInstanceAllocator
 The allocator associated with built in light sources used as attributes. More...
 
class  ToyMaker::Material
 A collection of key value pairs used to control the behaviour of the rendering system when rendering a single "object.". More...
 
class  ToyMaker::MaterialFromDescription
 A material resource constructor which converts a material represented in JSON to its Material equivalent. More...
 
class  ToyMaker::StaticMesh
 A class whose current main purpose is to store geometry related info, and to upload it to GPU memory when requested. More...
 
class  ToyMaker::StaticMeshFromDescription
 Creates a static mesh based on its description in JSON. More...
 
class  ToyMaker::StaticModel
 This engine's representation of a single unrigged 3D model. More...
 
class  ToyMaker::StaticModelFromFile
 A constructor method for StaticModels that loads such a model from its model file (w/ extensions such as .fbx, .obj, .gltf, and so on) More...
 
struct  ToyMaker::OpaqueRenderUnit
 An object representing a single opaque mesh-material pair, to be rendered this frame. More...
 
struct  ToyMaker::LightRenderUnit
 Contains the model matrix, mesh, and light emission for a single light object being rendered this frame. More...
 
class  ToyMaker::BaseRenderStage
 Represents a single render stage or a render step that applies to the default (window) framebuffer. More...
 
class  ToyMaker::BaseOffscreenRenderStage
 Base class for render stages which render to an offscreen buffer. More...
 
class  ToyMaker::GeometryRenderStage
 Render step responsible for translating mesh-material data into geometry buffers. More...
 
class  ToyMaker::LightingRenderStage
 Render stage which takes geometry buffers and scene lights as inputs, and produces a lit scene as output. More...
 
class  ToyMaker::BlurRenderStage
 Multipurpose render stage which at present is used to compute a simple bloom effect from a scene's "brightCutoff" texture. More...
 
class  ToyMaker::SkyboxRenderStage
 Uses a skybox texture (i.e a texture with a supported cubemap format) to render a skybox behind geometry in the scene. More...
 
class  ToyMaker::TonemappingRenderStage
 Takes lit scene (with bloom if it's used), and produces a tonemapped and gamma corrected version of the scene. More...
 
class  ToyMaker::AdditionRenderStage
 Stage responsible for combining multiple textures together. More...
 
class  ToyMaker::ScreenRenderStage
 Render stage responsible for rendering any texture attached as source to the screen. More...
 
class  ToyMaker::ResizeRenderStage
 Render stage responsible for resizing a texture to its final intended resolution. More...
 
struct  ToyMaker::RenderSet
 A collection of shaders, render configurations, cameras, and related framebuffers used by a viewport within an ECSWorld. More...
 
class  ToyMaker::RenderSystem
 The render system for a single ECSWorld, which joins together various RenderStages into a render pipeline for objects present in that world. More...
 
class  ToyMaker::ViewportNode
 A type of node capable of and responsible for interacting sensibly with the engine's RenderSystem and ECSWorlds. More...
 
class  ToyMaker::ShaderProgram
 A wrapper over OpenGL's shader programs. More...
 
class  ToyMaker::ShaderProgramFromFile
 Constructs a ShaderProgram from its shader program header, found at a particular path. More...
 
class  ToyMaker::StaticMeshSphereLatLong
 Mesh constructor that creates a spherical mesh using a latitude-longitude method. More...
 
class  ToyMaker::StaticMeshRectangleDimensions
 Constructs a rectangle mesh based on its dimensions. More...
 
class  ToyMaker::StaticMeshCuboidDimensions
 Constructs a cuboid mesh based on its dimensions. More...
 
class  ToyMaker::StaticModelSphereLatLong
 Constructs a sphere model using the latitude-longitude method. More...
 
class  ToyMaker::StaticModelRectangleDimensions
 Constructs a rectangle mesh using the latitude-longitude method. More...
 
class  ToyMaker::StaticModelCuboidDimensions
 Constructs a cuboid mesh based on its dimensions. More...
 
class  ToyMaker::Texture
 The class representation of textures on this engine, which are a type of Resource used both within and outside of the engine. More...
 
class  ToyMaker::TextureFromFile
 A resource constructor which loads a texture from a supported image file located via its file path. More...
 
class  ToyMaker::TextureFromColorBufferDefinition
 Generates a texture based on its color buffer definition. More...
 
struct  ToyMaker::VertexAttributeDescriptor
 The description of a single vertex attribute associated with a vertex layout, giving its size and location id. More...
 
struct  ToyMaker::VertexLayout
 A list of attribute descriptors that together define the layout and size of the vertex they make up in GPU memory. More...
 
struct  ToyMaker::BuiltinVertexData
 The vertex data used by all this engine's in-built shader program's vertex shaders. More...
 

Typedefs

using ToyMaker::LightPackedData = std::pair<std::pair<glm::vec4, glm::vec4>, LightEmissionData>
 A version of light data where the first element represents the light's position and direction, and the second represents its emission properties.
 
using ToyMaker::RenderSetID = uint32_t
 

Enumerations

enum  ToyMaker::DefaultInstanceAttributeLocations : int { FIXED_MATRIXMODEL =7 , RUNTIME =-8 }
 Attribute locations, per existing shaders.
 
enum  ToyMaker::DefaultAttributeLocation {
  LOCATION_POSITION =0 , LOCATION_NORMAL =1 , LOCATION_TANGENT =2 , LOCATION_COLOR =3 ,
  LOCATION_UV1 =4 , LOCATION_UV2 =5 , LOCATION_UV3 =6
}
 Values for different attribute locations used by the engine's built-in shader programs.
 

Functions

void ToyMaker::from_json (const nlohmann::json &json, CameraProperties &cameraProperties)
 
 ToyMaker::NLOHMANN_JSON_SERIALIZE_ENUM (LightEmissionData::LightType, { {LightEmissionData::LightType::directional, "directional"}, {LightEmissionData::LightType::point, "point"}, {LightEmissionData::LightType::spot, "spot"}, })
 
void ToyMaker::from_json (const nlohmann::json &json, LightEmissionData &lightEmissionData)
 
void ToyMaker::to_json (nlohmann::json &json, const LightEmissionData &lightEmissionData)
 
GLenum ToyMaker::deduceInternalFormat (const ColorBufferDefinition &colorBufferDefinition)
 A (quite possibly unnecessary) function to fetch the enum corresponding to the "internalFormat" argument of glTexImage2D based on some color buffer definition.
 
GLenum ToyMaker::deduceExternalFormat (const ColorBufferDefinition &colorBufferDefinition)
 A (quite possibly unnecessary) function to fetch the enum corresponding to the "format" argument of glTexImage2D based on some color buffer definition.
 
void ToyMaker::to_json (nlohmann::json &json, const ColorBufferDefinition &colorBufferDefinition)
 
void ToyMaker::from_json (const nlohmann::json &json, ColorBufferDefinition &colorBufferDefinition)
 

Variables

static InstanceLayout ToyMaker::BuiltinModelMatrixLayout
 The layout of the in-built model matrix instance attribute, present on pretty much every engine-defined shader.
 
static InstanceLayout ToyMaker::LightInstanceLayout
 The layout for built-in light sources when used as instance attributes.
 
const RenderSetID ToyMaker::kMaxRenderSetIDs { 10000 }
 The total number of RenderSets, per ECSWorld, that can be created.
 
VertexLayout ToyMaker::BuiltinVertexLayout
 The vertex layout used by most shader programs built into the engine.
 

Detailed Description

Function Documentation

◆ deduceExternalFormat()

GLenum ToyMaker::deduceExternalFormat ( const ColorBufferDefinition & colorBufferDefinition)
inline

A (quite possibly unnecessary) function to fetch the enum corresponding to the "format" argument of glTexImage2D based on some color buffer definition.

Parameters
colorBufferDefinitionThe color buffer definition of the texture we are presumably trying to allocate on the GPU.
Returns
GLenum The enum corresponding to glTexImage2D's "format" argument for this color buffer.

◆ deduceInternalFormat()

GLenum ToyMaker::deduceInternalFormat ( const ColorBufferDefinition & colorBufferDefinition)
inline

A (quite possibly unnecessary) function to fetch the enum corresponding to the "internalFormat" argument of glTexImage2D based on some color buffer definition.

Parameters
colorBufferDefinitionThe color buffer definition of the texture we are presumably trying to allocate on the GPU.
Returns
GLenum The enum corresponding to glTexImage2D's "internalFormat" argument for this color buffer.

Variable Documentation

◆ BuiltinModelMatrixLayout

InstanceLayout ToyMaker::BuiltinModelMatrixLayout
static
Initial value:
{
{
{"modelMatrixCol0", FIXED_MATRIXMODEL, 4, GL_FLOAT},
{"modelMatrixCol1", FIXED_MATRIXMODEL+1, 4, GL_FLOAT},
{"modelMatrixCol2", FIXED_MATRIXMODEL+2, 4, GL_FLOAT},
{"modelMatrixCol3", FIXED_MATRIXMODEL+3, 4, GL_FLOAT},
}
}

The layout of the in-built model matrix instance attribute, present on pretty much every engine-defined shader.

◆ BuiltinVertexLayout

VertexLayout ToyMaker::BuiltinVertexLayout
inline
Initial value:
{
{
{"position", LOCATION_POSITION, 4, GL_FLOAT},
{"normal", LOCATION_NORMAL, 4, GL_FLOAT},
{"tangent", LOCATION_TANGENT, 4, GL_FLOAT},
{"color", LOCATION_COLOR, 4, GL_FLOAT},
{"UV1", LOCATION_UV1, 2, GL_FLOAT},
{"UV2", LOCATION_UV2, 2, GL_FLOAT},
{"UV3", LOCATION_UV3, 2, GL_FLOAT}
}
}

The vertex layout used by most shader programs built into the engine.

◆ LightInstanceLayout

InstanceLayout ToyMaker::LightInstanceLayout
static
Initial value:
{{
{"attrLightPlacement_mPosition", RUNTIME, 4, GL_FLOAT},
{"attrLightPlacement_mDirection", RUNTIME, 4, GL_FLOAT},
{"attrLightEmission_mType", RUNTIME, 1, GL_INT},
{"attrLightEmission_mDiffuseColor", RUNTIME, 4, GL_FLOAT},
{"attrLightEmission_mSpecularColor", RUNTIME, 4, GL_FLOAT},
{"attrLightEmission_mAmbientColor", RUNTIME, 4, GL_FLOAT},
{"attrLightEmission_mDecayLinear", RUNTIME, 1, GL_FLOAT},
{"attrLightEmission_mDecayQuadratic", RUNTIME, 1, GL_FLOAT},
{"attrLightEmission_mCosCutoffInner", RUNTIME, 1, GL_FLOAT},
{"attrLightEmission_mCosCutoffOuter", RUNTIME, 1, GL_FLOAT},
{"attrLightEmission_mRadius", RUNTIME, 1, GL_FLOAT}
}}

The layout for built-in light sources when used as instance attributes.