sead
Loading...
Searching...
No Matches
agl::pfx::DepthOfField Class Reference

#include <aglDepthOfField.h>

Inherits agl::utl::IParameterIO, and sead::hostio::Node.

Classes

struct  Context
struct  DrawArg
struct  TempVignetting
struct  Vertex
struct  VignettingShape

Public Types

enum  Uniform {
  cUniform_Param0 = 0 , cUniform_IndirectTexParam , cUniform_IndirectTexMtx0 , cUniform_IndirectTexMtx1 ,
  cUniform_MulParam , cUniform_AddParam , cUniform_NearFarParam , cUniform_TexParam ,
  cUniform_VignettingRadius , cUniform_VignettingParam , cUniform_VignettingTrans , cUniform_VignettingColor ,
  cUniform_FarMulColor , cUniform_Num
}
enum  Sampler {
  cSampler_TexColor = 0 , cSampler_TexDepth , cSampler_TexMipMap , cSampler_TexMipMapDepth ,
  cSampler_TexIndirect , cSampler_Num
}
enum  VignettingBlendType { cVignettingBlendType_Normal = 0 , cVignettingBlendType_Add , cVignettingBlendType_Mult , cVignettingBlendType_Screen }

Public Member Functions

 DepthOfField ()
virtual ~DepthOfField ()
void initialize (s32 ctx_num=1, sead::Heap *heap=nullptr)
bool isEnable () const
void setEnable (bool enable)
VignettingBlendType getVignettingBlendType () const
ShaderMode draw (s32 ctx_index, const RenderBuffer &render_buffer, f32 near, f32 far, ShaderMode mode=cShaderMode_Invalid) const
ShaderMode draw (s32 ctx_index, const RenderBuffer &render_buffer, const TextureData &depth, bool view_depth, f32 near, f32 far, ShaderMode mode=cShaderMode_Invalid) const
void allocBuffer (s32 ctx_index, const RenderBuffer &render_buffer) const
void allocBuffer (s32 ctx_index, TextureFormat format, s32 width, s32 height) const
void freeBuffer (s32 ctx_index) const
void setIndirectTextureData (const TextureData *p_texture_data)
void setIndirectEnable (bool enable)
void setIndirectTextureTrans (const sead::Vector2f &trans)
Public Member Functions inherited from agl::utl::IParameterIO
 IParameterIO ()
 IParameterIO (const sead::SafeString &type, u32 version=0)
virtual ~IParameterIO ()
virtual bool save (const sead::SafeString &, u32) const
virtual void applyResParameterArchive (ResParameterArchive arc)
virtual void applyResParameterArchiveLerp (ResParameterArchive arc_a, ResParameterArchive arc_b, f32 t)
void setDelegate (void *delegate)
Public Member Functions inherited from agl::utl::IParameterList
 IParameterList ()
void addList (IParameterList *child, const sead::SafeString &name)
void addObj (IParameterObj *child, const sead::SafeString &name)
void applyResParameterList (ResParameterList list)
bool isApply (ResParameterList list) const

Private Member Functions

void assignShaderProgram_ ()
void initVertex_ (sead::Heap *heap)
void initIndex_ (sead::Heap *heap)
bool enableDepthOfField_ () const
bool enableBlurMipMapPass_ () const
bool enableDepthBlur_ () const
bool enableDifferntShape_ () const
bool enableSeparateVignettingPass_ () const
void bindRenderBuffer_ (RenderBuffer &render_buffer, s32 mip_level_color, s32 mip_level_depth) const
void drawKick_ (const DrawArg &arg) const
ShaderMode drawColorMipMap_ (const DrawArg &arg, ShaderMode mode) const
ShaderMode drawDepthMipMap_ (const DrawArg &arg, ShaderMode mode) const
ShaderMode drawCompose_ (const DrawArg &arg, ShaderMode mode) const
ShaderMode drawVignetting_ (const DrawArg &arg, ShaderMode mode) const
void uniformComposeParam_ (const DrawArg &arg, const ShaderProgram *program) const
void uniformVignettingParam_ (const DrawArg &arg, const ShaderProgram *program) const
sead::Vector4f getTexParam_ (const TextureData &data, u32 mip_level=0) const
void applyIndirectTextureData_ ()
void updateIndirectMatrix_ ()
virtual void postRead_ ()

Static Private Member Functions

static s32 roundUp_ (f32 value)
static s32 roundDown_ (f32 value)

Private Attributes

sead::Buffer< ContextmContext
s32 _1e8
f32 _1ec
bool mEnableColorBlur
f32 _1f4
sead::GraphicsContextMRT mGraphicsContext
utl::IParameterObj mParameterObj
utl::Parameter< bool > mEnable
utl::Parameter< bool > mNearEnable
utl::Parameter< bool > mFarEnable
utl::Parameter< bool > mDepthBlur
utl::Parameter< bool > mEnableVignettingColor
utl::Parameter< bool > mEnableVignettingBlur
utl::Parameter< bool > mEnableVignetting2Shape
utl::Parameter< bool > mEnableColorControl
utl::Parameter< bool > mIndirectEnable
utl::Parameter< f32 > mStart
utl::Parameter< f32 > mEnd
utl::Parameter< f32 > mFarStart
utl::Parameter< f32 > mFarEnd
utl::Parameter< f32 > mLevel
utl::Parameter< f32 > mDepthBlurAdd
utl::Parameter< f32 > mSaturateMin
utl::Parameter< sead::Vector4fmColorCtrlDepth
utl::Parameter< sead::Vector2fmIndirectTexTrans
utl::Parameter< sead::Vector2fmIndirectTexScale
utl::Parameter< f32 > mIndirectTexRotate
utl::Parameter< f32 > mIndirectScale
utl::Parameter< f32 > mVignettingBlur
utl::Parameter< s32 > mVignettingBlend
utl::Parameter< sead::Color4fmVignettingColor
TempVignetting mTempVignetting0
TempVignetting mTempVignetting1
utl::Parameter< sead::Color4fmFarMulColor
utl::DebugTexturePage mDebugTexturePage
sead::SafeArray< ShaderProgram *, 2 > mpCurrentProgramNearMask
sead::SafeArray< ShaderProgram *, 2 > mpCurrentProgramMipMap
sead::SafeArray< const ShaderProgram *, 2 > mpCurrentProgramDepthMask
sead::SafeArray< ShaderProgram *, 2 > mpCurrentProgramFinal
ShaderProgrammpCurrentProgramVignetting
const TextureDatampIndirectTextureData
TextureSampler mIndirectTextureSampler
sead::Vector4f mIndirectTexParam
sead::Vector3f mIndirectTexMtx0
sead::Vector3f mIndirectTexMtx1
sead::SafeArray< VignettingShape, 2 > mVignettingShape
u8 _10e8

Additional Inherited Members

Protected Member Functions inherited from agl::utl::IParameterIO
virtual void callbackInvalidVersion_ (ResParameterArchive arc)
Protected Member Functions inherited from agl::utl::IParameterList
virtual bool preWrite_ () const
virtual void postWrite_ () const
virtual bool preRead_ ()
virtual bool isApply_ (ResParameterList list) const
virtual void callbackNotAppliable_ (IParameterObj *, ResParameter)
void setParameterListName_ (const sead::SafeString &name)
void applyResParameterList_ (ResParameterList list, bool lerp=false, f32 t=1.0f)
void applyResParameterListB_ (ResParameterList list, f32 t)
Protected Attributes inherited from agl::utl::IParameterIO
sead::FixedSafeString< 64 > mType
u32 mVersion
void * mpDelegate
sead::FixedSafeString< 256 > mSaveFilePath
Protected Attributes inherited from agl::utl::IParameterList
sead::OffsetList< IParameterListmChildList
sead::OffsetList< IParameterObjmChildObj
sead::FixedSafeString< 64 > mName
u32 mNameHash
sead::ListNode mListNode
IParameterListmpParent

Member Enumeration Documentation

◆ Uniform

Enumerator
cUniform_Param0 
cUniform_IndirectTexParam 
cUniform_IndirectTexMtx0 
cUniform_IndirectTexMtx1 
cUniform_MulParam 
cUniform_AddParam 
cUniform_NearFarParam 
cUniform_TexParam 
cUniform_VignettingRadius 
cUniform_VignettingParam 
cUniform_VignettingTrans 
cUniform_VignettingColor 
cUniform_FarMulColor 
cUniform_Num 

◆ Sampler

Enumerator
cSampler_TexColor 
cSampler_TexDepth 
cSampler_TexMipMap 
cSampler_TexMipMapDepth 
cSampler_TexIndirect 
cSampler_Num 

◆ VignettingBlendType

Enumerator
cVignettingBlendType_Normal 
cVignettingBlendType_Add 
cVignettingBlendType_Mult 
cVignettingBlendType_Screen 

Constructor & Destructor Documentation

◆ DepthOfField()

agl::pfx::DepthOfField::DepthOfField ( )

◆ ~DepthOfField()

agl::pfx::DepthOfField::~DepthOfField ( )
virtual

Member Function Documentation

◆ initialize()

void agl::pfx::DepthOfField::initialize ( s32 ctx_num = 1,
sead::Heap * heap = nullptr )

◆ assignShaderProgram_()

void agl::pfx::DepthOfField::assignShaderProgram_ ( )
private

◆ initVertex_()

void agl::pfx::DepthOfField::initVertex_ ( sead::Heap * heap)
private

◆ initIndex_()

void agl::pfx::DepthOfField::initIndex_ ( sead::Heap * heap)
private

◆ isEnable()

bool agl::pfx::DepthOfField::isEnable ( ) const
inline

◆ setEnable()

void agl::pfx::DepthOfField::setEnable ( bool enable)
inline

◆ getVignettingBlendType()

VignettingBlendType agl::pfx::DepthOfField::getVignettingBlendType ( ) const
inline

◆ draw() [1/2]

ShaderMode agl::pfx::DepthOfField::draw ( s32 ctx_index,
const RenderBuffer & render_buffer,
f32 near,
f32 far,
ShaderMode mode = cShaderMode_Invalid ) const

◆ draw() [2/2]

ShaderMode agl::pfx::DepthOfField::draw ( s32 ctx_index,
const RenderBuffer & render_buffer,
const TextureData & depth,
bool view_depth,
f32 near,
f32 far,
ShaderMode mode = cShaderMode_Invalid ) const

◆ allocBuffer() [1/2]

void agl::pfx::DepthOfField::allocBuffer ( s32 ctx_index,
const RenderBuffer & render_buffer ) const

◆ allocBuffer() [2/2]

void agl::pfx::DepthOfField::allocBuffer ( s32 ctx_index,
TextureFormat format,
s32 width,
s32 height ) const

◆ freeBuffer()

void agl::pfx::DepthOfField::freeBuffer ( s32 ctx_index) const

◆ enableDepthOfField_()

bool agl::pfx::DepthOfField::enableDepthOfField_ ( ) const
private

◆ enableBlurMipMapPass_()

bool agl::pfx::DepthOfField::enableBlurMipMapPass_ ( ) const
private

◆ enableDepthBlur_()

bool agl::pfx::DepthOfField::enableDepthBlur_ ( ) const
private

◆ enableDifferntShape_()

bool agl::pfx::DepthOfField::enableDifferntShape_ ( ) const
private

◆ enableSeparateVignettingPass_()

bool agl::pfx::DepthOfField::enableSeparateVignettingPass_ ( ) const
private

◆ bindRenderBuffer_()

void agl::pfx::DepthOfField::bindRenderBuffer_ ( RenderBuffer & render_buffer,
s32 mip_level_color,
s32 mip_level_depth ) const
private

◆ drawKick_()

void agl::pfx::DepthOfField::drawKick_ ( const DrawArg & arg) const
private

◆ drawColorMipMap_()

ShaderMode agl::pfx::DepthOfField::drawColorMipMap_ ( const DrawArg & arg,
ShaderMode mode ) const
private

◆ drawDepthMipMap_()

ShaderMode agl::pfx::DepthOfField::drawDepthMipMap_ ( const DrawArg & arg,
ShaderMode mode ) const
private

◆ drawCompose_()

ShaderMode agl::pfx::DepthOfField::drawCompose_ ( const DrawArg & arg,
ShaderMode mode ) const
private

◆ drawVignetting_()

ShaderMode agl::pfx::DepthOfField::drawVignetting_ ( const DrawArg & arg,
ShaderMode mode ) const
private

◆ uniformComposeParam_()

void agl::pfx::DepthOfField::uniformComposeParam_ ( const DrawArg & arg,
const ShaderProgram * program ) const
private

◆ uniformVignettingParam_()

void agl::pfx::DepthOfField::uniformVignettingParam_ ( const DrawArg & arg,
const ShaderProgram * program ) const
private

◆ roundUp_()

s32 agl::pfx::DepthOfField::roundUp_ ( f32 value)
inlinestaticprivate

◆ roundDown_()

s32 agl::pfx::DepthOfField::roundDown_ ( f32 value)
inlinestaticprivate

◆ getTexParam_()

sead::Vector4f agl::pfx::DepthOfField::getTexParam_ ( const TextureData & data,
u32 mip_level = 0 ) const
inlineprivate

◆ setIndirectTextureData()

void agl::pfx::DepthOfField::setIndirectTextureData ( const TextureData * p_texture_data)

◆ setIndirectEnable()

void agl::pfx::DepthOfField::setIndirectEnable ( bool enable)

◆ setIndirectTextureTrans()

void agl::pfx::DepthOfField::setIndirectTextureTrans ( const sead::Vector2f & trans)

◆ applyIndirectTextureData_()

void agl::pfx::DepthOfField::applyIndirectTextureData_ ( )
private

◆ updateIndirectMatrix_()

void agl::pfx::DepthOfField::updateIndirectMatrix_ ( )
private

◆ postRead_()

void agl::pfx::DepthOfField::postRead_ ( )
privatevirtual

Reimplemented from agl::utl::IParameterList.

Member Data Documentation

◆ mContext

sead::Buffer<Context> agl::pfx::DepthOfField::mContext
mutableprivate

◆ _1e8

s32 agl::pfx::DepthOfField::_1e8
private

◆ _1ec

f32 agl::pfx::DepthOfField::_1ec
private

◆ mEnableColorBlur

bool agl::pfx::DepthOfField::mEnableColorBlur
private

◆ _1f4

f32 agl::pfx::DepthOfField::_1f4
private

◆ mGraphicsContext

sead::GraphicsContextMRT agl::pfx::DepthOfField::mGraphicsContext
private

◆ mParameterObj

utl::IParameterObj agl::pfx::DepthOfField::mParameterObj
private

◆ mEnable

utl::Parameter<bool> agl::pfx::DepthOfField::mEnable
private

◆ mNearEnable

utl::Parameter<bool> agl::pfx::DepthOfField::mNearEnable
private

◆ mFarEnable

utl::Parameter<bool> agl::pfx::DepthOfField::mFarEnable
private

◆ mDepthBlur

utl::Parameter<bool> agl::pfx::DepthOfField::mDepthBlur
private

◆ mEnableVignettingColor

utl::Parameter<bool> agl::pfx::DepthOfField::mEnableVignettingColor
private

◆ mEnableVignettingBlur

utl::Parameter<bool> agl::pfx::DepthOfField::mEnableVignettingBlur
private

◆ mEnableVignetting2Shape

utl::Parameter<bool> agl::pfx::DepthOfField::mEnableVignetting2Shape
private

◆ mEnableColorControl

utl::Parameter<bool> agl::pfx::DepthOfField::mEnableColorControl
private

◆ mIndirectEnable

utl::Parameter<bool> agl::pfx::DepthOfField::mIndirectEnable
private

◆ mStart

utl::Parameter<f32> agl::pfx::DepthOfField::mStart
private

◆ mEnd

utl::Parameter<f32> agl::pfx::DepthOfField::mEnd
private

◆ mFarStart

utl::Parameter<f32> agl::pfx::DepthOfField::mFarStart
private

◆ mFarEnd

utl::Parameter<f32> agl::pfx::DepthOfField::mFarEnd
private

◆ mLevel

utl::Parameter<f32> agl::pfx::DepthOfField::mLevel
private

◆ mDepthBlurAdd

utl::Parameter<f32> agl::pfx::DepthOfField::mDepthBlurAdd
private

◆ mSaturateMin

utl::Parameter<f32> agl::pfx::DepthOfField::mSaturateMin
private

◆ mColorCtrlDepth

utl::Parameter<sead::Vector4f> agl::pfx::DepthOfField::mColorCtrlDepth
private

◆ mIndirectTexTrans

utl::Parameter<sead::Vector2f> agl::pfx::DepthOfField::mIndirectTexTrans
private

◆ mIndirectTexScale

utl::Parameter<sead::Vector2f> agl::pfx::DepthOfField::mIndirectTexScale
private

◆ mIndirectTexRotate

utl::Parameter<f32> agl::pfx::DepthOfField::mIndirectTexRotate
private

◆ mIndirectScale

utl::Parameter<f32> agl::pfx::DepthOfField::mIndirectScale
private

◆ mVignettingBlur

utl::Parameter<f32> agl::pfx::DepthOfField::mVignettingBlur
private

◆ mVignettingBlend

utl::Parameter<s32> agl::pfx::DepthOfField::mVignettingBlend
private

◆ mVignettingColor

utl::Parameter<sead::Color4f> agl::pfx::DepthOfField::mVignettingColor
private

◆ mTempVignetting0

TempVignetting agl::pfx::DepthOfField::mTempVignetting0
private

◆ mTempVignetting1

TempVignetting agl::pfx::DepthOfField::mTempVignetting1
private

◆ mFarMulColor

utl::Parameter<sead::Color4f> agl::pfx::DepthOfField::mFarMulColor
private

◆ mDebugTexturePage

utl::DebugTexturePage agl::pfx::DepthOfField::mDebugTexturePage
private

◆ mpCurrentProgramNearMask

sead::SafeArray<ShaderProgram*, 2> agl::pfx::DepthOfField::mpCurrentProgramNearMask
private

◆ mpCurrentProgramMipMap

sead::SafeArray<ShaderProgram*, 2> agl::pfx::DepthOfField::mpCurrentProgramMipMap
private

◆ mpCurrentProgramDepthMask

sead::SafeArray<const ShaderProgram*, 2> agl::pfx::DepthOfField::mpCurrentProgramDepthMask
private

◆ mpCurrentProgramFinal

sead::SafeArray<ShaderProgram*, 2> agl::pfx::DepthOfField::mpCurrentProgramFinal
private

◆ mpCurrentProgramVignetting

ShaderProgram* agl::pfx::DepthOfField::mpCurrentProgramVignetting
private

◆ mpIndirectTextureData

const TextureData* agl::pfx::DepthOfField::mpIndirectTextureData
private

◆ mIndirectTextureSampler

TextureSampler agl::pfx::DepthOfField::mIndirectTextureSampler
private

◆ mIndirectTexParam

sead::Vector4f agl::pfx::DepthOfField::mIndirectTexParam
mutableprivate

◆ mIndirectTexMtx0

sead::Vector3f agl::pfx::DepthOfField::mIndirectTexMtx0
private

◆ mIndirectTexMtx1

sead::Vector3f agl::pfx::DepthOfField::mIndirectTexMtx1
private

◆ mVignettingShape

sead::SafeArray<VignettingShape, 2> agl::pfx::DepthOfField::mVignettingShape
private

◆ _10e8

u8 agl::pfx::DepthOfField::_10e8
private