The second one doesn't have an alpha channel。
Is there any way to turn it off?
Texture look like Premultiplied
1558 3 0-
- TaoChen
- Member
- 3 posts
- Joined: 4月 2018
- オフライン
-
- jsmack
- Member
- 8191 posts
- Joined: 9月 2011
- オフライン
-
- TaoChen
- Member
- 3 posts
- Joined: 4月 2018
- オフライン
-
- dolag233
- Member
- 7 posts
- Joined: 9月 2021
- オフライン
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 - 2025年11月4日 02:03:32
-
- Quick Links

