UNiagaraDataInterface

Base class for all Niagara data interfaces.

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UNiagaraMergeable

UNiagaraDataInterfaceBase

UNiagaraDataInterface

UNiagaraDataInterface2DArrayTexture

UNiagaraDataInterfaceAsyncGpuTrace

UNiagaraDataInterfaceAudioOscilloscope

UNiagaraDataInterfaceAudioPlayer

UNiagaraDataInterfaceAudioSubmix

UNiagaraDataInterfaceAudioSpectrum

UNiagaraDataInterfaceCamera

UNiagaraDataInterfaceChaosDestruction

UNiagaraDataInterfaceCollisionQuery

UNiagaraDataInterfaceCubeTexture

UNiagaraDataInterfaceCurlNoise

UNiagaraDataInterfaceCurveBase

UNiagaraDataInterfaceColorCurve

UNiagaraDataInterfaceCurve

UNiagaraDataInterfaceVector2DCurve

UNiagaraDataInterfaceVector4Curve

UNiagaraDataInterfaceVectorCurve

UNiagaraDataInterfaceExport

UNiagaraDataInterfaceGeometryCollection

UNiagaraDataInterfaceHairStrands

UNiagaraDataInterfaceLandscape

UNiagaraDataInterfaceMeshRendererInfo

UNiagaraDataInterfaceOcclusion

UNiagaraDataInterfacePhysicsAsset

UNiagaraDataInterfacePhysicsField

UNiagaraDataInterfacePlatformSet

UNiagaraDataInterfaceRigidMeshCollisionQuery

UNiagaraDataInterfaceRWBase

UNiagaraDataInterfaceArray

UNiagaraDataInterfaceArrayBool

UNiagaraDataInterfaceArrayColor

UNiagaraDataInterfaceArrayFloat

UNiagaraDataInterfaceArrayFloat2

UNiagaraDataInterfaceArrayFloat3

UNiagaraDataInterfaceArrayFloat4

UNiagaraDataInterfaceArrayInt32

UNiagaraDataInterfaceArrayNiagaraID

UNiagaraDataInterfaceArrayPosition

UNiagaraDataInterfaceArrayQuat

UNiagaraDataInterfaceArrayUInt8

UNiagaraDataInterfaceGrid2D

UNiagaraDataInterfaceGrid2DCollection

UNiagaraDataInterfaceGrid2DCollectionReader

UNiagaraDataInterfaceGrid3D

UNiagaraDataInterfaceGrid3DCollection

UNiagaraDataInterfaceGrid3DCollectionReader

UNiagaraDataInterfaceNeighborGrid3D

UNiagaraDataInterfaceRasterizationGrid3D

UNiagaraDataInterfaceIntRenderTarget2D

UNiagaraDataInterfaceParticleRead

UNiagaraDataInterfaceRenderTarget2D

UNiagaraDataInterfaceRenderTarget2DArray

UNiagaraDataInterfaceRenderTargetCube

UNiagaraDataInterfaceRenderTargetVolume

UNiagaraDataInterfaceVelocityGrid

UNiagaraDataInterfacePressureGrid

UNiagaraDataInterfaceSkeletalMesh

UNiagaraDataInterfaceSpline

UNiagaraDataInterfaceSpriteRendererInfo

UNiagaraDataInterfaceTexture

UNiagaraDataInterfaceVectorField

UNiagaraDataInterfaceVolumeCache

UNiagaraDataInterfaceVolumeTexture

UNiagaraDataInterfaceWater

References

Module

Niagara

Header

/Engine/Plugins/FX/Niagara/Source/Niagara/Classes/NiagaraDataInterface.h

Include

#include "NiagaraDataInterface.h"

Syntax

UCLASS(Abstract, EditInlineNew)
class UNiagaraDataInterface : public UNiagaraDataInterfaceBase

Remarks

Base class for all Niagara data interfaces.

Variables

Name Description

Protected variable

uint32: 1

 

bRenderDataDirty

Protected variable

uint32: 1

 

bUsedByCPUEmitter

Protected variable

uint32: 1

 

bUsedByGPUEmitter

Protected variable

TUniquePtr< FNi...

 

Proxy

Constructors

Name Description

Public function

UNiagaraDataInterface

(
    const FObjectInitializer& ObjectIn...
)

Destructors

Name Description

Public function Virtual

~UNiagaraDataInterface()

Functions

Name Description

Public function Virtual Const

bool

 

AppendCompileHash

(
    FNiagaraCompileHashVisitor* In...
)

Allows the generic class defaults version of this class to specify any dependencies/version/etc that might invalidate the compile.

Public function Const

void

 

AppendTemplateHLSL

(
    FString& OutHLSL,
    const TCHAR* TemplateShaderFil...,
    const TMap< FString, FStringFormatA...
)

Formats and appends a template file onto the output HLSL

Public function Virtual

void

 

CacheStaticBuffers

(
    FNiagaraSystemStaticBuffers& Stati...,
    const FNiagaraScriptDataInterfaceIn...,
    bool bUsedByCPU,
    bool bUsedByGPU
)

Allows data interfaces to cache any static data that may be shared between instances

Public function Virtual Const

ETickingGrou...

 

CalculateTickGroup

(
    const void* PerInstanceData
)

Public function Virtual Const

bool

 

CanExecuteOnTarget

(
    ENiagaraSimTarget Target
)

Public function Virtual Const

bool

 

CanExposeVariables()

Public function Virtual Const

bool

 

CanRenderVariablesToCanvas()

Public function Const

bool

 

CopyTo

(
    UNiagaraDataInterface* Destina...
)

Copies the contents of this DataInterface to another.

Protected function Virtual Const

bool

 

CopyToInternal

(
    UNiagaraDataInterface* Destina...
)

Public function Virtual

void

 

DestroyPerInstanceData

(
    void* PerInstanceData,
    FNiagaraSystemInstance* System...
)

Destroys the per instance data for this interface.

Public function Virtual Const

void

 

DrawDebugHud

(
    UCanvas* Canvas,
    FNiagaraSystemInstance* System...,
    FString& VariableDataString,
    bool bVerbose
)

Override this function to provide additional context to the debug HUD.

Public function Virtual Const

bool

 

Equals

(
    const UNiagaraDataInterface* O...
)

Determines if this DataInterface is the same as another.

Public function Virtual Const

bool

 

GenerateCompilerTagPrefix

(
    const FNiagaraFunctionSignature& I...,
    FString& OutPrefix
)

Used by the translator when dealing with signatures that turn into compiler tags to figure out the precise compiler tag.

Public function Virtual Const

bool

 

GenerateIterationSourceNamespaceReadAttributesHLSL

(
    FNiagaraDataInterfaceGPUParamInfo&...,
    const FNiagaraVariable& InIteratio...,
    TConstArrayView< FNiagaraVariable >...,
    TConstArrayView< FNiagaraVariable >...,
    TConstArrayView< FString > InAttrib...,
    bool bInSetToDefaults,
    bool bSpawnOnly,
    bool bPartialWrites,
    TArray< FText >& OutErrors,
    FString& OutHLSL
)

Generate the necessary plumbing HLSL at the beginning of the stage where this is used as a sim stage iteration source.

Public function Virtual Const

bool

 

GenerateIterationSourceNamespaceWriteAttributesHLSL

(
    FNiagaraDataInterfaceGPUParamInfo&...,
    const FNiagaraVariable& InIteratio...,
    TConstArrayView< FNiagaraVariable >...,
    TConstArrayView< FNiagaraVariable >...,
    TConstArrayView< FString > InAttrib...,
    TConstArrayView< FNiagaraVariable >...,
    bool bSpawnOnly,
    bool bPartialWrites,
    TArray< FText >& OutErrors,
    FString& OutHLSL
)

Generate the necessary plumbing HLSL at the end of the stage where this is used as a sim stage iteration source.

Public function Virtual Const

bool

 

GenerateSetupHLSL

(
    FNiagaraDataInterfaceGPUParamInfo&...,
    TConstArrayView< FNiagaraVariable >...,
    bool bSpawnOnly,
    bool bPartialWrites,
    TArray< FText >& OutErrors,
    FString& OutHLSL
)

Generate the necessary HLSL to set up data when being added as a sim stage sim source.

Public function Virtual Const

bool

 

GenerateTeardownHLSL

(
    FNiagaraDataInterfaceGPUParamInfo&...,
    TConstArrayView< FNiagaraVariable >...,
    bool bSpawnOnly,
    bool bPartialWrites,
    TArray< FText >& OutErrors,
    FString& OutHLSL
)

Generate the necessary HLSL to tear down data when being added as a sim stage sim source.

Public function Virtual Const

void

 

GetAssetTagsForContext

(
    const UObject* InAsset,
    FGuid AssetVersion,
    const TArray< const UNiagaraDataInt...,
    TMap< FName, uint32 >& NumericKeys,
    TMap< FName, FString >& StringKeys
)

Method to add asset tags that are specific to this data interface.

Public function Virtual Const

void

 

GetCanvasVariables

(
    TArray< FNiagaraVariableBase >& Ou...
)

Public function Virtual

void

 

GetCommonHLSL

(
    FString& OutHLSL
)

Allows data interfaces to provide common functionality that will be shared across interfaces on that type.

Public function Virtual Const

void

 

GetEmitterDependencies

(
    UNiagaraSystem* Asset,
    TArray< FVersionedNiagaraEmitter > ...
)

Allows a DI to specify data dependencies between emitters, so the system can ensure that the emitter instances are executed in the correct order.

Public function Virtual

TArray< FNia...

 

GetErrors()

Refreshes and returns the errors detected with the corresponding data, if any.

Public function Virtual Const

void

 

GetExposedVariables

(
    TArray< FNiagaraVariableBase >& Ou...
)

Public function Virtual Const

bool

 

GetExposedVariableValue

(
    const FNiagaraVariableBase& InVari...,
    void* InPerInstanceData,
    FNiagaraSystemInstance* InSyst...,
    void* OutData
)

Public function Static

void

 

GetFeedback

Public function Virtual

void

 

GetFeedback

(
    UNiagaraSystem* InAsset,
    UNiagaraComponent* InComponent,
    TArray< FNiagaraDataInterfaceError ...,
    TArray< FNiagaraDataInterfaceFeedba...,
    TArray< FNiagaraDataInterfaceFeedba...
)

Query the data interface to give feedback to the end user.

Public function Virtual

bool

 

GetFunctionHLSL

(
    FNiagaraDataInterfaceHlslGeneration...,
    FString& OutHLSL
)

Public function Virtual

bool

 

GetFunctionHLSL

(
    const FNiagaraDataInterfaceGPUParam...,
    const FNiagaraDataInterfaceGenerate...,
    int FunctionInstanceIndex,
    FString& OutHLSL
)

Public function Virtual

void

 

GetFunctions

Gets all the available functions for this data interface.

Public function Virtual Const

FIntVector

 

GetGpuDispatchNumThreads()

Public function Virtual Const

ENiagaraGpuD...

 

GetGpuDispatchType()

Public function Virtual Const

bool

 

GetGpuUseIndirectDispatch()

Public function Virtual

void

 

GetParameterDefinitionHLSL

(
    const FNiagaraDataInterfaceGPUParam...,
    FString& OutHLSL
)

Public function Virtual

void

 

GetParameterDefinitionHLSL

(
    FNiagaraDataInterfaceHlslGeneration...,
    FString& OutHLSL
)

Public function

FNiagaraData...

 

GetProxy()

Protected function

T *

 

GetProxyAs()

Protected function Const

const T *...

 

GetProxyAs()

Public function Virtual

void

 

GetVMExternalFunction

(
    const FVMExternalFunctionBindingInf...,
    void* InstanceData,
    FVMExternalFunction& OutFunc
)

Returns the delegate for the passed function signature.

Public function Virtual Const

bool

 

GPUContextInit

(
    const FNiagaraScriptDataInterfaceCo...,
    void* PerInstanceData,
    FNiagaraSystemInstance* System...
)

Public function Virtual Const

bool

 

HasPostSimulateTick()

Public function Virtual Const

bool

 

HasPreSimulateTick()

Public function Virtual Const

bool

 

HasTickGroupPrereqs()

Public function Virtual

bool

 

InitPerInstanceData

(
    void* PerInstanceData,
    FNiagaraSystemInstance* System...
)

Initializes the per instance data for this interface.

Public function Static

bool

 

IsDataInterfaceType

(
    const FNiagaraTypeDefinition& Type...
)

Determines if this type definition matches to a known data interface type.

Public function Const

bool

 

IsUsedByCPUEmitter()

Public function Const

bool

 

IsUsedByGPUEmitter()

Public function Const

bool

 

IsUsedWithCPUEmitter()

Used to determine if we need to create CPU resources for the emitter.

Public function Const

bool

 

IsUsedWithGPUEmitter()

Used to determine if we need to create GPU resources for the emitter.

Public function

void

 

MarkRenderDataDirty()

Public function Virtual Const

void

 

ModifyCompilationEnvironment

(
    EShaderPlatform ShaderPlatform,
    FShaderCompilerEnvironment& OutEnv...
)

Allows data interfaces to influence the compilation of GPU shaders and is only called on the CDO object not the instance.

Public function Virtual Const

bool

 

NeedsGPUContextInit()

Public function

FSimpleMulti...

 

OnErrorsRefreshed()

Public function Virtual Const

int32

 

PerInstanceDataPassedToRenderThreadSize()

The size of the data this class will provide to ProvidePerInstanceDataForRenderThread.

Public function Virtual Const

int32

 

PerInstanceDataSize()

Returns the size of the per instance data for this interface.

Public function Virtual

bool

 

PerInstanceTick

(
    void* PerInstanceData,
    FNiagaraSystemInstance* System...,
    float DeltaSeconds
)

Ticks the per instance data for this interface, if it has any.

Public function Virtual

bool

 

PerInstanceTickPostSimulate

(
    void* PerInstanceData,
    FNiagaraSystemInstance* System...,
    float DeltaSeconds
)

Public function Virtual

void

 

PostCompile()

Called after system compilation completes. Useful for caching any constant, compile dependent data.

Public function Virtual Const

bool

 

PostSimulateCanOverlapFrames()

When set to true the simulation may not complete in the same frame it started, allowing maximum overlap with the GameThread.

Public function Virtual

void

 

ProvidePerInstanceDataForRenderThread

(
    void* DataForRenderThread,
    void* PerInstanceData,
    const FNiagaraSystemInstanceID& Sy...
)

Subclasses that wish to work with GPU systems/emitters must implement this.

Public function

void

 

PushToRenderThread()

Protected function Virtual

void

 

PushToRenderThreadImpl()

Public function Virtual Const

bool

 

ReadsEmitterParticleData

(
    const FString& EmitterName
)

Public function

void

 

RefreshErrors()

Public function Virtual Const

bool

 

RenderVariableToCanvas

(
    FNiagaraSystemInstanceID SystemInst...,
    FName VariableName,
    FCanvas* Canvas,
    const FIntRect& DrawRect
)

Public function Virtual Const

bool

 

RequiresDepthBuffer()

Public function Virtual Const

bool

 

RequiresDistanceFieldData()

Public function Virtual Const

bool

 

RequiresEarlyViewData()

Public function Virtual Const

bool

 

RequiresRayTracingScene()

Public function Virtual Const

void

 

SetShaderParameters

(
    const FNiagaraDataInterfaceSetShade...
)

Set the shader parameters will only be called if the data interface provided shader parameters.

Public function

void

 

SetUsedByCPUEmitter

(
    bool bUsed
)

Public function

void

 

SetUsedByGPUEmitter

(
    bool bUsed
)

Public function Virtual Const

bool

 

ShouldCompile

(
    EShaderPlatform ShaderPlatform
)

Allows data interfaces to prevent compilation of GPU shaders and is only called on the CDO object not the instance.

Public function Virtual Const

bool

 

SupportsIterationSourceNamespaceAttributesHLSL()

Can this data interface be used as a StackContext parameter map replacement when being used as a sim stage iteration source?

Public function Virtual Const

bool

 

SupportsSetupAndTeardownHLSL()

Does this data interface need setup and teardown for each stage when working a sim stage sim source?

Public function Virtual

bool

 

UpgradeFunctionCall

(
    FNiagaraFunctionSignature& Functio...
)

Allows data interfaces the opportunity to rename / change the function signature and perform an upgrade.

Public function Virtual

void

 

ValidateFunction

(
    const FNiagaraFunctionSignature& F...,
    TArray< FText >& OutValidationErro...
)

Validates a function being compiled and allows interface classes to post custom compile errors when their API changes.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel