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.
|
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(), POST_SHADER::GetDepthNormalizedAt(), POST_SHADER::m_color, POST_SHADER::m_normals, POST_SHADER::m_shadow_att_factor, and POST_SHADER::m_size.
|
privateinherited |
Definition at line 107 of file post_shader.cpp.
References POST_SHADER::m_color, POST_SHADER::m_depth, POST_SHADER::m_normals, POST_SHADER::m_shadow_att_factor, and POST_SHADER::m_wc_hitposition.
Referenced by POST_SHADER::UpdateSize(), and POST_SHADER::~POST_SHADER().
|
private |
Definition at line 128 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_color.
Referenced by Shade().
Definition at line 152 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_color.
Definition at line 158 of file post_shader.cpp.
References POST_SHADER::m_color, and POST_SHADER::m_size.
|
protectedinherited |
Definition at line 134 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_depth.
|
protectedinherited |
Definition at line 164 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_depth.
|
protectedinherited |
Definition at line 170 of file post_shader.cpp.
References POST_SHADER::GetIndex(), POST_SHADER::m_depth, POST_SHADER::m_tmax, and POST_SHADER::m_tmin.
Referenced by POST_SHADER::DebugBuffersOutputAsImages().
|
inlineinherited |
Definition at line 66 of file post_shader.h.
References POST_SHADER::m_size.
Referenced by Blur(), POST_SHADER::GetColorAt(), POST_SHADER::GetDepthAt(), POST_SHADER::GetDepthNormalizedAt(), POST_SHADER::GetNormalAt(), POST_SHADER::GetPositionAt(), and POST_SHADER::GetShadowFactorAt().
|
inlineinherited |
Definition at line 80 of file post_shader.h.
References POST_SHADER::m_size.
|
inlineprotectedinherited |
Definition at line 102 of file post_shader.h.
References POST_SHADER::m_tmax.
Definition at line 122 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_normals.
Definition at line 146 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_normals.
Definition at line 140 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_wc_hitposition.
Referenced by Shade().
Definition at line 181 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_wc_hitposition.
|
protectedinherited |
Definition at line 187 of file post_shader.cpp.
References POST_SHADER::GetIndex(), and POST_SHADER::m_shadow_att_factor.
Referenced by 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.
References POST_SHADER::m_tmax, and POST_SHADER::m_tmin.
Referenced by RENDER_3D_RAYTRACE_BASE::restartRenderState().
|
inherited |
Definition at line 79 of file post_shader.cpp.
References POST_SHADER::m_color, POST_SHADER::m_depth, POST_SHADER::m_normals, POST_SHADER::m_shadow_att_factor, POST_SHADER::m_size, POST_SHADER::m_tmax, POST_SHADER::m_tmin, and POST_SHADER::m_wc_hitposition.
Referenced by RENDER_3D_RAYTRACE_BASE::renderBlockTracing().
|
inline |
Definition at line 48 of file post_shader_ssao.h.
References m_shadedBuffer.
Referenced by RENDER_3D_RAYTRACE_BASE::postProcessShading().
|
inline |
Definition at line 53 of file post_shader_ssao.h.
References m_isUsingShadows.
Referenced by RENDER_3D_RAYTRACE_BASE::postProcessShading().
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 |
Definition at line 73 of file post_shader.cpp.
References POST_SHADER::UpdateSize().
Referenced by RENDER_3D_RAYTRACE_BASE::initializeBlockPositions(), and POST_SHADER::UpdateSize().
|
inherited |
Definition at line 56 of file post_shader.cpp.
References POST_SHADER::destroy_buffers(), POST_SHADER::m_color, POST_SHADER::m_depth, POST_SHADER::m_normals, POST_SHADER::m_shadow_att_factor, POST_SHADER::m_size, and POST_SHADER::m_wc_hitposition.
|
protectedinherited |
Definition at line 108 of file post_shader.h.
|
protectedinherited |
Definition at line 112 of file post_shader.h.
Referenced by POST_SHADER::DebugBuffersOutputAsImages(), POST_SHADER::destroy_buffers(), POST_SHADER::GetColorAt(), POST_SHADER::GetColorAtNotProtected(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().
|
protectedinherited |
Definition at line 114 of file post_shader.h.
Referenced by POST_SHADER::destroy_buffers(), POST_SHADER::GetDepthAt(), POST_SHADER::GetDepthNormalizedAt(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().
|
private |
Definition at line 85 of file post_shader_ssao.h.
Referenced by SetShadowsEnabled(), and Shade().
|
protectedinherited |
Definition at line 111 of file post_shader.h.
Referenced by POST_SHADER::DebugBuffersOutputAsImages(), POST_SHADER::destroy_buffers(), POST_SHADER::GetNormalAt(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().
|
private |
Definition at line 83 of file post_shader_ssao.h.
Referenced by Blur(), and SetShadedBuffer().
|
protectedinherited |
Definition at line 115 of file post_shader.h.
Referenced by POST_SHADER::DebugBuffersOutputAsImages(), POST_SHADER::destroy_buffers(), POST_SHADER::GetShadowFactorAt(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().
|
protectedinherited |
Definition at line 110 of file post_shader.h.
Referenced by POST_SHADER::DebugBuffersOutputAsImages(), POST_SHADER::GetColorAtNotProtected(), POST_SHADER::GetIndex(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().
|
protectedinherited |
Definition at line 117 of file post_shader.h.
Referenced by POST_SHADER::GetDepthNormalizedAt(), POST_SHADER::GetMaxDepth(), POST_SHADER::InitFrame(), POST_SHADER::POST_SHADER(), and POST_SHADER::SetPixelData().
|
protectedinherited |
Definition at line 116 of file post_shader.h.
Referenced by POST_SHADER::GetDepthNormalizedAt(), POST_SHADER::InitFrame(), POST_SHADER::POST_SHADER(), and POST_SHADER::SetPixelData().
|
protectedinherited |
Definition at line 113 of file post_shader.h.
Referenced by POST_SHADER::destroy_buffers(), POST_SHADER::GetPositionAt(), POST_SHADER::POST_SHADER(), POST_SHADER::SetPixelData(), and POST_SHADER::UpdateSize().