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"

FCanvasLineItem doesn't draw with line thickness > 0

I'm using FCanvas and the various FCanvasItem structs to draw things to a render target. Most things work but if I try to draw a FCanvasLineItem (or FCanvasBoxItem) with a line thickness > 0 then nothing is displayed.

I'm using this code to draw them:

 FCanvasLineItem line(position, nextPosition);
 line.SetColor(FLinearColor(1.0f, 1.0f, 1.0f, 0.5f));
 line.LineThickness = 2;
 canvas->DrawItem(line);

position, nextPosition, and canvas are all set up elsewhere. I know this code should work because if I change line.LineThickness to 0 then it does get drawn.

I've had this code in my project for a while but only just noticed thick lines aren't drawing recently. I went back and it looks like they were working in 4.13. Doing some more digging if I comment out the call to PrepareShaders on line 906 of Runtime\Engine\Private\BatchedElements.cpp in a source build of the engine then the lines do get drawn but I assume that line is doing something else important.

Product Version: UE 4.15
Tags:
more ▼

asked Apr 21 '17 at 05:43 PM in Bug Reports

avatar image

kgamble
919 40 61 206

avatar image Doug E ♦♦ STAFF Apr 26 '17 at 05:19 PM

Hey kgamble-

Where exactly are you adding/calling this code? I presume "position" and "nextPosition" are FVectors, what is the data type for canvas? Is there anything else that would need to be added to test the behavior you're seeing on my end?

avatar image kgamble Apr 26 '17 at 08:42 PM

position and nextPosition are FVector2Ds and canvas is an FCanvas. I decided to just make a repro project (attached, should open to the level with my UMG widget that displays the canvas) which I should have done in the first place. The one issue I discovered while making this is it only fails to render when your material's blend mode is set to "Translucent" regardless of what the line's alpha is. Works fine if it's "Opaque" instead. I even tried setting the thick line's blend mode to SE_BLEND_Opaque and it still didn't render (except where it intersected the non-thick line for some reason).

thicklines.zip (445.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey kgamble-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here https://issues.unrealengine.com/issue/UE-44448 . You can track the report's status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

Doug Wilson

more ▼

answered Apr 27 '17 at 04:41 PM

(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