Files
UnrealEngine/Engine/Plugins/TextureGraph/Shaders/Expressions/Expression_Threshold.usf
2025-05-18 13:04:45 +08:00

19 lines
480 B
HLSL

// Copyright Epic Games, Inc. All Rights Reserved.
#include "/Engine/Public/Platform.ush"
#include "/Plugin/TextureGraph/SamplerStates.ush"
#include "/Plugin/TextureGraph/ShaderUtil.ush"
Texture2D Input;
float Threshold;
float4 FSH_Threshold(float2 uv : TEXCOORD0) : SV_Target0
{
float4 Signal = Input.Sample(SamplerStates_NoBorder, uv);
float Luminance = Grayscale(Signal.rgb);
float Result = step(Threshold, Luminance);
return float4(Result, Result, Result, 1.0);
}