How to make material colors lighter

Not sure how to word this question but basically I’m using this plugin: GitHub - chuklov/RenderTargetSerializerUE5: Render Target Serializer Plugin for Unreal Engine 5.4

to save a Canvas Render Target to a SaveObject. It does a fine job of it but the when de-serializing, the colors come out a bit off.

I have put in an Issue on Github too: De-serialized textures have different shading than before they were serialized. · Issue #2 · chuklov/RenderTargetSerializerUE5 · GitHub

So while they look into that, I was wondering, since I’m drawing this Canvas Render Target as a Material, I am able to modify the output. How can I modify the output so that the colors come out the same as how they went into the SaveObject?

Quick note that the colors with full saturation are not affected, only colors with lower saturation are affected by this.

If you manage the texture with a material you just need to add a multiply in the color with a positive value, the higher it is, the more brightness you will have. If you are using nodes, I think there is some node that allows you to manage that parameter.

1 Like

Yes but the issue is that the effect does not happen when the color is already fully saturated. So any color with light saturation changes but full saturation colors don’t so I need to create a filter of sorts

You should watch this (about color correction)

Then find best way to apply it in your case.
She has one of best explanation for all of it.

1 Like

having a look. while trying not to focus on the presenter. :rofl:

1 Like

i assume that its why. :smiley:

Well I had a look, and after getting over the persona, at the end of the day, I learned about tone mapping but not how to implement it, unless I go to his Gumroad and purchase his $30 tone mapping course/tutorial/asset (idk what it is)

Now I’m googling how i can just adjust the tone of the render target through the material.

You can make material with tone mapping.
I do not think if tone mapping for textures is dowable just in unreal (probably need gimp or photoshop)
You also can do tone mapping in post process material.

That color difference may be cause by how unreal calculates RGB values, while most of applications like photoshop have slightly different calculations. I just cannot remember term/keyword to google for it. It was topic here on forum about calculating color to HEX RRGGBBAA and back and what caused different colors.

ps.
I looked into plugin code, and it uses unchanged RGB values to create output. So if your input works like photoshop (or gimp) and scales RGB/ I remember keywords: its linear RGB and sRGB. So maybe you have different values as input. Like textures are sRGB while plugin expects linear RGB

I am not sure if that github has all code for plugin, but if it has, you can add lines converting RGB output.

another documentation about sRGB and linear RGB:

Edit i watched your video again, and yup it looks like one side is using sRGB while other is using linear RGB. Just not sure which is what.

pps.
there are multiple tutorials about tone mapping on yt. Gumroad will probably be about how to tonemap so your maps look better etc, and not about technical side of it.

last edit for now:
this whole mismatching of colors may be because one window (for what you paint) uses sRGB and other just RGB. So as result you see different colors, but both are correct RGB values. So creating material that corrects gamma and checking which one needs it may solve whole problem. As both areas (one you paint on, and another you see serialized) will have same RGB values and same gamma correction.

1 Like

The color mismatch is actually from the serialization and deserialization from that plugin. Anyways, for now, I divided each landscape layer into a separate opacity mask and saved those instead. Luckily I only have a small number of layers. However, this does significantly increase the size of data to save but it’s a workaround till the plugin developer can look into this deeper.

I’ll mark your post as the answer as it seems to be the correct answer to the question I asked.

Thank you so much!

1 Like

If plugin has whole source on github it is a matter of adding 10 lines to recalculate RGB values. It could be done as some boolean switch/option to use straight RGB or gamma corrected.

1 Like

My plugin doesn’t count Alpha channel as by the time I made it for myself I didn’t need it.
But I will check if that the case to add Alpha to the array to store it.

1 Like

I think (guessing now) that his umg widget uses sRGB values (ie. gamma corrected), while that other window uses RGB values (to show raw data, which uses raw RGB).

And difference is only “Virtual” and both widget and your plugin data would be (or can be) displayedd with exactly same gamma if used in same way.

However adding option to use sRGB or linear RGB would be awsum.

1 Like

You are right in some points. My pluging previously did not care about gamma. But even after I have added that, I have noticed that playing around with depict lighting in scene totally changes the colors on before RT and the After RT is still darker.
So when the Direct light is 10 lumen, the colors are so light but after RT will make them saturated, however light 1 lum will match the colors.
Maybe there way more setting to the colors and corrections but it is out of the pluging scope as of now.
It ment to be simple solution to store Fog of War data for RTS games.

2 Likes