AnnaBruel Posted January 30, 2018 Share Posted January 30, 2018 I use AdvancedDynamicTexture and textBlock to write text on a plan. There is a black contour around the text. I would like change this color or remove it. I tried : https://playground.babylonjs.com/#CY31UX#4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 30, 2018 Share Posted January 30, 2018 The line that you are seeing is the antialiasing effect See if I set the bg to red: https://playground.babylonjs.com/#CY31UX#9 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 30, 2018 Share Posted January 30, 2018 This is because of how its mixing the anti-aliasing fade with the background. when the background becomes transparent it effectively becomes rgba(0,0,0,0); so when mixing the anti aliasing is mixing with a black background. unfortunately when you set the alpha of a rgba(255,255,255,0) or set the bg to "transparent" it defaults back to rgba(0,0,0,0)... which is FASDKJFSK:AFA annoying but yeah that's how that works. advancedTexture.background = "rgba(255,0,0,0.01)"; as a hacky workaround. I might be able to do a pull request to make a fix for this... but I am way loaded on stuff right now. https://playground.babylonjs.com/#CY31UX#10 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 30, 2018 Share Posted January 30, 2018 Not my fault Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 30, 2018 Share Posted January 30, 2018 Not his fault at all! its how canvas elements store colors. "rgba(255,0,0,0.002)"; is as low on the alpha you can go before its counter intuitive. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
AnnaBruel Posted January 31, 2018 Author Share Posted January 31, 2018 Thanks for yours solutions. It works. Moreover, if you apply a texture with alpha = 0 on the plane, the background doesn't appear and the contour appears with the color, you have chosen. https://playground.babylonjs.com/#CY31UX#14 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.