Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Assert in UE4 4.5.0 with DrawMaterialSimple()

I'm getting an assert (callstack available below) in my current UE4 project because of the function DrawMaterialSimple() in my HUD class.

Setup in the constructor :

     static ConstructorHelpers::FObjectFinder<UMaterialInterface> shPauseFont(TEXT("Material'/Game/HUD/Mat/sh_paused_font.sh_paused_font'"));
     PausedTextMaterial = UMaterialInstanceDynamic::Create( shPauseFont.Object, this );

Call to the function :

 void AExilHud::DrawGlobal()    
     float x = Canvas->ClipX / 2;
     float y = Canvas->ClipY / 2;

     if( EC->EPC->IsPaused() && !EC->EPC->IsFreeCamEnabled() && PausedTextMaterial != NULL )
         DrawMaterialSimple(PausedTextMaterial, x - 64, (y * 2) - 64, 256, 128, 0.5f, false);

Any ideas how I can fix that ? I'm using a custom GitHub build of the engine. However I didn't change anything related to the Canvas/HUD in the original source code of the version 4.5.0.

The assert seems to come from the FCanvasTileItem() function :

 FCanvasTileItem::FCanvasTileItem(const FVector2D& InPosition, const FMaterialRenderProxy* InMaterialRenderProxy, const FVector2D& InSize)
     : FCanvasItem(InPosition)
     , Size(InSize)
     , Z(1.0f)
     , UV0(0.0f, 0.0f)
     , UV1(1.0f, 1.0f)
     , Texture(NULL)
     , MaterialRenderProxy(InMaterialRenderProxy)
     , Rotation(ForceInitToZero)
     , PivotPoint(FVector2D::ZeroVector)
     // Ensure specify Texture or material, but not both.

Here is the callstack :

 [2015.02.14-02.02.13:187][849]LogWindows: === Critical error: ===
 Fatal error!
 Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
 UE4Editor-Engine.dll!AHUD::DrawMaterialSimple() (0x000007fecb8e205a) + 79 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\hud.cpp:595]
 UE4Editor-Exil.dll!AExilHud::DrawGlobal() (0x000007fec4c25305) + 0 bytes [v:\ue4projects\exil\source\exil\exilhud.cpp:482]
 UE4Editor-Exil.dll!AExilHud::DrawHUD() (0x000007fec4c2537b) + 0 bytes [v:\ue4projects\exil\source\exil\exilhud.cpp:434]
 UE4Editor-Engine.dll!AHUD::PostRender() (0x000007fecb910fe1) + 0 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\hud.cpp:137]
 UE4Editor-Engine.dll!UGameViewportClient::Draw() (0x000007fecb85091e) + 0 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\gameviewportclient.cpp:994]
 UE4Editor-Engine.dll!FViewport::Draw() (0x000007fecbd51099) + 0 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\unrealclient.cpp:1081]
 UE4Editor-Engine.dll!UGameEngine::RedrawViewports() (0x000007fecb87a745) + 9 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\gameengine.cpp:360]
 UE4Editor-Engine.dll!UGameEngine::Tick() (0x000007fecb88b7db) + 0 bytes [c:\github\unrealengine\engine\source\runtime\engine\private\gameengine.cpp:917]
 UE4Editor-Cmd.exe!FEngineLoop::Tick() (0x000000013f07b224) + 0 bytes [c:\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2129]
 UE4Editor-Cmd.exe!GuardedMain() (0x000000013f070c3e) + 0 bytes [c:\github\unrealengine\engine\source\runtime\launch\private\launch.cpp:133]
 UE4Editor-Cmd.exe!GuardedMainWrapper() (0x000000013f070caa) + 5 bytes [c:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
 UE4Editor-Cmd.exe!WinMain() (0x000000013f07c859) + 17 bytes [c:\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
 UE4Editor-Cmd.exe!__tmainCRTStartup() (0x000000013f07d33d) + 21 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
 kernel32.dll!UnknownFunction (0x0000000076eb652d) + 0 bytes [UnknownFile:0]
 ntdll.dll!UnknownFunction (0x0000000076fec521) + 0 bytes [UnknownFile:0]
 ntdll.dll!UnknownFunction (0x0000000076fec521) + 0 bytes [UnknownFile:0]

Product Version: Not Selected
more ▼

asked Feb 14 '15 at 02:16 AM in C++ Programming

avatar image

260 21 26 37

avatar image Froyok Feb 17 '15 at 05:04 PM

Just to precise : the instanced material seems to work fine as I'm able to see the shader in-game. I don't always draw it, only when I open an in-game menu. So I often toggle between drawing and not drawing the shader. The assert seems random but happens often.

avatar image Kyoril Jun 29 '15 at 03:30 AM

I encountered the same problem, but I'm using 4.7.4.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question