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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

UMG 4.6.1(4.7): Сolor distortion of UI

We are using Unreal Engine 4.6.1 (4.7 tested too) and faced the problem. The problem is in color distorsion between UI prepared in Photoshop (or GIMP) and Unreal Standalone Player. We have tried to export image from photoshop in png and tga image formats and import to UE, import psd file directly, but we have the same result - color distortion. Windows Imaging have no similar problem with that source file, it is occuring at UE side only.

How to reproduce the problem: 1. Import dark texture to Unreal Editor; 2. Create UMG Widget and add that texture to image; 3. Show UMG Widget in view port so we can see what's going on; 4. Make screenshot and compare image with source.

Example project and test image link here

I have attached comparison between Unreal Standalone Player (image in play mode) and GIMP (source image). At the middle of this image we have borderline at the junction line, image from UMG is some ligther. May be somebody have similar distortions and have any ways to avoid this? alt text

Product Version: Not Selected
Tags:
finalimage.jpg (369.0 kB)
guitest.zip (2.1 MB)
more ▼

asked Feb 16 '15 at 05:44 PM in Using UE4

avatar image

BlackBeastie
1 1 2 5

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

1 answer: sort voted first

The engine uses a higher precision floating point back buffer to prevent color banding. This back buffer format does not support hardware sRGB. As a result we apply gamma correction ourselves in the Slate shader using the simplified ^(1/2.2) by default. It results in small differences like what you're seeing when compared with the hardware sRGB profile.

EDIT: The normal scene rendering path (not slate) uses a more accurate version, we're investigating using that instead of the simplified version for Slate.

more ▼

answered Feb 20 '15 at 02:54 PM

avatar image

Nick Darnell ♦♦ STAFF
6k 77 37 151

avatar image Matt STAFF Feb 20 '15 at 03:46 PM

The more accurate version of gamma correction is more expensive. If you want a short term solution you can modify SlateElementPixelShader.usf. Add this code:

 float LinearToSrgbBranchingChannel(float lin) 
 {
     if(lin < 0.00313067) return lin * 12.92;
     return pow(lin, (1.0/2.4)) * 1.055 - 0.055;
 }
 
 float3 LinearToSrgbBranching(float3 lin) 
 {
     return float3(
         LinearToSrgbBranchingChannel(lin.r),
         LinearToSrgbBranchingChannel(lin.g),
         LinearToSrgbBranchingChannel(lin.b));
 }
 
 float3 GammaCorrect(float3 InColor)
 {
     float3 CorrectedColor = InColor;
 #if !(ES2_PROFILE || ES3_1_PROFILE)
 
     CorrectedColor = pow(CorrectedColor, /*InverseDisplayGamma.y*/1.0f);
 
     #if MAC
         // Note, MacOSX native output is raw gamma 2.2 not sRGB!
         CorrectedColor = pow(CorrectedColor, 1.0/2.2);
     #else
         CorrectedColor = LinearToSrgbBranching(CorrectedColor);
     #endif
 
 #endif
     return CorrectedColor;
 }

And replace:

     OutColor.rgb = pow(OutColor.rgb, InvDisplayGamma);

with

 // gamma correct
 OutColor.rgb = GammaCorrect(OutColor.rgb);
avatar image BlackBeastie Feb 21 '15 at 09:59 AM

thank you for answers. this gamma correction algorithm works better for our ui.

(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