Texture look like Premultiplied

   1558   3   0
User Avatar
Member
3 posts
Joined: 4月 2018
オフライン
The second one doesn't have an alpha channel。
Is there any way to turn it off?

Attachments:
20240425115047.png (775.4 KB)
20240425115123.png (662.3 KB)

User Avatar
Member
8191 posts
Joined: 9月 2011
オフライン
Are you trying to disable alpha premultiplication in the 3d viewport? I don't think it's possible.
User Avatar
Member
3 posts
Joined: 4月 2018
オフライン
jsmack
Are you trying to disable alpha premultiplication in the 3d viewport? I don't think it's possible.
This is the result of rendering.
Disabling it in the 3D view doesn't seem to work, or maybe I haven't found the corresponding switch.
User Avatar
Member
7 posts
Joined: 9月 2021
オフライン
I find out that you should unpremult the color you get like this:

path = r"you/image/path";
vector4 cd = texture(path, v@uv.x, v@uv.y, "srccolorspace", "linear"); // note: always use linear
@Cd = cd;
@Alpha = cd.a;

if(@Alpha > 0){
    @Cd /= @Alpha; // unpremult
    @Cd = pow(@Cd,2.2); // if your color space is srgb, add this
}

And because the inner premult came before color space conversion, so you'd always sample it as linear, then unpremult, and finally convert to your color space like sRGB.
Edited by dolag233 - 2025年11月4日 02:03:32
  • Quick Links