cafelatte Posted June 24, 2019 Share Posted June 24, 2019 Hi, I've tried to change the Alpha Channel on gl_FragColor on a Mesh, but it doesn't show a result as I expect. For example, on the pixijs.io example ( https://pixijs.io/examples/#/mesh/triangle-color.js ) void main() { gl_FragColor = vec4(vColor, 1.0); } If we changed the line into void main() { gl_FragColor = vec4(vColor, 0.5); } It doesn't show any difference. Is there any workaround/settings I need to adjust to use the alpha channel correctly? Thanks. ivan.popelyshev and ZYandu 2 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 24, 2019 Share Posted June 24, 2019 void main() { gl_FragColor = vec4(vColor, 1.0) * 0.5; } We use premultiplied alpha everywhere. Instead of (r,g,b,a) we store (r*a, g*a, b*a, a) cafelatte and ZYandu 2 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 24, 2019 Share Posted June 24, 2019 Very good question, congratulations with first post! cafelatte 1 Quote Link to comment Share on other sites More sharing options...
cafelatte Posted June 24, 2019 Author Share Posted June 24, 2019 Thanks for the welcoming & prompt response Ivan. Been reading lots of your comments regarding Pixi and it helps a lot. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.