KiCad PCB EDA Suite
Loading...
Searching...
No Matches
POST_SHADER Class Referenceabstract

#include <post_shader.h>

Inheritance diagram for POST_SHADER:
POST_SHADER_SSAO

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 SFVEC4FGetColorAtNotProtected (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 SFVEC3FGetNormalAt (const SFVEC2F &aPos) const
 
const SFVEC4FGetColorAt (const SFVEC2F &aPos) const
 
const SFVEC3FGetPositionAt (const SFVEC2F &aPos) const
 
float GetDepthAt (const SFVEC2F &aPos) const
 
const SFVEC3FGetNormalAt (const SFVEC2I &aPos) const
 
const SFVEC4FGetColorAt (const SFVEC2I &aPos) const
 
const SFVEC3FGetPositionAt (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 CAMERAm_camera
 
SFVEC2UI m_size
 
SFVEC3Fm_normals
 
SFVEC4Fm_color
 
SFVEC3Fm_wc_hitposition
 
float * m_depth
 
float * m_shadow_att_factor
 
float m_tmin
 
float m_tmax
 

Private Member Functions

void destroy_buffers ()
 

Detailed Description

Definition at line 35 of file post_shader.h.

Constructor & Destructor Documentation

◆ POST_SHADER()

POST_SHADER::POST_SHADER ( const CAMERA aCamera)
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.

◆ ~POST_SHADER()

POST_SHADER::~POST_SHADER ( )
virtual

Definition at line 50 of file post_shader.cpp.

References destroy_buffers().

Member Function Documentation

◆ ApplyShadeColor()

virtual SFVEC4F POST_SHADER::ApplyShadeColor ( const SFVEC2I aShaderPos,
const SFVEC4F aInputColor,
const SFVEC3F aShadeColor 
) const
pure virtual

Apply the final color process using a previous stage color.

Parameters
aShadeColorThe result of the shader.
Returns
the result of the shade process

Implemented in POST_SHADER_SSAO.

◆ DebugBuffersOutputAsImages()

void POST_SHADER::DebugBuffersOutputAsImages ( ) const

◆ destroy_buffers()

void POST_SHADER::destroy_buffers ( )
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().

◆ GetColorAt() [1/2]

const SFVEC4F & POST_SHADER::GetColorAt ( const SFVEC2F aPos) const
protected

Definition at line 128 of file post_shader.cpp.

References GetIndex(), and m_color.

Referenced by POST_SHADER_SSAO::Shade().

◆ GetColorAt() [2/2]

const SFVEC4F & POST_SHADER::GetColorAt ( const SFVEC2I aPos) const
protected

Definition at line 152 of file post_shader.cpp.

References GetIndex(), and m_color.

◆ GetColorAtNotProtected()

const SFVEC4F & POST_SHADER::GetColorAtNotProtected ( const SFVEC2I aPos) const

Definition at line 158 of file post_shader.cpp.

References m_color, and m_size.

◆ GetDepthAt() [1/2]

float POST_SHADER::GetDepthAt ( const SFVEC2F aPos) const
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().

◆ GetDepthAt() [2/2]

float POST_SHADER::GetDepthAt ( const SFVEC2I aPos) const
protected

Definition at line 164 of file post_shader.cpp.

References GetIndex(), and m_depth.

◆ GetDepthNormalizedAt()

float POST_SHADER::GetDepthNormalizedAt ( const SFVEC2I aPos) const
protected

Definition at line 170 of file post_shader.cpp.

References GetIndex(), m_depth, m_tmax, and m_tmin.

Referenced by DebugBuffersOutputAsImages().

◆ GetIndex() [1/2]

unsigned int POST_SHADER::GetIndex ( const SFVEC2F aPos) const
inline

◆ GetIndex() [2/2]

unsigned int POST_SHADER::GetIndex ( const SFVEC2I aPos) const
inline

Definition at line 80 of file post_shader.h.

References m_size.

◆ GetMaxDepth()

float POST_SHADER::GetMaxDepth ( ) const
inlineprotected

Definition at line 102 of file post_shader.h.

References m_tmax.

◆ GetNormalAt() [1/2]

const SFVEC3F & POST_SHADER::GetNormalAt ( const SFVEC2F aPos) const
protected

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().

◆ GetNormalAt() [2/2]

const SFVEC3F & POST_SHADER::GetNormalAt ( const SFVEC2I aPos) const
protected

Definition at line 146 of file post_shader.cpp.

References GetIndex(), and m_normals.

◆ GetPositionAt() [1/2]

const SFVEC3F & POST_SHADER::GetPositionAt ( const SFVEC2F aPos) const
protected

Definition at line 140 of file post_shader.cpp.

References GetIndex(), and m_wc_hitposition.

Referenced by POST_SHADER_SSAO::Shade().

◆ GetPositionAt() [2/2]

const SFVEC3F & POST_SHADER::GetPositionAt ( const SFVEC2I aPos) const
protected

Definition at line 181 of file post_shader.cpp.

References GetIndex(), and m_wc_hitposition.

◆ GetShadowFactorAt()

const float & POST_SHADER::GetShadowFactorAt ( const SFVEC2I aPos) const
protected

Definition at line 187 of file post_shader.cpp.

References GetIndex(), and m_shadow_att_factor.

Referenced by POST_SHADER_SSAO::Shade().

◆ InitFrame()

void POST_SHADER::InitFrame ( )
inline

Definition at line 56 of file post_shader.h.

References m_tmax, and m_tmin.

Referenced by RENDER_3D_RAYTRACE_BASE::restartRenderState().

◆ SetPixelData()

void POST_SHADER::SetPixelData ( unsigned int  x,
unsigned int  y,
const SFVEC3F aNormal,
const SFVEC4F aColor,
const SFVEC3F aHitPosition,
float  aDepth,
float  aShadowAttFactor 
)

◆ Shade()

virtual SFVEC3F POST_SHADER::Shade ( const SFVEC2I aShaderPos) const
pure virtual

Implemented in POST_SHADER_SSAO.

◆ UpdateSize() [1/2]

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().

◆ UpdateSize() [2/2]

void POST_SHADER::UpdateSize ( unsigned int  xSize,
unsigned int  ySize 
)

Member Data Documentation

◆ m_camera

const CAMERA& POST_SHADER::m_camera
protected

Definition at line 108 of file post_shader.h.

◆ m_color

SFVEC4F* POST_SHADER::m_color
protected

◆ m_depth

float* POST_SHADER::m_depth
protected

◆ m_normals

SFVEC3F* POST_SHADER::m_normals
protected

◆ m_shadow_att_factor

float* POST_SHADER::m_shadow_att_factor
protected

◆ m_size

SFVEC2UI POST_SHADER::m_size
protected

◆ m_tmax

float POST_SHADER::m_tmax
protected

◆ m_tmin

float POST_SHADER::m_tmin
protected

Definition at line 116 of file post_shader.h.

Referenced by GetDepthNormalizedAt(), InitFrame(), POST_SHADER(), and SetPixelData().

◆ m_wc_hitposition

SFVEC3F* POST_SHADER::m_wc_hitposition
protected

Definition at line 113 of file post_shader.h.

Referenced by destroy_buffers(), GetPositionAt(), POST_SHADER(), SetPixelData(), and UpdateSize().


The documentation for this class was generated from the following files: