NW4F Eft
Loading...
Searching...
No Matches
nw::eft::Renderer Class Reference

#include <eft_Renderer.h>

Classes

struct  sortPtcl

Public Member Functions

 Renderer (Heap *heap, System *system, const Config &config)
 ~Renderer ()
void BeginRender (const nw::math::MTX44 &proj, const nw::math::MTX34 &view, const nw::math::VEC3 &camPos, f32 near, f32 far)
void EntryParticle (EmitterInstance *emitter, bool cacheFlush=true, void *userParam=NULL)
void EntryParticleFromCallback (const EmitterInstance *emitter, bool cacheFlush, void *userParam)
void EndRender ()
void SetDepthTexture (Texture depthTexture, f32 offsetU=0.0f, f32 offsetV=0.0f, f32 scaleU=1.0f, f32 scaleV=1.0f)
void SetFrameBufferTexture (Texture frameBufferTexture, f32 offsetU=0.0f, f32 offsetV=0.0f, f32 scaleU=1.0f, f32 scaleV=1.0f)
void SetTextureSlot (TextureSlot slot, Texture texture)
void SwapDoubleBuffer ()
void * AllocFromDoubleBuffer (u32 size)
u32 GetDoubleBufferSize () const
u32 GetUsedDoubleBufferSize () const
void FlushCache ()
ParticleShaderGetShader (const EmitterInstance *emitter)
u8 GetUserShaderSetting (const EmitterInstance *emitter)
u32 GetUserShaderFlag (const EmitterInstance *emitter)
const nw::eft::UserShaderParamGetUserShaderParam (const EmitterInstance *emitter)
f32 GetParentParticleUserShaderParam (const EmitterInstance *emitter, u32 paramIdx)
f32 GetChildParticleUserShaderParam (const EmitterInstance *emitter, u32 paramIdx)
f32 GetUserShaderParam (const EmitterInstance *emitter, u32 paramIdx)
void SetDrawViewFlag (DrawViewFlag flag)
DrawViewFlag GetDrawViewFlag () const
u32 GetStripeVertexCalcNum () const
const SystemGetEffectSystem () const
void SetShaderType (ShaderType type)
bool MakeStripeAttributeBlock (EmitterInstance *emitter)
StripeVertexBufferMakeConnectionStripeAttributeBlock (EmitterInstance *emitter, bool cacheFlush)
PrimitiveGetCurrentPrimitive () const
RendercontextGetRenderContext ()
PtclType GetPtclType () const
nw::math::MTX44 GetViewMatrix () const
nw::math::MTX44 GetViewProjMatrix () const

Private Member Functions

void EntryParticleSub (const EmitterInstance *emitter, bool cacheFlush, void *userParam)
void EntryChildParticleSub (const EmitterInstance *emitter, bool cacheFlush, void *userParam)
void RequestParticle (const EmitterInstance *e, ParticleShader *shader, bool bChild, bool cacheFlush, void *userParam)
bool SetupParticleShaderAndVertex (ParticleShader *shader, MeshType meshType, Primitive *primitive)
void EntryStripe (EmitterInstance *emitter, bool cacheFlush, void *userParam)
void EntryConnectionStripe (EmitterInstance *emitter, bool cacheFlush, void *userParam)
bool SetupStripeDrawSetting (const EmitterInstance *emitter, bool cacheFlush, void *userParam)
s32 MakeStripeAttributeBlockCore (PtclStripe *__restrict stripe, StripeVertexBuffer *stripeVertex, s32 wroteVertexNum)
s32 MakeStripeAttributeBlockCoreDivide (PtclStripe *stripe, StripeVertexBuffer *stripeVertex, s32 wroteVertexNum, s32 numDivide)
s32 MakeConnectionStripeAttributeBlockCore (EmitterInstance *emitter, s32 numPtcl, PtclInstance *pTailPtcl, PtclInstance *pTail2ndPtcl, s32 tailType, StripeVertexBuffer *stripeVertex, s32 wroteVertexNum=0)
s32 MakeConnectionStripeAttributeBlockCoreDivide (EmitterInstance *emitter, s32 numPtcl, PtclInstance *pTailPtcl, PtclInstance *pTail2ndPtcl, s32 tailType, StripeVertexBuffer *stripeVertex, s32 wroteVertexNum=0)
bool ConnectionStripeUvScaleCalc (f32 &frateScaleUv, f32 &uvStartOfs, const EmitterInstance *emitter, s32 numLoop, f32 frateScale, s32 tailType)
void BindParticleAttributeBlock (PtclAttributeBuffer *ptclAttributeBuffer, ParticleShader *shader, u32 entryNum)

Static Private Member Functions

static s32 ComparePtclViewZ (const void *a, const void *b)
static void GetPositionOnCubic (nw::math::VEC3 *retPos, const nw::math::VEC3 &startPos, const nw::math::VEC3 &startVel, const nw::math::VEC3 &endPos, const nw::math::VEC3 &endVel, float time)

Private Attributes

SystemmSystem
HeapmHeap
Rendercontext mRenderContext
Draw::PrimitiveType mDrawPrimitiveType
nw::math::MTX44 mMatView
nw::math::MTX44 mMatViewProj
nw::math::MTX44 mMatBillboard
nw::math::VEC3 mEyeVec
nw::math::VEC3 mEyePos
VertexBuffer mPositionVB
VertexBuffer mIndexVB
PrimitivemCurrentPrimitive
ViewUniformBlockmViewUniformBlock
Texture mExtensionTexture [EFT_TEXTURE_SLOT_MAX - EFT_TEXTURE_SLOT_BIN_MAX]
nw::math::VEC2 mDepthTextureOffset
nw::math::VEC2 mDepthTextureScale
nw::math::VEC2 mFrameBufferTextureOffset
nw::math::VEC2 mFrameBufferTextureScale
TemporaryBuffer mTemporaryBuffer
u32 mStripeVertexCalcNum
PtclType mCurrentDrawingType
ShaderType mCurrentShaderType
DrawViewFlag mDrawViewFlag

Constructor & Destructor Documentation

◆ Renderer()

nw::eft::Renderer::Renderer ( Heap * heap,
System * system,
const Config & config )

◆ ~Renderer()

nw::eft::Renderer::~Renderer ( )

Member Function Documentation

◆ ComparePtclViewZ()

s32 nw::eft::Renderer::ComparePtclViewZ ( const void * a,
const void * b )
staticprivate

◆ BeginRender()

void nw::eft::Renderer::BeginRender ( const nw::math::MTX44 & proj,
const nw::math::MTX34 & view,
const nw::math::VEC3 & camPos,
f32 near,
f32 far )

◆ EntryParticle()

void nw::eft::Renderer::EntryParticle ( EmitterInstance * emitter,
bool cacheFlush = true,
void * userParam = NULL )

◆ EntryParticleFromCallback()

void nw::eft::Renderer::EntryParticleFromCallback ( const EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
inline

◆ EndRender()

void nw::eft::Renderer::EndRender ( )

◆ SetDepthTexture()

void nw::eft::Renderer::SetDepthTexture ( Texture depthTexture,
f32 offsetU = 0.0f,
f32 offsetV = 0.0f,
f32 scaleU = 1.0f,
f32 scaleV = 1.0f )
inline

◆ SetFrameBufferTexture()

void nw::eft::Renderer::SetFrameBufferTexture ( Texture frameBufferTexture,
f32 offsetU = 0.0f,
f32 offsetV = 0.0f,
f32 scaleU = 1.0f,
f32 scaleV = 1.0f )
inline

◆ SetTextureSlot()

void nw::eft::Renderer::SetTextureSlot ( TextureSlot slot,
Texture texture )
inline

◆ SwapDoubleBuffer()

void nw::eft::Renderer::SwapDoubleBuffer ( )

◆ AllocFromDoubleBuffer()

void * nw::eft::Renderer::AllocFromDoubleBuffer ( u32 size)

◆ GetDoubleBufferSize()

u32 nw::eft::Renderer::GetDoubleBufferSize ( ) const
inline

◆ GetUsedDoubleBufferSize()

u32 nw::eft::Renderer::GetUsedDoubleBufferSize ( ) const
inline

◆ FlushCache()

void nw::eft::Renderer::FlushCache ( )

◆ GetShader()

ParticleShader * nw::eft::Renderer::GetShader ( const EmitterInstance * emitter)
inline

◆ GetUserShaderSetting()

u8 nw::eft::Renderer::GetUserShaderSetting ( const EmitterInstance * emitter)
inline

◆ GetUserShaderFlag()

u32 nw::eft::Renderer::GetUserShaderFlag ( const EmitterInstance * emitter)
inline

◆ GetUserShaderParam() [1/2]

const nw::eft::UserShaderParam * nw::eft::Renderer::GetUserShaderParam ( const EmitterInstance * emitter)
inline

◆ GetParentParticleUserShaderParam()

f32 nw::eft::Renderer::GetParentParticleUserShaderParam ( const EmitterInstance * emitter,
u32 paramIdx )
inline

◆ GetChildParticleUserShaderParam()

f32 nw::eft::Renderer::GetChildParticleUserShaderParam ( const EmitterInstance * emitter,
u32 paramIdx )
inline

◆ GetUserShaderParam() [2/2]

f32 nw::eft::Renderer::GetUserShaderParam ( const EmitterInstance * emitter,
u32 paramIdx )
inline

◆ SetDrawViewFlag()

void nw::eft::Renderer::SetDrawViewFlag ( DrawViewFlag flag)
inline

◆ GetDrawViewFlag()

DrawViewFlag nw::eft::Renderer::GetDrawViewFlag ( ) const
inline

◆ GetStripeVertexCalcNum()

u32 nw::eft::Renderer::GetStripeVertexCalcNum ( ) const
inline

◆ GetEffectSystem()

const System * nw::eft::Renderer::GetEffectSystem ( ) const
inline

◆ SetShaderType()

void nw::eft::Renderer::SetShaderType ( ShaderType type)
inline

◆ MakeStripeAttributeBlock()

bool nw::eft::Renderer::MakeStripeAttributeBlock ( EmitterInstance * emitter)

◆ MakeConnectionStripeAttributeBlock()

StripeVertexBuffer * nw::eft::Renderer::MakeConnectionStripeAttributeBlock ( EmitterInstance * emitter,
bool cacheFlush )

◆ GetCurrentPrimitive()

Primitive * nw::eft::Renderer::GetCurrentPrimitive ( ) const
inline

◆ GetRenderContext()

Rendercontext & nw::eft::Renderer::GetRenderContext ( )
inline

◆ GetPtclType()

PtclType nw::eft::Renderer::GetPtclType ( ) const
inline

◆ GetViewMatrix()

nw::math::MTX44 nw::eft::Renderer::GetViewMatrix ( ) const
inline

◆ GetViewProjMatrix()

nw::math::MTX44 nw::eft::Renderer::GetViewProjMatrix ( ) const
inline

◆ EntryParticleSub()

void nw::eft::Renderer::EntryParticleSub ( const EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
private

◆ EntryChildParticleSub()

void nw::eft::Renderer::EntryChildParticleSub ( const EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
private

◆ RequestParticle()

void nw::eft::Renderer::RequestParticle ( const EmitterInstance * e,
ParticleShader * shader,
bool bChild,
bool cacheFlush,
void * userParam )
private

◆ SetupParticleShaderAndVertex()

bool nw::eft::Renderer::SetupParticleShaderAndVertex ( ParticleShader * shader,
MeshType meshType,
Primitive * primitive )
private

◆ EntryStripe()

void nw::eft::Renderer::EntryStripe ( EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
private

◆ EntryConnectionStripe()

void nw::eft::Renderer::EntryConnectionStripe ( EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
private

◆ SetupStripeDrawSetting()

bool nw::eft::Renderer::SetupStripeDrawSetting ( const EmitterInstance * emitter,
bool cacheFlush,
void * userParam )
private

◆ MakeStripeAttributeBlockCore()

s32 nw::eft::Renderer::MakeStripeAttributeBlockCore ( PtclStripe *__restrict stripe,
StripeVertexBuffer * stripeVertex,
s32 wroteVertexNum )
private

◆ MakeStripeAttributeBlockCoreDivide()

s32 nw::eft::Renderer::MakeStripeAttributeBlockCoreDivide ( PtclStripe * stripe,
StripeVertexBuffer * stripeVertex,
s32 wroteVertexNum,
s32 numDivide )
private

◆ MakeConnectionStripeAttributeBlockCore()

s32 nw::eft::Renderer::MakeConnectionStripeAttributeBlockCore ( EmitterInstance * emitter,
s32 numPtcl,
PtclInstance * pTailPtcl,
PtclInstance * pTail2ndPtcl,
s32 tailType,
StripeVertexBuffer * stripeVertex,
s32 wroteVertexNum = 0 )
private

◆ MakeConnectionStripeAttributeBlockCoreDivide()

s32 nw::eft::Renderer::MakeConnectionStripeAttributeBlockCoreDivide ( EmitterInstance * emitter,
s32 numPtcl,
PtclInstance * pTailPtcl,
PtclInstance * pTail2ndPtcl,
s32 tailType,
StripeVertexBuffer * stripeVertex,
s32 wroteVertexNum = 0 )
private

◆ ConnectionStripeUvScaleCalc()

bool nw::eft::Renderer::ConnectionStripeUvScaleCalc ( f32 & frateScaleUv,
f32 & uvStartOfs,
const EmitterInstance * emitter,
s32 numLoop,
f32 frateScale,
s32 tailType )
private

◆ GetPositionOnCubic()

void nw::eft::Renderer::GetPositionOnCubic ( nw::math::VEC3 * retPos,
const nw::math::VEC3 & startPos,
const nw::math::VEC3 & startVel,
const nw::math::VEC3 & endPos,
const nw::math::VEC3 & endVel,
float time )
staticprivate

◆ BindParticleAttributeBlock()

void nw::eft::Renderer::BindParticleAttributeBlock ( PtclAttributeBuffer * ptclAttributeBuffer,
ParticleShader * shader,
u32 entryNum )
private

Member Data Documentation

◆ mSystem

System* nw::eft::Renderer::mSystem
private

◆ mHeap

Heap* nw::eft::Renderer::mHeap
private

◆ mRenderContext

Rendercontext nw::eft::Renderer::mRenderContext
private

◆ mDrawPrimitiveType

Draw::PrimitiveType nw::eft::Renderer::mDrawPrimitiveType
private

◆ mMatView

nw::math::MTX44 nw::eft::Renderer::mMatView
private

◆ mMatViewProj

nw::math::MTX44 nw::eft::Renderer::mMatViewProj
private

◆ mMatBillboard

nw::math::MTX44 nw::eft::Renderer::mMatBillboard
private

◆ mEyeVec

nw::math::VEC3 nw::eft::Renderer::mEyeVec
private

◆ mEyePos

nw::math::VEC3 nw::eft::Renderer::mEyePos
private

◆ mPositionVB

VertexBuffer nw::eft::Renderer::mPositionVB
private

◆ mIndexVB

VertexBuffer nw::eft::Renderer::mIndexVB
private

◆ mCurrentPrimitive

Primitive* nw::eft::Renderer::mCurrentPrimitive
private

◆ mViewUniformBlock

ViewUniformBlock* nw::eft::Renderer::mViewUniformBlock
private

◆ mExtensionTexture

Texture nw::eft::Renderer::mExtensionTexture[EFT_TEXTURE_SLOT_MAX - EFT_TEXTURE_SLOT_BIN_MAX]
private

◆ mDepthTextureOffset

nw::math::VEC2 nw::eft::Renderer::mDepthTextureOffset
private

◆ mDepthTextureScale

nw::math::VEC2 nw::eft::Renderer::mDepthTextureScale
private

◆ mFrameBufferTextureOffset

nw::math::VEC2 nw::eft::Renderer::mFrameBufferTextureOffset
private

◆ mFrameBufferTextureScale

nw::math::VEC2 nw::eft::Renderer::mFrameBufferTextureScale
private

◆ mTemporaryBuffer

TemporaryBuffer nw::eft::Renderer::mTemporaryBuffer
private

◆ mStripeVertexCalcNum

u32 nw::eft::Renderer::mStripeVertexCalcNum
private

◆ mCurrentDrawingType

PtclType nw::eft::Renderer::mCurrentDrawingType
private

◆ mCurrentShaderType

ShaderType nw::eft::Renderer::mCurrentShaderType
private

◆ mDrawViewFlag

DrawViewFlag nw::eft::Renderer::mDrawViewFlag
private