KiCad PCB EDA Suite
|
#include <post_shader.h>
Public Member Functions | |
POST_SHADER (const CAMERA &aCamera) | |
virtual | ~POST_SHADER () |
virtual SFVEC3F | Shade (const SFVEC2I &aShaderPos) const =0 |
virtual SFVEC4F | ApplyShadeColor (const SFVEC2I &aShaderPos, const SFVEC4F &aInputColor, const SFVEC3F &aShadeColor) const =0 |
Apply the final color process using a previous stage color. | |
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 SFVEC4F & | GetColorAt (const SFVEC2F &aPos) const |
const SFVEC3F & | GetPositionAt (const SFVEC2F &aPos) const |
float | GetDepthAt (const SFVEC2F &aPos) const |
const SFVEC3F & | GetNormalAt (const SFVEC2I &aPos) const |
const SFVEC4F & | GetColorAt (const SFVEC2I &aPos) const |
const SFVEC3F & | GetPositionAt (const SFVEC2I &aPos) const |
const float & | GetShadowFactorAt (const SFVEC2I &aPos) const |
float | GetDepthAt (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 | |
void | destroy_buffers () |
Definition at line 35 of file post_shader.h.
|
explicit |
Definition at line 36 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.
|
virtual |
Definition at line 50 of file post_shader.cpp.
References destroy_buffers().
|
pure virtual |
Apply the final color process using a previous stage color.
aShadeColor | The result of the shader. |
Implemented in POST_SHADER_SSAO.
void POST_SHADER::DebugBuffersOutputAsImages | ( | ) | const |
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.
|
private |
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().
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.
|
protected |
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().
|
protected |
Definition at line 164 of file post_shader.cpp.
References GetIndex(), and m_depth.
|
protected |
Definition at line 170 of file post_shader.cpp.
References GetIndex(), m_depth, m_tmax, and m_tmin.
Referenced by DebugBuffersOutputAsImages().
|
inline |
Definition at line 66 of file post_shader.h.
References m_size.
Referenced by POST_SHADER_SSAO::Blur(), GetColorAt(), GetDepthAt(), GetDepthNormalizedAt(), GetNormalAt(), GetPositionAt(), and GetShadowFactorAt().
|
inline |
Definition at line 80 of file post_shader.h.
References m_size.
|
inlineprotected |
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.
|
protected |
Definition at line 187 of file post_shader.cpp.
References GetIndex(), and m_shadow_att_factor.
Referenced by POST_SHADER_SSAO::Shade().
|
inline |
Definition at line 56 of file post_shader.h.
References m_tmax, and m_tmin.
Referenced by RENDER_3D_RAYTRACE_BASE::restartRenderState().
void POST_SHADER::SetPixelData | ( | unsigned int | x, |
unsigned int | y, | ||
const SFVEC3F & | aNormal, | ||
const SFVEC4F & | aColor, | ||
const SFVEC3F & | aHitPosition, | ||
float | aDepth, | ||
float | aShadowAttFactor | ||
) |
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.
Referenced by RENDER_3D_RAYTRACE_BASE::renderBlockTracing().
Implemented in POST_SHADER_SSAO.
void POST_SHADER::UpdateSize | ( | const SFVEC2UI & | aSize | ) |
Definition at line 73 of file post_shader.cpp.
References UpdateSize().
Referenced by RENDER_3D_RAYTRACE_BASE::initializeBlockPositions(), and UpdateSize().
void POST_SHADER::UpdateSize | ( | unsigned int | xSize, |
unsigned int | ySize | ||
) |
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.
|
protected |
Definition at line 108 of file post_shader.h.
|
protected |
Definition at line 112 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetColorAt(), GetColorAtNotProtected(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protected |
Definition at line 114 of file post_shader.h.
Referenced by destroy_buffers(), GetDepthAt(), GetDepthNormalizedAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protected |
Definition at line 111 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetNormalAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protected |
Definition at line 115 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), destroy_buffers(), GetShadowFactorAt(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protected |
Definition at line 110 of file post_shader.h.
Referenced by DebugBuffersOutputAsImages(), GetColorAtNotProtected(), GetIndex(), POST_SHADER(), SetPixelData(), and UpdateSize().
|
protected |
Definition at line 117 of file post_shader.h.
Referenced by GetDepthNormalizedAt(), GetMaxDepth(), InitFrame(), POST_SHADER(), and SetPixelData().
|
protected |
Definition at line 116 of file post_shader.h.
Referenced by GetDepthNormalizedAt(), InitFrame(), POST_SHADER(), and SetPixelData().
|
protected |
Definition at line 113 of file post_shader.h.
Referenced by destroy_buffers(), GetPositionAt(), POST_SHADER(), SetPixelData(), and UpdateSize().