mirror of
https://github.com/Eragon-Brisingr/UShaderLab.git
synced 2026-09-15 23:04:37 +00:00
Fix -Game no matieral error
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
// Copyright UShaderLab. All Rights Reserved.
|
||||
//
|
||||
// Global-distance-field intrinsics. These names are OVERLOADED (bAllowRawHelperWithArgs): the nullary form
|
||||
// UE_DistanceToNearestSurface() / UE_DistanceFieldGradient() is this wired intrinsic (its real node reads the
|
||||
// current pixel's world position and sets bUsesGlobalDistanceField), while UE_Name(worldPos) is a same-named
|
||||
// raw HLSL helper in UEFunctions/DistanceField.ush whose binding is supplied by the "GlobalDistanceField"
|
||||
// anchor capability. The parser routes a call with args to the helper and a nullary call to this node.
|
||||
|
||||
#include "ShaderLabIntrinsics.h"
|
||||
|
||||
#include "Materials/MaterialExpressionDistanceToNearestSurface.h"
|
||||
#include "Materials/MaterialExpressionDistanceFieldGradient.h"
|
||||
|
||||
void RegisterDistanceFieldIntrinsics(FShaderLabIntrinsicRegistry& Registry)
|
||||
{
|
||||
using namespace ShaderLabIntrinsic_Private;
|
||||
using EFreq = EShaderLabIntrinsicFrequency;
|
||||
|
||||
{
|
||||
FShaderLabIntrinsicDesc Desc;
|
||||
Desc.Name = TEXT("DistanceToNearestSurface");
|
||||
Desc.Frequency = EFreq::Any;
|
||||
Desc.ReturnType = TEXT("float");
|
||||
Desc.bAllowRawHelperWithArgs = true;
|
||||
Desc.MakeNode = [](UMaterial& M, const TArray<FString>&, FString&)
|
||||
{
|
||||
return MakeSimple<UMaterialExpressionDistanceToNearestSurface>(M);
|
||||
};
|
||||
Registry.Register(MoveTemp(Desc));
|
||||
}
|
||||
{
|
||||
FShaderLabIntrinsicDesc Desc;
|
||||
Desc.Name = TEXT("DistanceFieldGradient");
|
||||
Desc.Frequency = EFreq::Any;
|
||||
Desc.ReturnType = TEXT("float3");
|
||||
Desc.bAllowRawHelperWithArgs = true;
|
||||
Desc.MakeNode = [](UMaterial& M, const TArray<FString>&, FString&)
|
||||
{
|
||||
return MakeSimple<UMaterialExpressionDistanceFieldGradient>(M);
|
||||
};
|
||||
Registry.Register(MoveTemp(Desc));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user