#Solved Trouble with Material Mask aka ColorID

1 messages Β· Page 1 of 1 (latest)

south dock
#

Hello, I'm trying to make a modular character system using techniques described in "Reducing Draw Calls in Unreal!" and "Unlimited Customization" video.

In the Unlimited Customization video, PrismaticaDev describes using a texture with Blue Channel as a mask. By painting only using values of 1, .5, and 0. He was able to get those 3 values and give a color to each individual one. I'm trying to do the same. I've managed to id the 0 and 1 value, but .5 value is causing issues.

I've made a texture for testing. Sectioned off the texture into 0, .5 and 1 and in blue channel in Blender.
I then imported it into unreal, and here's next picture is the result. I can't seem to escape aliasing I believe? I tried using a if node too and has the same problem.

bleak shard
south dock
#

Thankyou for the response, looking at the video again I see the texture work, and I understand what you mean.
White and black are intentionally separated.

bleak shard
#

Yep yep - it's something that it really handy since it can maintain gradients as well. Works great with vertex colour so you can get 8 channels instead of 4

south dock
#

Solved Trouble with Material Mask aka ColorID

heady hull
#

@south dock also consider if blender is painting in sRGB color it'll.be applying a gamma curve

#

Is 0.5 will actually be like .2 something

#

What Charlie is talking about is the Fringe issue you get if you're not doing a strict threshold and have values that straddle the masks

#

So it think to avoid that you have to have each mask be contiguous with it's neighbor

south dock
heady hull
#

So if you run into resolution issues with 8 bit textures

#

you could probably operate with a 32 bit texture inside Blender

#

so it should save it as the exact value

#

Then in theory you can use unreal engine or other software to convert it to a linear 8-bit format without gamma correction

south dock
#

I think on texture sample you can Remove "srpg" from import settings. it didn't change anything

heady hull
#

yeah you need to author it in linear

#

Blender is confusing when working with linear vs gamma corrected colors

south dock
#

I'm going to be honest, this is over my knowledge. I don't really know much about digital art.

heady hull
#

okay TLDR

#

8 bit data can only store 255 values of brightness

#

our eyes are very sensitive to the darker values than the brighter values (IIRC)

#

So what we do for data our eyes will see, is we store more data in the darker colors and less data in the brighter colors .

#

SOO

#

what this means is

#

when you display sRGB stuff as linear they tend to look blown out and too bright

#

so there has to be an agreement with how the data is stored and how it's displayed

#

this is why in blender and in UE you tell it if it's sRGB and linear color texture

#

because if it's a sRGB data you'll apply the gamma correction, if it's linear you won't apply a correction

#

this is why applying sRGB correction to a normal map breaks it.

#

Because with DATA , every part of the data is important

#

so with linear data, it's a 1:1 relationship and you just accept the precision loss across the whole range

#

So

#

a value of 0.5 in linear is stored as 0.5

#

I think a value of 0.5 is stored as 0.72974005284072309792068324784902 and then gamma corrected back down to 0.5

#

so when dealing with 16-32 bit colors I don't think it does this

#

but when dealing with 8 bit colors it does.

#

So at the end of the day it depends when you paint a texture with a brightness of 0.5

#

sorry this is too complex

#

Basically What is visually correct for our eyeballs isn't mathmatically correct for a computer

#

so with 8-bit data computers have developed two different systems for storing data depending on if the data is designed to read by a computer or viewed by a human

#

and since texture painting is traditionally designed to be read by a human it's often not set up for storing it as computer math data, unless it's a specialty program like substance painter which is set up to say paint height map data as linear data.