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"

HTML5 RenderTarget2D Has Different Color (Linear Color / sRGB discrepency) Than PIE/Win10 64-bit

In an HTML5 build, rendering a UTexture2D to a URenderTarget2D causes the image to lose color. I'm not familiar with linear color terminology, but it has something to do with that and sRGB. If I took that URenderTarget2D and render it to another URenderTarget2D, eventually the image will be solid black. UCanvasRenderTarget2D exhibits the same behavior as the URenderTarget2D.

In these example images, the plane on the left is the unlit image, the plane in the middle is the lit image, and the plane on the right is after rendering that image to a URenderTarget2D.

HTML5 Chrome Version 62.0.3202.75 (Official Build) (64-bit) & Firefox 56.0.2 (64-bit)

alt text

PIE/Win10 64-bit Build

alt text

Notice how the third plane has less color in the HTML5 build vs the Editor/Win64 build. I would expect them to be the same.

Steps to reproduce:

  1. Make a new project. I chose C++ Third Person with no Starter Content.

  2. Add a plane to the scene with the material that has the render target.

  3. Add a button to the HUD or some other way to trigger the render to the render target.

  4. Create a 512x512 URenderTarget2D

  5. Add the code to do the render target rendering.

  6. Package for HTML5 and try in Chrome or Firefox. Compare that to PIE/Win10 64-bit.

Code for render target rendering:

 Plane3Material->GetTextureParameterValue(FName("RT"), RT);
 BrushRenderMat_Dynamic = UMaterialInstanceDynamic::Create(BrushRenderMat, this);
 BrushRenderMat_Dynamic->SetTextureParameterValue("Tex", TestTexture);
 UKismetRenderingLibrary::DrawMaterialToRenderTarget(this, Cast<UTextureRenderTarget2D>(RT), BrushRenderMat_Dynamic);

Material on the Plane

alt text

Material for rendering to the render target

alt text

Image that I'm using

alt text

Product Version: UE 4.18
Tags:
renderhtml5.png (240.8 kB)
renderpiewin64.png (582.1 kB)
color-test.png (33.2 kB)
matplane.png (310.4 kB)
matrt.png (271.6 kB)
more ▼

asked Nov 04 '17 at 02:46 AM in Bug Reports

avatar image

DanimalsOnParade
68 4 11 15

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

1 answer: sort voted first

Hello DanimalsOnParade,

We are using a new bug submission form. Please navigate to the link below for more information.

Link: https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Make it a great day

more ▼

answered Jan 09 '18 at 09:46 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 525

(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