Description

when trying to replace a Material Function instance, with another instance, as the base color of a material within the Material Graph, the editor crashes with the following error:

Assertion failed: TextureReferenceIndex != INDEX_NONE [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp] [Line: 6654] Material expression called Compiler->TextureParameter() without implementing UMaterialExpression::GetReferencedTexture properly
Steps to Reproduce
  1. Create Blank Blueprint project with starter content
  2. Create a material called M_Mat
    • Right click in Content Browser>material
  3. Create a material function called MF_Func
    • Right click in Content Browser>Materials>Material Function
  4. Open MF_Func
  5. add a TextureSampleParameter2D to graph
  6. add MakeMaterialAttributes to graph
  7. Connect the TextureSampleParameter2D RGB to the MakeMaterialAttributes BaseColor
  8. Connect the MakeMaterialAttributes output into the OutputResult node
  9. Save MF_Func and close
  10. Create an instance of MF_Func called MF_Func_Inst
    • Right click MF_Func>Create Function Instance
  11. Open MF_Func_Inst
  12. In Details Check the Param Checkbox and select T_Brick_Clay_Beveled_D for the texture
  13. Apply, Save & close MF_Func_Inst
  14. Create a second instance of MF_Func called MF_Func_Inst1
  15. # Open MF_Func_Inst1
  16. In Details Check the Param Checkbox and select T_Brick_Clay_New_D for the texture
  17. Apply, Save & close MF_Func_Inst1
  18. Open M_Mat
  19. Drag and drop MF_Func_Inst into the M_Mat graph
  20. add BreakMaterialAttributes to graph
  21. Connect MF_Func_Inst to the BreakMaterialAttributes Attr
  22. Connect that BreakMaterialAttributes BaseColor to the M_Mat BaseColor
  23. Drag and drop MF_Func_Inst1 into the M_Mat graph
  24. add BreakMaterialAttributes to graph
  25. Connect MF_Func_Inst1 to the new BreakMaterialAttributes Attr
  26. Connect that BreakMaterialAttributes BaseColor to the M_Mat BaseColor

*Expected Result: *The M_Mat Base Color will be disconnected from MF_Func_Inst BreakMaterialAttributes and now be connected to MF_Func_Inst1 BreakMaterialAttributes

Actual Result: The M_Mat BaseColor is disconnected from MF_Func_Inst and then crashes while trying to connect to MF_Func_Ins1 with following error:

Material expression called Compiler->TextureParameter() without implementing UMaterialExpression::GetReferencedTexture properly
Callstack
0x00007ffdb0cd81c7 UnrealEditor-Engine.dll!FHLSLMaterialTranslator::TextureParameter() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:6654]
0x00007ffdb0d35db7 UnrealEditor-Engine.dll!CompileTextureSample() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:607]
0x00007ffdb0d32f72 UnrealEditor-Engine.dll!UMaterialExpressionTextureSampleParameter::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:2977]
0x00007ffdb0c9196f UnrealEditor-Engine.dll!FHLSLMaterialTranslator::CallExpression() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:3607]
0x00007ffdb0dd957a UnrealEditor-Engine.dll!FExpressionInput::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:262]
0x00007ffdb0d297ce UnrealEditor-Engine.dll!UMaterialExpressionMakeMaterialAttributes::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:5972]
0x00007ffdb0c9196f UnrealEditor-Engine.dll!FHLSLMaterialTranslator::CallExpression() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:3607]
0x00007ffdb0dd957a UnrealEditor-Engine.dll!FExpressionInput::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:262]
0x00007ffdb0d33fd7 UnrealEditor-Engine.dll!UMaterialFunctionInstance::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:13498]
0x00007ffdb0d2a178 UnrealEditor-Engine.dll!UMaterialExpressionMaterialFunctionCall::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:14277]
0x00007ffdb0c9196f UnrealEditor-Engine.dll!FHLSLMaterialTranslator::CallExpression() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:3607]
0x00007ffdb0dd957a UnrealEditor-Engine.dll!FExpressionInput::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:262]
0x00007ffdb0ddabf5 UnrealEditor-Engine.dll!FMaterialAttributesInput::CompileWithDefault() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:619]
0x00007ffdb0d25348 UnrealEditor-Engine.dll!UMaterialExpressionBreakMaterialAttributes::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialExpressions.cpp:6175]
0x00007ffdb0c9196f UnrealEditor-Engine.dll!FHLSLMaterialTranslator::CallExpression() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:3607]
0x00007ffdb0dd957a UnrealEditor-Engine.dll!FExpressionInput::Compile() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:262]
0x00007ffdb0ddab39 UnrealEditor-Engine.dll!FColorMaterialInput::CompileWithDefault() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:523]
0x00007ffdb0d35968 UnrealEditor-Engine.dll!UMaterial::CompilePropertyEx() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp:5035]
0x00007ffdb0dda973 UnrealEditor-Engine.dll!UMaterialInterface::CompileProperty() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:4143]
0x00007ffdb0d35603 UnrealEditor-Engine.dll!FMaterialResource::CompilePropertyAndSetMaterialProperty() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp:256]
0x00007ffdb0cdb875 UnrealEditor-Engine.dll!FHLSLMaterialTranslator::Translate() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp:779]
0x00007ffdb0e3379f UnrealEditor-Engine.dll!FMaterial::Translate_Legacy() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:2353]
0x00007ffdb0dd3132 UnrealEditor-Engine.dll!FMaterial::BeginCompileShaderMap() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:2428]
0x00007ffdb0dd51b3 UnrealEditor-Engine.dll!FMaterial::CacheShaders() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:2309]
0x00007ffdb0dd5642 UnrealEditor-Engine.dll!FMaterial::CacheShaders() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp:2151]
0x00007ffdb0d222bb UnrealEditor-Engine.dll!UMaterial::CacheShadersForResources() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp:2251]
0x00007ffdb0d21e6c UnrealEditor-Engine.dll!UMaterial::CacheResourceShadersForRendering() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp:2137]
0x00007ffdb0d7134e UnrealEditor-Engine.dll!UMaterial::PostEditChangePropertyInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Materials\Material.cpp:3677]
0x00007ffdb4a68086 UnrealEditor-CoreUObject.dll!UObject::PostEditChange() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp:359]
0x00007ffd7d33fa3c UnrealEditor-MaterialEditor.dll!FMaterialEditor::UpdatePreviewMaterial() [D:\build\++UE5\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditor.cpp:2398]
0x00007ffd7d33a4d6 UnrealEditor-MaterialEditor.dll!FMaterialEditor::UpdateMaterialAfterGraphChange() [D:\build\++UE5\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditor.cpp:5637]
0x00007ffd7d4a263b UnrealEditor-MaterialEditor.dll!FMaterialEditorUtilities::UpdateMaterialAfterGraphChange() [D:\build\++UE5\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditorUtilities.cpp:128]
0x00007ffd8ccc97eb UnrealEditor-UnrealEd.dll!UMaterialGraphSchema::TryCreateConnection() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\MaterialGraphSchema.cpp:621]
0x00007ffd7c88a35d UnrealEditor-GraphEditor.dll!FDragConnection::DroppedOnPin() [D:\build\++UE5\Sync\Engine\Source\Editor\GraphEditor\Private\DragConnection.cpp:216]
0x00007ffd7c9dc0ae UnrealEditor-GraphEditor.dll!SGraphPin::OnDrop() [D:\build\++UE5\Sync\Engine\Source\Editor\GraphEditor\Private\SGraphPin.cpp:813]
0x00007ffdaf6d3c5f UnrealEditor-Slate.dll!<lambda_471858b7e70a8b68bd65bc435c2a047c>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5003]
0x00007ffdaf6b5910 UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FPointerEvent,<lambda_471858b7e70a8b68bd65bc435c2a047c> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:405]
0x00007ffdaf7304e9 UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4998]
0x00007ffdaf7191b1 UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5495]
0x00007ffdaf70d5dc UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5460]
0x00007ffe0288a92e UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2210]
0x00007ffe02879247 UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2699]
0x00007ffe0288ce51 UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1078]
0x00007ffe028749a7 UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:916]
0x00007ffe2f44e858 USER32.dll!UnknownFunction []
0x00007ffe2f44e4ee USER32.dll!UnknownFunction []
0x000001c8f0567e59 InkObj.dll!UnknownFunction []
0x00007ffe15e61028 atlthunk.dll!UnknownFunction []
0x00007ffe2f44e858 USER32.dll!UnknownFunction []
0x00007ffe2f44e299 USER32.dll!UnknownFunction []
0x00007ffe0288e148 UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:138]
0x00007ff736187114 UnrealEditor.exe!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5139]
0x00007ff7361a0d9c UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
0x00007ff7361a0e8a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
0x00007ff7361a3c4d UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
0x00007ff7361b5534 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
0x00007ff7361b86e6 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ffe2fe77034 KERNEL32.DLL!UnknownFunction []
0x00007ffe30462651 ntdll.dll!UnknownFunction []

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-150412 in the post.

4
Login to Vote

Unresolved
ComponentUE - Rendering - Materials
Affects Versions5.05.0.1
Target Fix5.2
CreatedApr 27, 2022
UpdatedJul 19, 2022