UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MaterialExpressionDesaturation.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
10#include "MaterialExpressionDesaturation.generated.h"
11
14{
16
17 // Outputs: Lerp(Input,dot(Input,LuminanceFactors)),Fraction)
18 UPROPERTY()
20
21 UPROPERTY()
22 FExpressionInput Fraction;
23
24 /*
25 * Luminance factors for converting a color to greyscale.
26 *
27 * The default luminance factors values are now derived from the working color space. For uses cases
28 * outside scene rendering, users are responsible for updating these factors accordingly. For example,
29 * factors derived from an AP1 working color space would not be applicable to UI domain materials that
30 * remain in sRGB/Rec.709 and thus should instead use approximately [0.2126, 0.7152, 0.0722].
31 */
32 UPROPERTY(EditAnywhere, Category=MaterialExpressionDesaturation, Meta = (ShowAsInputPin = "Advanced"))
33 FLinearColor LuminanceFactors;
34
35
36 //~ Begin UMaterialExpression Interface
37#if WITH_EDITOR
38 virtual void Build(MIR::FEmitter& Emitter) override;
39 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
40 virtual void GetCaption(TArray<FString>& OutCaptions) const override
41 {
42 OutCaptions.Add(TEXT("Desaturation"));
43 }
44#endif
45 //~ End UMaterialExpression Interface
46};
47
48
49
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition MaterialCompiler.h:109
Definition Array.h:670
Definition MaterialExpressionDesaturation.h:14
Definition MaterialExpression.h:150
Definition MaterialExpressionIO.h:23
Definition Color.h:48