group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
Renderer.cpp File Reference

SDL3 GPU renderer implementation – pipelines, passes, and post-processing. More...

#include "Renderer.hpp"
#include "Camera.hpp"
#include "ModelLoader.hpp"
#include "SMAAAreaTex.h"
#include "SMAASearchTex.h"
#include "particles/ParticleSystem.hpp"
#include <algorithm>
#include <backends/imgui_impl_sdlgpu3.h>
#include <cmath>
#include <filesystem>
#include <glm/ext/matrix_clip_space.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/gtc/matrix_inverse.hpp>
#include <imgui.h>
#include <stb_image.h>
#include <vector>
#include <stb_image_write.h>
Include dependency graph for Renderer.cpp:

Functions

static std::array< CascadeInfo, 4 > computeCascades (const Camera &cam, const glm::vec3 &lightDir, int numCascades, int shadowMapSize, float shadowMaxDist, float lambda)
 Compute per-cascade light view-projection matrices.
 

Detailed Description

SDL3 GPU renderer implementation – pipelines, passes, and post-processing.

Function Documentation

◆ computeCascades()

static std::array< CascadeInfo, 4 > computeCascades ( const Camera cam,
const glm::vec3 &  lightDir,
int  numCascades,
int  shadowMapSize,
float  shadowMaxDist,
float  lambda 
)
static

Compute per-cascade light view-projection matrices.

Tightly fits the camera's sub-frustum from the light's perspective. Uses the practical split scheme (blend of logarithmic and linear) and texel-snaps the ortho projection to prevent shadow swimming.

Parameters
camCurrent camera.
lightDirUnit direction vector toward the sun.
numCascadesNumber of cascades (up to 4).
shadowMapSizePer-cascade shadow map resolution.
shadowMaxDistMaximum shadow distance in world units.
lambdaLogarithmic vs linear blend factor (0=linear, 1=log).
Returns
Array of CascadeInfo structs with light VP matrices and split distances.
Here is the call graph for this function:
Here is the caller graph for this function: