PreprocessShader

Preprocess a shader. Preprocess a shader.

Unreal Engine C++ API Reference > Developer > ShaderPreprocessor > PreprocessShader

References

   
Module ShaderPreprocessor
Header /Engine/Source/Developer/ShaderPreprocessor/Public/ShaderPreprocessor.h
Include #include "ShaderPreprocessor.h"
Source /Engine/Source/Developer/ShaderPreprocessor/Private/ShaderPreprocessor.cpp
bool PreprocessShader
(
    [FShaderPreprocessOutput](API\Runtime\RenderCore\FShaderPreprocessOutput) & Output,
    const [FShaderCompilerInput](API\Runtime\RenderCore\FShaderCompilerInput) & Input,
    const [FShaderCompilerEnvironment](API\Runtime\RenderCore\FShaderCompilerEnvironment) & MergedEnvironment,
    const [FShaderCompilerDefinitions](API\Runtime\RenderCore\FShaderCompilerDefinitions) & AdditionalDefines,
    [EDumpShaderDefines](API\Developer\ShaderPreprocessor\EDumpShaderDefines) DefinesPolicy
)

Remarks

Preprocess a shader. Preprocess a shader. true if the shader is preprocessed without error.

Parameters

Name Description
Output Preprocess output struct. Source, directives and possibly errors will be populated.
Input The shader compiler input.
MergedEnvironment The result of merging the Environment and SharedEnvironment from the FShaderCompilerInput (it is assumed this overload is called outside of the worker process which merges this in-place, so this merge step must be performed by the caller)
AdditionalDefines Additional defines with which to preprocess the shader.
bShaderDumpDefinesAsCommentedCode Whether to add shader definitions as comments.
OutPreprocessedShader Upon return contains the preprocessed source code.
ShaderOutput ShaderOutput to which errors can be added.
ShaderInput The shader compiler input.
AdditionalDefines Additional defines with which to preprocess the shader.
DefinesPolicy Whether to add shader definitions as comments.

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library