I have a dilemma - I have a bunch of existing assets with materials/textures that don’t quite fit my scene color palette. What would be the quickest way to add color variations (it’s for mobile, so preferably it should be cheap performance wise too) without exporting texture, tweaking them in 2D app, and re-importing them back ?
I tried adding parameters for color “tint” and adding (or multiplying) existing texture with tint parameter in the material. Then I made an instance material where I tweaked the tint color to achieve that color variation I am after. It’s not quite flexible and the result isn’t really that great (too dark if multiplying; too pale and bright when adding; I didn’t think lerping was giving any better results so I resorted to add/multiply). On top of that it’s a royal pita to fiddle with every material (still faster and more flexible than exporting/tweaking/importing back textures).
You can also use these image adjustments, like HueShift.
Typically for a game, you will want as simple of a material as possible. So you will want to use cheap functions like add.
What I would do is create your texture.
Every part you want to be able to change the color of, leave as white.
Use the white to create a black and white mask of those areas.
Add some gray scale details to the original texture in those areas if you want.
In UE4 import the texture and mask.
Create material
Create a Vector Parameter to use to define the color or tint.
Use the multiply the color (Vector Parameter) with the mask.
Add the result to the base color.
Save the material. With the parameter, you can adjust the value in real time without having to compile the material.
You can also create material instances that can use that same material, but have different set values for that parameter.
Here’s how I would do it, it’s cheap enough performance wise.
So the first texture in the material editor is the base color, the second is a packed texture with red being roughness, green being the tint mask, and blue which is the metallic.
Also to make it cheaper, replace the overlay with a multiply.