The second one doesn't have an alpha channel。
Is there any way to turn it off?
Texture look like Premultiplied
1460 3 0-
- TaoChen
- Member
- 3 posts
- Joined: April 2018
- Offline
-
- jsmack
- Member
- 8184 posts
- Joined: Sept. 2011
- Offline
-
- TaoChen
- Member
- 3 posts
- Joined: April 2018
- Offline
-
- dolag233
- Member
- 7 posts
- Joined: Sept. 2021
- Offline
I find out that you should unpremult the color you get like 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.
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

