![]() |
Path Tracing
|
Loads 3D models through ASSIMP into CPU-side geometry and material data, defines the GPUVertex/GPUTriangle/GPUMaterial layouts shared with the shader. More...
#include <vector>#include <string>#include <GL/glew.h>#include <glm/glm.hpp>#include "config.hpp"

Go to the source code of this file.
Classes | |
| struct | GPUVertex |
| struct | GPUTriangle |
| struct | GPUMaterial |
| struct | CPUTextureSlot |
| struct | CPUMaterial |
| struct | MeshBounds |
| Loaded mesh bounding box, axis-aligned, used for AABB early rejection Calculated during loadMesh. Used for AABB early rejection for rays that miss the bouding box. More... | |
| struct | GPULight |
Macros | |
| #define | LIGHT_POINT 0 |
| #define | LIGHT_DIRECTIONAL 1 |
| #define | LIGHT_SPOT 2 |
Functions | |
| void | recreateBuffer (GLuint &ssbo, GLsizeiptr size_bytes, const void *data, GLenum usage) |
| Recreates/Creates a GPU buffer, freeing any previous held handle first. Prevents leaking the old buffer when called repeatedly. | |
| int | uploadLights (const vector< GPUTriangle > &triangles, const vector< GPUMaterial > &materials, GLuint &light_ssbo) |
| int | uploadAnalyticLights (const vector< GPULight > &lights, GLuint &light_ssbo) |
| bool | loadMesh (const string &path, vector< GPUTriangle > &triangles, vector< GPUMaterial > &materials, vector< CPUMaterial > &cpu_materials, mat4 transform, MeshBounds *bounds) |
| Loads a mesh and calculates its bounding box. | |
| bool | uploadMesh (const vector< GPUTriangle > &triangles, const vector< GPUMaterial > &materials, GLuint &tri_ssbo, GLuint &mat_ssbo) |
| void | clearMesh () |
| vector< GPUTriangle > | makeTestMesh () |
| void | checkGL (const char *label) |
| quick checkpoint to check OpenGL silent error throws. Catches the error and sends it, or it prints an OK check | |
Variables | |
| Renderer | renderer |
| GLuint | light_ssbo |
| Mesh light storage to pass emissive triangles. | |
| GLint | loc_light_count |
Loads 3D models through ASSIMP into CPU-side geometry and material data, defines the GPUVertex/GPUTriangle/GPUMaterial layouts shared with the shader.
| #define LIGHT_DIRECTIONAL 1 |
| #define LIGHT_POINT 0 |
| #define LIGHT_SPOT 2 |
|
inline |
quick checkpoint to check OpenGL silent error throws. Catches the error and sends it, or it prints an OK check
| label |
| void clearMesh | ( | ) |
| bool loadMesh | ( | const string & | path, |
| vector< GPUTriangle > & | triangles, | ||
| vector< GPUMaterial > & | materials, | ||
| vector< CPUMaterial > & | cpu_materials, | ||
| mat4 | transform, | ||
| MeshBounds * | bounds ) |
Loads a mesh and calculates its bounding box.
| path | Path to the mesh file (any file format supported by ASSIMP) |
| triangles | Output triangle buffer |
| materials | Output material buffer |
| transform | Transform matrix applied to all vertices (default: Identity) |
| bounds | Optional output bounding box - nullptr to skip |
| vector< GPUTriangle > makeTestMesh | ( | ) |
|
inline |
Recreates/Creates a GPU buffer, freeing any previous held handle first. Prevents leaking the old buffer when called repeatedly.
| ssbo | Buffer handle; deleted if exists, then recreates |
| size_bytes | Byte size of the data to upload |
| data | Pointer to source data (can be nullptr to just allocate space) |
| usage | GL usage hint (STATIC_DRAW, DYNAMIC_DRAW...) |
| int uploadLights | ( | const vector< GPUTriangle > & | triangles, |
| const vector< GPUMaterial > & | materials, | ||
| GLuint & | light_ssbo ) |
| bool uploadMesh | ( | const vector< GPUTriangle > & | triangles, |
| const vector< GPUMaterial > & | materials, | ||
| GLuint & | tri_ssbo, | ||
| GLuint & | mat_ssbo ) |
|
extern |
Mesh light storage to pass emissive triangles.
|
extern |
|
extern |