PreprocessShader

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
(
    [FString](API\Runtime\Core\Containers\FString) & OutPreprocessedShader,
    [FShaderCompilerOutput](API\Runtime\RenderCore\FShaderCompilerOutput) & ShaderOutput,
    const [FShaderCompilerInput](API\Runtime\RenderCore\FShaderCompilerInput) & ShaderInput,
    const [FShaderCompilerDefinitions](API\Runtime\RenderCore\FShaderCompilerDefinitions) & AdditionalDefines,
    [EDumpShaderDefines](API\Developer\ShaderPreprocessor\EDumpShaderDefines) DefinesPolicy
)

Remarks

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

Parameters

Name Description
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.
bShaderDumpDefinesAsCommentedCode 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