Texture look like Premultiplied

   1460   3   0
User Avatar
Member
3 posts
Joined: April 2018
Offline
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
8184 posts
Joined: Sept. 2011
Offline
Are you trying to disable alpha premultiplication in the 3d viewport? I don't think it's possible.
User Avatar
Member
3 posts
Joined: April 2018
Offline
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: Sept. 2021
Offline
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 - Nov. 4, 2025 02:03:32
  • Quick Links