When a texture asset has certain properties edited, its PostEditChangeProperty() method calls to UTexture::NotifyMaterials(), which triggers a recompilation of materials that reference it in their material graph. This includes preview materials created by the "Start Previewing Node" feature, which apparently are kept around while the Material Editor window is open, after the preview was stopped. In that situation, the compilation of the preview material attempts to process the Texture Sample node, but at that time the cached "ReferencedTextures" of that preview material is empty. This results in an error, a check() failure, and finally a crash, as shown below and in the provided call stacks.
[Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp]
FHLSLMaterialTranslator::Texture()
[Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp]
FHLSLMaterialTranslator::TextureSample()
This crash has been observed in all versions from at least 4.27. Some specific situations that trigger UTexture::NotifyMaterials() and result in the crash:
1. Create and edit a new material
2. Place a Texture Sample node
3. On the Details Panel for the Texture Sample node, select any texture to sample from
4. Start previewing the Texture Sample Node (e.g. "Preview" button or "Right-click – Start Previewing Node")
5. Stop previewing the Texture Sample Node (e.g. "Preview" button or "Right-click – Start Previewing Node")
6. Open the chosen texture asset for editing (e.g. through the Content Browser or the Details Panel for the Texture Sample node)
Notes:
[Example crash trigger: opening a texture asset]
FHLSLMaterialTranslator::Texture(UTexture * InTexture, int & TextureReferenceIndex, EMaterialSamplerType SamplerType, ESamplerSourceMode SamplerSource, ETextureMipValueMode MipValueMode) Line 8778
UMaterialExpressionTextureSample::Compile(FMaterialCompiler * Compiler, int OutputIndex) Line 2806
FHLSLMaterialTranslator::CallExpression(FMaterialExpressionKey ExpressionKey, FMaterialCompiler * Compiler) Line 4823
FExpressionInput::Compile(FMaterialCompiler * Compiler) Line 368
FColorMaterialInput::CompileWithDefault(FMaterialCompiler * Compiler, EMaterialProperty Property) Line 614
UMaterial::CompilePropertyEx(FMaterialCompiler * Compiler, const FGuid & AttributeID) Line 7131
UMaterialInterface::CompileProperty(FMaterialCompiler * Compiler, EMaterialProperty Property, unsigned int ForceCastFlags) Line 4978
FMaterialResource::CompilePropertyAndSetMaterialProperty(EMaterialProperty Property, FMaterialCompiler * Compiler, EShaderFrequency OverrideShaderFrequency, bool bUsePreviousFrameTime) Line 224
FHLSLMaterialTranslator::TranslateMaterial() Line 1815
FHLSLMaterialTranslator::Translate(bool bForceDisableDDCQuery) Line 1300
FMaterial::Translate_Legacy(const FMaterialShaderMapId & ShaderMapId, const FStaticParameterSet & InStaticParameters, const ITargetPlatform * InTargetPlatform, FMaterialCompilationOutput & OutCompilationOutput, TRefCountPtr<FSharedShaderCompilerEnvironment> & OutMaterialEnvironment) Line 3352
FMaterial::Translate(const FMaterialShaderMapId & InShaderMapId, const FStaticParameterSet & InStaticParameters, const ITargetPlatform * InTargetPlatform, FMaterialCompilationOutput & OutCompilationOutput, TRefCountPtr<FSharedShaderCompilerEnvironment> & OutMaterialEnvironment) Line 3497
FMaterial::BeginCompileShaderMap(const FMaterialShaderMapId & ShaderMapId, const FStaticParameterSet & StaticParameterSet, EMaterialShaderPrecompileMode PrecompileMode, const ITargetPlatform * TargetPlatform) Line 3526
FMaterial::BeginCacheShaders::__l2::<lambda_1>::operator()() Line 3020
UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,bool __cdecl(void)>::operator()() Line 414
FMaterial::FinishCacheShaders() Line 3196
FMaterial::CacheShaders(const FMaterialShaderMapId &) Line 3212
FMaterial::CacheShaders(EMaterialShaderPrecompileMode PrecompileMode, const ITargetPlatform * TargetPlatform) Line 2775
UMaterial::CacheShadersForResources(EShaderPlatform ShaderPlatform, const TArray<FMaterialResource *,TSizedDefaultAllocator<32>> & ResourcesToCache, EMaterialShaderPrecompileMode PrecompileMode, const ITargetPlatform * TargetPlatform) Line 2839
UMaterial::CacheResourceShadersForRendering(bool bRegenerateId, EMaterialShaderPrecompileMode PrecompileMode) Line 2674
UMaterial::PostEditChangePropertyInternal(FPropertyChangedEvent & PropertyChangedEvent, const UMaterial::EPostEditChangeEffectOnShaders EffectOnShaders) Line 5368
UObject::PostEditChange() Line 514
UTexture::NotifyMaterials(const UTexture::ENotifyMaterialsEffectOnShaders EffectOnShaders) Line 4646
UTexture::PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) Line 1012
FTextureEditorToolkit::PostTextureRecode() Line 160
FTextureEditorToolkit::InitTextureEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost,1> & InitToolkitHost, UObject * ObjectToEdit) Line 421
FTextureEditorModule::CreateTextureEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost,1> & InitToolkitHost, UTexture * Texture) Line 41
UAssetDefinition_Texture::OpenAssets(const FAssetOpenArgs & OpenArgs) Line 31
FAssetDefinitionProxy::OpenAssetEditor(const TArray<UObject *,TSizedDefaultAllocator<32>> & InObjects, const EAssetTypeActivationOpenedMethod OpenedMethod, TSharedPtr<IToolkitHost,1> EditWithinLevelEditor) Line 260
UAssetEditorSubsystem::OpenEditorForAsset(UObject * Asset, const EToolkitMode::Type ToolkitMode, TSharedPtr<IToolkitHost,1> OpenedFromLevelEditor, const bool bShowProgressWindow, EAssetTypeActivationOpenedMethod OpenedMethod) Line 586
SPropertyEditorAsset::OnOpenAssetEditor() Line 1658
SPropertyEditorAsset::OnAssetThumbnailDoubleClick(const FGeometry & InMyGeometry, const FPointerEvent & InMouseEvent) Line 1942
Invoke(FReply(SPropertyEditorAsset::*)(const FGeometry &, const FPointerEvent &)) Line 65
UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(FReply(SPropertyEditorAsset::*)(const FGeometry &, const FPointerEvent &) &) Line 299
TBaseSPMethodDelegateInstance<0,SPropertyEditorAsset,1,FReply __cdecl(FGeometry const &,FPointerEvent const &),FDefaultDelegateUserPolicy>::Execute(const FGeometry & <Params_0>, const FPointerEvent & <Params_1>) Line 291
TDelegate<FReply __cdecl(FGeometry const &,FPointerEvent const &),FDefaultDelegateUserPolicy>::Execute(const FGeometry & <Params_0>, const FPointerEvent & <Params_1>) Line 613
SWidget::OnMouseButtonDoubleClick(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 493
FSlateApplication::RoutePointerDoubleClickEvent::__l2::<lambda_1>::operator()(const FArrangedWidget &) Line 5958
FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FPointerEvent,`FSlateApplication::RoutePointerDoubleClickEvent'::`2'::<lambda_1>>(FSlateApplication * ThisApplication, FEventRouter::FBubblePolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerDoubleClickEvent::__l2::<lambda_1> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 459
FSlateApplication::RoutePointerDoubleClickEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5956
FSlateApplication::ProcessMouseButtonDoubleClickEvent(const TSharedPtr<FGenericWindow,1> & PlatformWindow, const FPointerEvent & InMouseEvent) Line 5941
FSlateApplication::OnMouseDoubleClick(const TSharedPtr<FGenericWindow,1> & PlatformWindow, const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5904
FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 3378
FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 3903
FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 2311
WindowsApplication_WndProc(HWND__ *) Line 2128
FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 2134
WinPumpMessages() Line 117
FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 146
FEngineLoop::Tick() Line 5774
EngineTick() Line 60
GuardedMain(const wchar_t * CmdLine) Line 187
LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 266
WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 334
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-318809 in the post.
0 |
Component | UE - Rendering Architecture - Materials |
---|---|
Affects Versions | 4.27, 5.7 |
Created | Sep 5, 2025 |
---|---|
Updated | Sep 11, 2025 |