Seems like this an older problem …
And I have same issue ;(
Then I’m trying to debug engine and found place where my CustomExpression collect parameters and write MaterialPixelParameters… At this place compiler based on ShaderFrequency select shader type to write block.
Crash will appear when ShaderFrequency == SF_Hull and shader type set Pixel but Hull is Tesselation part
I was created simple patch on Compile() CustomExpression:
From ceb393df3f2cb91799d0845d7eaf678fe958b2b8 Mon Sep 17 00:00:00 2001
From: imbaFireFenix <mail@mail.ru>
Date: Wed, 4 Oct 2017 16:00:44 +0300
Subject: [PATCH] ~Material: fix ShaderFrequency determination for
CustomNodeExpression when shader compile to hull shader;
---
Engine/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Engine/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h b/Engine/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h
index 20343ad..67bfca4 100644
--- a/Engine/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h
+++ b/Engine/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h
@@ -5091,7 +5091,7 @@ protected:
}
Code.ReplaceInline(TEXT("\n"),TEXT("\r\n"), ESearchCase::CaseSensitive);
- FString ParametersType = ShaderFrequency == SF_Vertex ? TEXT("Vertex") : (ShaderFrequency == SF_Domain ? TEXT("Tessellation") : TEXT("Pixel"));
+ FString ParametersType = ShaderFrequency == SF_Vertex ? TEXT("Vertex") : ((ShaderFrequency == SF_Domain || ShaderFrequency == SF_Hull) ? TEXT("Tessellation") : TEXT("Pixel"));
FString ImplementationCode = FString::Printf(TEXT("%s CustomExpression%d(FMaterial%sParameters Parameters%s)\r\n{\r\n%s\r\n}\r\n"), *OutputTypeString, CustomExpressionIndex, *ParametersType, *InputParamDecl, *Code);
CustomExpressionImplementations.Add( ImplementationCode );
--
2.10.1.windows.1
And then all works for now