Post

I did some tests to fully understand the effect of premultiplied alpha combined with the gamma correction (linear RGB -> sRGB). It seems that the only right way to blend rgba colors is to mix them in linear RGB with premultiplied alpha, and then convert to sRGB. However ⬇️

I see that #threejs has premultipliedAlpha false by default on their Material, so I'm not sure how they handle that throughout the render pipeline, especially with postprocessing. For my lib I think I'm going to assume premultiplied alpha everywhere, but I would be glad to get some feedback on this

it's a mess, tbh if you author textures from, say, photoshop or substance, the output is straight alpha. if you export from blender the output is pre-multiplied so there's no true default because there's no singular authoring tool or stack for textures

Ok this is what I thought. I guess as long as it’s properly documented, any default is acceptable. I am just struggling to make my bloom effect work on a transparent background so I was wondering how (if) threejs handles that if it uses straight alpha

ah, yeah, we've been there before I'm not even sure I have good advice other than trying all of the combinations of settings and seeing which one works. we've encountered unintuitive things where like, doing bloom before LUT is different than bloom after LUT, or colorspaces that aren't in the docs

Haha seems like a lot of fun… Anyway thank you for your valuable feedback 🙏🏻

0 reposts1 like

No replies yet.