Download

Create mask based on texture values

Hi,

For example I import this:

That circle is a value of 43,43,43

How can I pull out he values that are between say 40,40,40 and 45,45,45 so I will have this?

I know it can be simply done in the material but my mind is locked away right now. :slight_smile:

try using a texture cropping node.
Define the upper left and lower right corners and multiply the ‘crop mask’ output with the image.

That’s a simple texture for demonstration purpose, the textures I’d want to extract a brightness range from aren’t that simple to crop. Thanks for the suggestion though. :slight_smile:

In that case I guess it would have to be a custom node with an if statement.

The issue with selecting a specific value is any texture that gets imported is compressed by default, and compression kills your exact values, that value will now exists around the edges of the other circles. Of course you can not compress the textures, but then it’s going to take up much more memory, and if you were trying to save performance by putting multiple things on one texture, you aren’t going to save any performance that way.

But if you want want to do this you can use clamps.

Since we’re heavily using tileables in our game I though this would be a better approach than being limited by a RGB (3 channels).