FNiagaraShaderScript

[FNiagaraShaderScript](API\Plugins\NiagaraShader\FNiagaraShaderScript) represents a Niagara script to the shader compilation process

Windows
MacOS
Linux

References

Module

NiagaraShader

Header

/Engine/Plugins/FX/Niagara/Source/NiagaraShader/Public/NiagaraShared.h

Include

#include "NiagaraShared.h"

Syntax

class FNiagaraShaderScript

Remarks

FNiagaraShaderScript represents a Niagara script to the shader compilation process

Variables

Name Description

Public variable

FString

 

HlslOutput

Public variable

FString

 

SourceName

Constructors

Name Description

Public function

FNiagaraShaderScript()

Minimal initialization constructor.

Destructors

Name Description

Public function Virtual

~FNiagaraShaderScript()

Destructor

Functions

Name Description

Public function

void

 

AddCompileId

(
    uint32 Id
)

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Public function

bool

 

CacheShaders

(
    const FNiagaraShaderMapId& ShaderM...,
    bool bApplyCompletedShaderMapForRen...,
    bool bForceRecompile,
    bool bSynchronous
)

Caches the shaders for this script with no static parameters on the given platform.

Public function

bool

 

CacheShaders

(
    bool bApplyCompletedShaderMapForRen...,
    bool bForceRecompile,
    bool bSynchronous
)

Caches the shaders for this script with no static parameters on the given platform.

Public function

void

 

CancelCompilation()

Cancels all outstanding compilation jobs

Public function

void

 

DiscardShaderMap()

Public function

void

 

FinishCompilation()

Blocks until compilation has completed. Returns immediately if a compilation is not outstanding.

Public function

UNiagaraScri...

 

GetBaseVMScript()

Public function Const

const TArray...

 

GetCompileErrors()

Accessors.

Public function

TArray< FNia...

 

GetDataInterfaceParamInfo()

Public function Const

void

 

GetDependentShaderTypes

(
    EShaderPlatform Platform,
    TArray< FShaderType* >& OutSh...
)

Public function Const

ERHIFeatureL...

 

GetFeatureLevel()

Public function Const

const FStrin...

 

GetFriendlyName()

Public function Const

FNiagaraShad...

 

GetGameThreadShaderMap()

Public function Const

FNiagaraShad...

 

GetRenderingThreadShaderMap()

Public function

bool

 

GetScriptHLSLSource

(
    FString& OutSource
)

Returns true if this script is allowed to make development shaders via the global CVar CompileShadersForDevelopment.

Public function Const

FNiagaraShad...

 

GetShader()

Public function Const

FNiagaraShad...

 

GetShaderGameThread()

Public function Virtual Const

void

 

GetShaderMapId

(
    EShaderPlatform Platform,
    FNiagaraShaderMapId& OutId
)

Protected function

void

 

GetShaderMapIDsWithUnfinishedCompilation

(
    TArray< int32 >& ShaderMapIds
)

Fills the passed array with IDs of shader maps unfinished compilation jobs.

Protected function Const

const FNiaga...

 

GetShaderMapToUse()

Shared code needed for GetUniformScalarParameterExpressions, GetUniformVectorParameterExpressions, GetUniformCubeTextureExpressions..

Public function Const

EShaderPlatf...

 

GetShaderPlatform()

Public function Const

uint32

 

GetUseSimStagesDefine()

Public function Const

bool

 

HasValidGameThreadShaderMap()

Checks if there is a valid GameThreadShaderMap, that is, the script can be run

Public function

void

 

Invalidate()

Public function Const

bool

 

IsCompilationFinished()

Checks if the compilation for this shader is finished

Public function Virtual Const

bool

 

IsPersistent()

Should shaders compiled for this script be saved to disk?

Public function Const

bool

 

IsSame

(
    const FNiagaraShaderMapId& InId
)

Public function Virtual

void

 

LegacySerialize

(
    FArchive& Ar
)

Serializes the script.

Public function Const

bool

 

MatchesScript

(
    ERHIFeatureLevel::Type InFeatureLev...,
    EShaderPlatform InShaderPlatform,
    const FNiagaraVMExecutableDataId& ...
)

Public function Virtual

void

 

NotifyCompilationFinished()

Called when compilation finishes, after the GameThreadShaderMap is set and the render command to set the RenderThreadShaderMap is queued

Public function

FOnNiagaraSc...

 

OnCompilationComplete()

Public function

void

 

ReleaseShaderMap()

Releases this script's shader map.

Public function

void

 

RemoveOutstandingCompileId

(
    const int32 OldOutstandingCompileSh...
)

Public function

void

 

SerializeShaderMap

(
    FArchive& Ar
)

Public function

void

 

SetCompileErrors

(
    const TArray< FString >& InCompile...
)

Public function

void

 

SetCompileErrors

(
    TArray< FString >& InErrors
)

Public function

void

 

SetDataInterfaceParamInfo

(
    const TArray< FNiagaraDataInterface...
)

Protected function

void

 

SetFeatureLevel

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Public function

void

 

SetGameThreadShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

Note: SetRenderingThreadShaderMap must also be called with the same value, but from the rendering thread.

Public function

void

 

SetRenderingThreadShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

Note: SetGameThreadShaderMap must also be called with the same value, but from the game thread.

Public function

void

 

SetScript

(
    UNiagaraScript* InScript,
    ERHIFeatureLevel::Type InFeatureLev...,
    EShaderPlatform InShaderPlatform,
    const FGuid& InCompilerVersion,
    const TArray< FString >& InAdditio...,
    const FNiagaraCompileHash& InBaseC...,
    const TArray< FNiagaraCompileHash >...,
    bool bInUsesRapidIterationParams,
    FString InFriendlyName
)

Public function

void

 

SetShaderMap

(
    FNiagaraShaderMap* InShaderMap
)

Public function Virtual Const

bool

 

ShouldCache

(
    EShaderPlatform Platform,
    const FShaderType* ShaderType
)

Should the shader for this script with the given platform, shader type and vertex factory type combination be compiled

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