IVSmoke 1.0
Loading...
Searching...
No Matches
FIVSmokeCSMRenderer Class Reference

#include <IVSmokeCSMRenderer.h>

Collaboration diagram for FIVSmokeCSMRenderer:
Collaboration graph

Public Member Functions

void Initialize (UWorld *World, int32 NumCascades, int32 Resolution, float MaxDistance)
 
void Shutdown ()
 
bool IsInitialized () const
 
void Update (const FVector &CameraPosition, const FVector &CameraForward, const FVector &LightDirection, uint32 FrameNumber)
 
int32 GetNumCascades () const
 
const FIVSmokeCascadeDataGetCascade (int32 Index) const
 
const TArray< FIVSmokeCascadeData > & GetCascades () const
 
TArray< float > GetSplitDistances () const
 
FTextureRHIRef GetVSMTexture (int32 CascadeIndex) const
 
FTextureRHIRef GetDepthTexture (int32 CascadeIndex) const
 
bool HasValidShadowData () const
 
FVector GetLightCameraPosition (int32 CascadeIndex) const
 
FVector GetMainCameraPosition () const
 

Detailed Description

Cascaded Shadow Map renderer for volumetric smoke. Manages multiple shadow cascades with priority-based updates.

Features:

  • Configurable cascade count (1-8)
  • Log/Linear split distribution
  • Texel snapping for shimmer prevention
  • Priority-based update (near cascades update more frequently)
  • VSM support for soft shadows

Definition at line 106 of file IVSmokeCSMRenderer.h.

Constructor & Destructor Documentation

◆ FIVSmokeCSMRenderer()

FIVSmokeCSMRenderer::FIVSmokeCSMRenderer ( )

Definition at line 15 of file IVSmokeCSMRenderer.cpp.

◆ ~FIVSmokeCSMRenderer()

FIVSmokeCSMRenderer::~FIVSmokeCSMRenderer ( )

Definition at line 19 of file IVSmokeCSMRenderer.cpp.

Member Function Documentation

◆ GetCascade()

const FIVSmokeCascadeData & FIVSmokeCSMRenderer::GetCascade ( int32  Index) const
inline

Get cascade data by index.

Definition at line 158 of file IVSmokeCSMRenderer.h.

◆ GetCascades()

const TArray< FIVSmokeCascadeData > & FIVSmokeCSMRenderer::GetCascades ( ) const
inline

Get all cascade data.

Definition at line 161 of file IVSmokeCSMRenderer.h.

◆ GetDepthTexture()

FTextureRHIRef FIVSmokeCSMRenderer::GetDepthTexture ( int32  CascadeIndex) const

Get depth texture for a cascade.

Definition at line 566 of file IVSmokeCSMRenderer.cpp.

◆ GetLightCameraPosition()

FVector FIVSmokeCSMRenderer::GetLightCameraPosition ( int32  CascadeIndex) const

Get light camera position for a cascade.

Parameters
CascadeIndexIndex of cascade.
Returns
Light camera world position for the specified cascade.

Definition at line 588 of file IVSmokeCSMRenderer.cpp.

◆ GetMainCameraPosition()

FVector FIVSmokeCSMRenderer::GetMainCameraPosition ( ) const
inline

Get main camera position.

Definition at line 184 of file IVSmokeCSMRenderer.h.

◆ GetNumCascades()

int32 FIVSmokeCSMRenderer::GetNumCascades ( ) const
inline

Get number of active cascades.

Definition at line 155 of file IVSmokeCSMRenderer.h.

◆ GetSplitDistances()

TArray< float > FIVSmokeCSMRenderer::GetSplitDistances ( ) const

Get cascade split distances (for shader).

Definition at line 542 of file IVSmokeCSMRenderer.cpp.

◆ GetVSMTexture()

FTextureRHIRef FIVSmokeCSMRenderer::GetVSMTexture ( int32  CascadeIndex) const

Get VSM texture for a cascade (nullptr if VSM disabled).

Definition at line 555 of file IVSmokeCSMRenderer.cpp.

◆ HasValidShadowData()

bool FIVSmokeCSMRenderer::HasValidShadowData ( ) const

Check if any cascade has valid shadow data.

Definition at line 577 of file IVSmokeCSMRenderer.cpp.

◆ Initialize()

void FIVSmokeCSMRenderer::Initialize ( UWorld *  World,
int32  NumCascades,
int32  Resolution,
float  MaxDistance 
)

Initialize CSM renderer with specified settings. Creates cascade render targets and capture components.

Parameters
WorldWorld to create capture components in.
NumCascadesNumber of shadow cascades (1-8).
ResolutionShadow map resolution per cascade.
MaxDistanceMaximum shadow distance in world units.

Definition at line 27 of file IVSmokeCSMRenderer.cpp.

◆ IsInitialized()

bool FIVSmokeCSMRenderer::IsInitialized ( ) const
inline

Check if renderer is initialized.

Definition at line 130 of file IVSmokeCSMRenderer.h.

◆ Shutdown()

void FIVSmokeCSMRenderer::Shutdown ( )

Release all resources.

Definition at line 99 of file IVSmokeCSMRenderer.cpp.

◆ Update()

void FIVSmokeCSMRenderer::Update ( const FVector &  CameraPosition,
const FVector &  CameraForward,
const FVector &  LightDirection,
uint32  FrameNumber 
)

Update shadow cascades for current frame. Calculates cascade splits, applies texel snapping, and triggers captures.

Parameters
CameraPositionCurrent camera world position.
CameraForwardCamera forward direction.
LightDirectionDirection TOWARD the light source (opposite of light travel).
FrameNumberCurrent frame number for priority update.

Definition at line 136 of file IVSmokeCSMRenderer.cpp.


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