KiCad PCB EDA Suite
|
#include <post_shader_ssao.h>
Public Member Functions | |
POST_SHADER_SSAO (const CAMERA &aCamera) | |
SFVEC3F | Shade (const SFVEC2I &aShaderPos) const override |
SFVEC4F | ApplyShadeColor (const SFVEC2I &aShaderPos, const SFVEC4F &aInputColor, const SFVEC3F &aShadeColor) const override |
Apply the final color process using a previous stage color. | |
SFVEC3F | Blur (const SFVEC2I &aShaderPos) const |
void | SetShadedBuffer (SFVEC3F *aShadedBuffer) |
void | SetShadowsEnabled (bool aIsShadowsEnabled) |
void | UpdateSize (const SFVEC2UI &aSize) |
void | UpdateSize (unsigned int xSize, unsigned int ySize) |
void | InitFrame () |
void | SetPixelData (unsigned int x, unsigned int y, const SFVEC3F &aNormal, const SFVEC4F &aColor, const SFVEC3F &aHitPosition, float aDepth, float aShadowAttFactor) |
const SFVEC4F & | GetColorAtNotProtected (const SFVEC2I &aPos) const |
void | DebugBuffersOutputAsImages () const |
unsigned int | GetIndex (const SFVEC2F &aPos) const |
unsigned int | GetIndex (const SFVEC2I &aPos) const |
Protected Member Functions | |
const SFVEC3F & | GetNormalAt (const SFVEC2F &aPos) const |
const SFVEC3F & | GetNormalAt (const SFVEC2I &aPos) const |
const SFVEC4F & | GetColorAt (const SFVEC2F &aPos) const |
const SFVEC4F & | GetColorAt (const SFVEC2I &aPos) const |
const SFVEC3F & | GetPositionAt (const SFVEC2F &aPos) const |
const SFVEC3F & | GetPositionAt (const SFVEC2I &aPos) const |
float | GetDepthAt (const SFVEC2F &aPos) const |
float | GetDepthAt (const SFVEC2I &aPos) const |
const float & | GetShadowFactorAt (const SFVEC2I &aPos) const |
float | GetDepthNormalizedAt (const SFVEC2I &aPos) const |
float | GetMaxDepth () const |
Protected Attributes | |
const CAMERA & | m_camera |
SFVEC2UI | m_size |
SFVEC3F * | m_normals |
SFVEC4F * | m_color |
SFVEC3F * | m_wc_hitposition |
float * | m_depth |
float * | m_shadow_att_factor |
float | m_tmin |
float | m_tmax |
Private Member Functions | |
SFVEC3F | posFromDepth (const SFVEC2F &coord) const |
float | ec_depth (const SFVEC2F &tc) const |
float | aoFF (const SFVEC2I &aShaderPos, const SFVEC3F &ddiff, const SFVEC3F &cnorm, const float aShadowAtSamplePos, const float aShadowAtCenterPos, int c1, int c2) const |
float | giFF (const SFVEC2I &aShaderPos, const SFVEC3F &ddiff, const SFVEC3F &cnorm, const float aShadow, int c1, int c2) const |
SFVEC3F | giColorCurve (const SFVEC3F &aColor) const |
Apply a curve transformation to the original color. | |
SFVEC4F | giColorCurve (const SFVEC4F &aColor) const |
SFVEC3F | giColorCurveShade (const SFVEC4F &aColor) const |
void | destroy_buffers () |
Private Attributes | |
SFVEC3F * | m_shadedBuffer |
bool | m_isUsingShadows |
Definition at line 37 of file post_shader_ssao.h.
|
explicit |
Definition at line 34 of file post_shader_ssao.cpp.
References m_isUsingShadows, m_shadedBuffer, and POST_SHADER::POST_SHADER().
|
private |
Definition at line 47 of file post_shader_ssao.cpp.
References POST_SHADER::GetNormalAt().
Referenced by Shade().
|
overridevirtual |
Apply the final color process using a previous stage color.
aShadeColor | The result of the shader. |
Implements POST_SHADER.
Definition at line 230 of file post_shader_ssao.cpp.
Definition at line 273 of file post_shader_ssao.cpp.
References POST_SHADER::GetDepthAt(), POST_SHADER::GetIndex(), and m_shadedBuffer.
|
inherited |
Definition at line 193 of file post_shader.cpp.
References DBG_SaveBuffer(), DBG_SaveNormalsBuffer(), GetDepthNormalizedAt(), m_color, m_normals, m_shadow_att_factor, and m_size.
|
privateinherited |
Definition at line 107 of file post_shader.cpp.
References m_color, m_depth, m_normals, m_shadow_att_factor, and m_wc_hitposition.
Referenced by UpdateSize(), and ~POST_SHADER().
|
private |
Definition at line 128 of file post_shader.cpp.
References GetIndex(), and m_color.
Referenced by POST_SHADER_SSAO::Shade().
Definition at line 152 of file post_shader.cpp.
References GetIndex(), and m_color.
Definition at line 158 of file post_shader.cpp.
|
protectedinherited |
Definition at line 134 of file post_shader.cpp.
References GetIndex(), and m_depth.
Referenced by POST_SHADER_SSAO::Blur(), and POST_SHADER_SSAO::Shade().
|
protectedinherited |
Definition at line 164 of file post_shader.cpp.
References GetIndex(), and m_depth.
|
protectedinherited |
Definition at line 170 of file post_shader.cpp.
References GetIndex(), m_depth, m_tmax, and m_tmin.
Referenced by DebugBuffersOutputAsImages().
|
inlineinherited |
Definition at line 66 of file post_shader.h.
References m_size.
Referenced by POST_SHADER_SSAO::Blur(), GetColorAt(), GetColorAt(), GetDepthAt(), GetDepthAt(), GetDepthNormalizedAt(), GetNormalAt(), GetNormalAt(), GetPositionAt(), GetPositionAt(), and GetShadowFactorAt().
|
inlineinherited |
Definition at line 80 of file post_shader.h.
References m_size.
|
inlineprotectedinherited |
Definition at line 102 of file post_shader.h.
References m_tmax.
Definition at line 122 of file post_shader.cpp.
References GetIndex(), and m_normals.
Referenced by POST_SHADER_SSAO::aoFF(), POST_SHADER_SSAO::giFF(), and POST_SHADER_SSAO::Shade().
Definition at line 146 of file post_shader.cpp.
References GetIndex(), and m_normals.
Definition at line 140 of file post_shader.cpp.
References GetIndex(), and m_wc_hitposition.
Referenced by POST_SHADER_SSAO::Shade().
Definition at line 181 of file post_shader.cpp.
References GetIndex(), and m_wc_hitposition.
|
protectedinherited |
Definition at line 187 of file post_shader.cpp.
References GetIndex(), and m_shadow_att_factor.
Referenced by POST_SHADER_SSAO::Shade().
Apply a curve transformation to the original color.
It will attenuate the bright colors (works as a gamma function): http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiIxLjAtKDEvKHgqMS4wKzEuMCkpK3gqMC4zMCIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIi0wLjA2MjE4NDYxNTM4NDYxNTUwNSIsIjEuMTQyOTg0NjE1Mzg0NjE0NiIsIi0wLjEyNzA5OTk5OTk5OTk5OTc3IiwiMS4xMzI2Il19XQ–
aColor | input color. |
Definition at line 249 of file post_shader_ssao.cpp.
Referenced by giColorCurve(), and giColorCurveShade().
Definition at line 261 of file post_shader_ssao.cpp.
References giColorCurve().
Definition at line 267 of file post_shader_ssao.cpp.
References giColorCurve().
Referenced by Shade().
|
private |
Definition at line 113 of file post_shader_ssao.cpp.
References POST_SHADER::GetNormalAt().
Referenced by Shade().
|
inlineinherited |
Definition at line 56 of file post_shader.h.
|
inherited |
Definition at line 79 of file post_shader.cpp.
References m_color, m_depth, m_normals, m_shadow_att_factor, m_size, m_tmax, m_tmin, and m_wc_hitposition.
|
inline |
Definition at line 48 of file post_shader_ssao.h.
References m_shadedBuffer.
|
inline |
Definition at line 53 of file post_shader_ssao.h.
References m_isUsingShadows.
Implements POST_SHADER.
Definition at line 133 of file post_shader_ssao.cpp.
References aoFF(), Fast_rand(), POST_SHADER::GetColorAt(), POST_SHADER::GetDepthAt(), POST_SHADER::GetNormalAt(), POST_SHADER::GetPositionAt(), POST_SHADER::GetShadowFactorAt(), giColorCurveShade(), giFF(), m_isUsingShadows, and ROUNDS.
|
inherited |
|
inherited |
Definition at line 56 of file post_shader.cpp.
References destroy_buffers(), m_color, m_depth, m_normals, m_shadow_att_factor, m_size, and m_wc_hitposition.
|
protectedinherited |
Definition at line 108 of file post_shader.h.
Referenced by POST_SHADER().
|
protectedinherited |
Definition at line 112 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetColorAt(), GetColorAt(), GetColorAtNotProtected(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protectedinherited |
Definition at line 114 of file post_shader.h.
Referenced by destroy_buffers(), GetDepthAt(), GetDepthAt(), GetDepthNormalizedAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
private |
Definition at line 85 of file post_shader_ssao.h.
Referenced by POST_SHADER_SSAO(), SetShadowsEnabled(), and Shade().
|
protectedinherited |
Definition at line 111 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetNormalAt(), GetNormalAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
private |
Definition at line 83 of file post_shader_ssao.h.
Referenced by Blur(), POST_SHADER_SSAO(), and SetShadedBuffer().
|
protectedinherited |
Definition at line 115 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetShadowFactorAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protectedinherited |
Definition at line 110 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), GetColorAtNotProtected(), GetIndex(), GetIndex(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protectedinherited |
Definition at line 117 of file post_shader.h.
Referenced by GetDepthNormalizedAt(), GetMaxDepth(), InitFrame(), POST_SHADER(), and SetPixelData().
|
protectedinherited |
Definition at line 116 of file post_shader.h.
Referenced by GetDepthNormalizedAt(), InitFrame(), POST_SHADER(), and SetPixelData().
|
protectedinherited |
Definition at line 113 of file post_shader.h.
Referenced by destroy_buffers(), GetPositionAt(), GetPositionAt(), POST_SHADER(), SetPixelData(), and UpdateSize().