Enhance graphics library functionality and structure
Added new function signatures in `assimp-vc143-mt.lib` for improved logging, parsing, and vector operations. Added new metadata and configuration information in `assimp-vc143-mt.dll` for versioning and licensing compliance. Added Sobol sequence generation in `Sobol.c` for quasi-random sampling. Added window message handling in `Window.c` for rendering graphics. Added ray-triangle intersection tests in `RayIntersection.c` for collision detection. Added functions for loading mesh data in `Mesh.c` to support 3D model import. Added functions for managing triangle collections in `Triangle.c` to enhance geometric data handling. Added light evaluation functions in `LightEvaluation.c` and `SkyLight.c` for realistic rendering. Added sampling and evaluation functions for simple lit materials in `SimpleLit.c`. Changed various header files to include copyright and licensing information. Changed existing functions in multiple files to improve performance and clarity. Removed unused code in several files to streamline the library.
This commit is contained in:
39
header/Algorithm/Sobol.h
Normal file
39
header/Algorithm/Sobol.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef SOBOL_H
|
||||
#define SOBOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SOBOL_BITS 32
|
||||
// NOTE: May need more dimensions for later
|
||||
#define SOBOL_DIMENSIONS 8
|
||||
|
||||
// #define COS_WEIGHTED_HEMISPHERE_R1_INDEX 0
|
||||
// #define COS_WEIGHTED_HEMISPHERE_R2_INDEX 1
|
||||
|
||||
static uint32_t sobol_direction_vectors[SOBOL_DIMENSIONS][SOBOL_BITS];
|
||||
|
||||
// Precomputed table: s, a, and m_i's
|
||||
// https://web.maths.unsw.edu.au/~fkuo/sobol/
|
||||
static const int s_vals[SOBOL_DIMENSIONS - 1] = {1, 2, 3, 3, 4, 4, 5};
|
||||
static const int a_vals[SOBOL_DIMENSIONS - 1] = {0, 1, 1, 2, 1, 4, 2};
|
||||
static const int m_vals[SOBOL_DIMENSIONS - 1][5] = {
|
||||
{1}, // dim 2
|
||||
{1, 3}, // dim 3
|
||||
{1, 3, 1}, // dim 4
|
||||
{1, 1, 1}, // dim 5
|
||||
{1, 1, 3, 3}, // dim 6
|
||||
{1 ,1, 5, 13}, // dim 7
|
||||
{1, 1, 5, 5, 17} // dim 8
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t index;
|
||||
uint32_t dimension;
|
||||
} sobol_state_t;
|
||||
|
||||
void sobol_init();
|
||||
float sobol_sample(uint32_t index, uint32_t dimension);
|
||||
float sobol_next(sobol_state_t* state);
|
||||
|
||||
#endif // SOBOL_H
|
||||
Reference in New Issue
Block a user