How can I extract any colour from a texture map inside of a blueprint?

Hello,

I was wondering if there is a way of extracting a specific colour from inside of a blueprint. To be more specific: lets say I have an unwrapped object and its unwrapped texture which contains a Red (255,0,0), Green (0,255,0), Blue (0,0,255) and some other shade of blue, lets say Baby blue (0,0,100). How can I access that particular colour when mapping my object? Is this even possible?

I find myself having a lot of different colours on an objects unwrapped map and not a way to access individual colours.

Thank you very much.

Dusan

Hey Dusan,

What result are you trying to achieve? Are you looking to change the colors of materials via Blueprints?

I second what Jacky suggests.

Hey Iveytron,

lets say I have the following map:

And I want to somehow make changes only to the pink tiles inside the material editor. Is it possible?

Thanks!

You could create a black&white mask for any color you want in Photoshop or Gimp and then use that mask to manipulate your texture. Your example texture does just that actually. It has 4 different masks in a single texture’s R,G , B and Alpha channels.

I was thinking of that but I was wondering if there was a more elegant way since I sometimes have 10-20 different Material IDs on a single texture and that means I need 10-20 masks made in Photoshop. This means I cant solve the problem with 4 channels and also I might overwhelm EU with so many textures. Does this make any sense? Maybe I don’t understand the concept at all?

Thanks guys, really appreciate it!

Oh, so you want to mask certain parts of your UV for layered materials? If that’s the case it is not suggested to use more than 4 masks to use material layers because it costs too much performance, as far as i know.

What I was looking at was the Sci Fi Hallway. I was inspecting every mesh and I realized that they made a portion of the wall (single mesh) which has 10+ texture types (metal,glass,painted metal, stickers, etc.) on it with a single texture. Then I took a closer look and I saw some pretty disappointing results: due to lack of texture information (because they used only R G B channels) they have the same reflections on glass and metal, for example, because they were marked by the same channel. This made me think of how could this be avoided. If you come to any solution to this problem please post it. Thank you for your time.

p.s.: No feathering in this example

I wouldn’t use ifs for this. Material branches are not exactly fast operations. Also, I’m not sure why you’re masking the RG and B channels there. When you take the RGB pins, you’re only getting that channel anyway.

The best way to use a mask is to set up the channels so they only use combinations of colours you can reconstruct easily. That is, colours you can separate back out. Pure R G and B are easy, because you can take the pins directly, but you can also use any combination of 2 channels, by subtracting one from the other. Then, you can multiply these with a colour or texture, and blend them together, like so:

Not only does this avoid using expensive branch operations, but it also allows you to feather your materials more naturally, as you can just about see on the middle mask channel.

P.S. Clamping is quite important, though, as when subtracting, you may get values below 1, which can mess up the final blend.

1 Like

Cause…the question was “how to pick a color”?
I’ve made a mask cause not always input having separate channels (in most cases it’s not).

With the method I suggested, it’s possible to have 13 different separatable channels in a single mask (by combining colours). There are not many cases where you’ll need more than that. Sure, it doesn’t allow you to pull out very specific colours, but it’s cheaper and produces nicer results. The real answer to this is really “don’t use shades like (0,0,100) in your mask”.

Can you elaberate on how to do the 13 different channels?
I can get six, And am unable to come up with a way to go past that.

I was having a head-scratcher on proper RGB masking and your tip was a gem!