x

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"

Calling DrawMaterial in a CanvasRenderTarget2D Blueprint crashes in standalone game

I'm trying to make an in-game computer that displays a bash-like terminal, so for the screen part I'm using a CanvasRenderTarget2D, to which I draw text. This works fine, but I need to clear the render target, since it starts out green. I couldn't find a BP function that clears a Canvas to black, so before going all C++ on this I decided I'd try using DrawMaterial to do the same thing, which works fine in the editor, but crashes the standalone game. The crash reporter even gives a nice stack trace, from which the two top-most lines are as follows:

  • UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\misc\outputdevice.cpp:374]

  • UE4Editor_Renderer!FSceneRenderTargets::GetSceneColorForCurrentShadingPath() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\renderer\private\postprocess\scenerendertargets.h:631]

And checking line 631 of that header-file indeed points to getting the scene color for the current shading path, so obviously something colorful goes wrong when rendering this render target.

Is there a better way to clear a Canvas to a given color, or should this be a bug report, or both, or something else entirely? I could also show you what I've wired to what in my CanvasRenderTarget2D Blueprint:

alt text

Thanks for any help!


Miika Vihersaari

Product Version: UE 4.10
Tags:
more ▼

asked Jan 04 '16 at 07:43 PM in Bug Reports

avatar image

MVi
15 3 4

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

1 answer: sort voted first

Hello MVi -

This was an issue in 4.10, but has been corrected in 4.11. You can test the fix in your project by copying and trying it in Preview 1 of 4.11.

Thank You

Eric Ketchum

more ▼

answered Jan 05 '16 at 03:53 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 260 736

avatar image MVi Jan 05 '16 at 10:42 PM

Hi Eric,

I confirm that this works in 4.11 Preview 1. Thank you for your help!


Miika Vihersaari

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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