UE4.17 Retainer box is washing colors

Hello,

I have the problem that when I am using custom drawer:
FSlateDrawElement::MakeCustom(OutDrawElements, TopLayer, Drawer);

and placing widget inside RetainerBox results that widget has washed colors.

The only solution I found is to use gamma correction by default:
WidgetRenderer = MakeShareable(new FWidgetRenderer(true));

but it means I need to rewrite RetainerBox what I really don’t want to do.

Please help
Tefel

Bump! Same here!

I’ve managed to solve the problem completely, at least for myself.
I needed to round corners of my widget so I made an alpha mask in Photoshop. Then I used Retainer Box with a transparent material. My colors were washing out (first screenshot).

Then after a following manipulation with the material, I managed to make it just the right color as it was without the Retainer Box (second screenshot).

And here’s what I’ve done in the material to make it happen (white texture sample is my alpha texture for corners).

Hope it helps!

2 Likes

I have the same problem, even if the retainer material has nothing in it, but the source texture. Hell, even if I don’t assign a material at all! Just the plain old retainer box wrapping an image: the image gets bright and washed out. I’m using it in a 3D widget in the VR resource project, MotionControllerMap. I’ll test it in a completely empty map …

Edit: It is a known bug in the Engine as of 4.18p2: https://answers.unrealengine.com/questions/712257/418p2-retainer-panel-causes-textures-in-3d-widgets.html

Sadly, that didn’t do the trick for me. I have the washed out colors even when there is NO material in the retainer box.

It seems like this is a bug in the engine that was fixed in 4.15 and somehow reappeared in 4.18p2 and I still have it in 4.21 [Unreal Engine Issues and Bug Tracker (UE-35531)][1]

As a (temporary) workaround you can manually add the correct gamma correction into your retainer material. e.g. like this:

5 Likes

This worked amazingly!! Thanks!

So, for anyone willing to modify their engine code, I dug through the commit of the original fix and found the file/line they changed. Here’s the diff from SRetainerWidget.cpp:

You can see they removed the NoGamma option, and set the render target’s gamma to 2.2. Up to the reader if they want to mess with it, there’s some comments talking about gamma space blending issues (presumably why they reverted the fix) so if this causes problems for y’all revert and use the material approach above instead.

1 Like

I tried the gamma correction method in the material, and it worked perfectly, however on mobile devices, the elements in the retainer box appeared completely red. Does anyone have any clue on that?