Change project structure;
Added new c# binding;
This commit is contained in:
33
native/header/Rendering/PostProcessing.h
Normal file
33
native/header/Rendering/PostProcessing.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef POST_PROCESSING_H
|
||||
#define POST_PROCESSING_H
|
||||
|
||||
#include "cglm/struct/vec4.h"
|
||||
#include "cglm/struct/mat4.h"
|
||||
|
||||
inline vec4s gamma_correct(vec4s color, float gamma)
|
||||
{
|
||||
vec4s corrected_color = color;
|
||||
corrected_color.x = powf(color.x, 1.0f / gamma);
|
||||
corrected_color.y = powf(color.y, 1.0f / gamma);
|
||||
corrected_color.z = powf(color.z, 1.0f / gamma);
|
||||
return corrected_color;
|
||||
}
|
||||
|
||||
// Maybe full aces later
|
||||
inline vec4s aces_tone_map(vec4s color)
|
||||
{
|
||||
vec4s mapped_color = color;
|
||||
float a = 2.51f;
|
||||
float b = 0.03f;
|
||||
float c = 2.43f;
|
||||
float d = 0.59f;
|
||||
float e = 0.14f;
|
||||
|
||||
mapped_color.x = (color.x * (a * color.x + b)) / (color.x * (c * color.x + d) + e);
|
||||
mapped_color.y = (color.y * (a * color.y + b)) / (color.y * (c * color.y + d) + e);
|
||||
mapped_color.z = (color.z * (a * color.z + b)) / (color.z * (c * color.z + d) + e);
|
||||
|
||||
return mapped_color;
|
||||
}
|
||||
|
||||
#endif // POST_PROCESSING_H
|
||||
Reference in New Issue
Block a user