![]() |
Path Tracing
|
#include "mesh.hpp"#include <stdio.h>#include <cmath>#include <assimp/Importer.hpp>#include <assimp/scene.h>#include <assimp/postprocess.h>#include "stb_image.h"
Macros | |
| #define | MAT_DIFFUSE 0 |
| #define | MAT_MIRROR 1 |
| #define | MAT_GLASS 2 |
| #define | MAT_TINTED_GLASS 3 |
Functions | |
| int | uploadLights (const vector< GPUTriangle > &triangles, const vector< GPUMaterial > &materials, GLuint &out_light_ssbo) |
| int | uploadAnalyticLights (const vector< GPULight > &lights, GLuint &out_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 () |
| #define MAT_DIFFUSE 0 |
| #define MAT_GLASS 2 |
| #define MAT_MIRROR 1 |
| #define MAT_TINTED_GLASS 3 |
| 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 | ( | ) |
| int uploadLights | ( | const vector< GPUTriangle > & | triangles, |
| const vector< GPUMaterial > & | materials, | ||
| GLuint & | out_light_ssbo ) |
| bool uploadMesh | ( | const vector< GPUTriangle > & | triangles, |
| const vector< GPUMaterial > & | materials, | ||
| GLuint & | tri_ssbo, | ||
| GLuint & | mat_ssbo ) |