Celga Posted August 2, 2017 Share Posted August 2, 2017 Hello, I'm discovering GUI part, in Babylon JS. And for now, I'm trying to create a textblock, with simple text. But, my problem is that my text is pixelated, even I change fontFamily, fontSize. I've also tried to use "renderAtIdealSize" and "idealWidth". But, nothing changes. I've noticed that the pixelation is reduced when I change the zoom of the browser. I specify that I use, in this case, Mozilla and also Chrome, for my tests. Does it exist a solution ? Here is a link towards a playground, in which I put a part of my code and specially the part about the GUI. The fact is, in the playground, the text is not pixelated.https://www.babylonjs-playground.com/#66ZD6S#1 I put also a screenshot of the result, in the browser Mozilla (Zoom is at 100%). If anybody could give some advice, I thank you in advance. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 2, 2017 Share Posted August 2, 2017 Hello, based on what you said I can see two options: - make sure to call engine.resize() when your canvas is resized - make sure your canvas is not created with fancy options (no option at all is fine) Quote Link to comment Share on other sites More sharing options...
Celga Posted August 2, 2017 Author Share Posted August 2, 2017 Hello, Thanks for your answer. I confirm you that I already call engine.resize() : // Watch for browser/canvas resize events window.addEventListener("resize", function () { engine.resize(); }); And I use the basis for creating my canvas : #renderCanvas { width: 100%; height: 100%; touch-action: none; } But, I have still the same result. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 3, 2017 Share Posted August 3, 2017 Do you mind sharing your page on a server so we can see it live? (and could you please use babylon.max.js for debugging purpose?) Quote Link to comment Share on other sites More sharing options...
Celga Posted August 3, 2017 Author Share Posted August 3, 2017 Hello, As you advise me, I embedded babylon.max.js instead of babylon.js, for debugging purpose. And, I put the files of my page on a server. Here is the link to show the page :http://celinegarry.fr/TestGUI01/index.html Thanks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 3, 2017 Share Posted August 3, 2017 ok:) you should just set advancedTexture.renderAtIdealSize = false to render using optimal resolution Quote Link to comment Share on other sites More sharing options...
Celga Posted August 3, 2017 Author Share Posted August 3, 2017 Thanks for your answer. But, unfortunately, I've just tried with changing renderAtIdealSize to false and I have the same result Here is the new link :http://celinegarry.fr/TestGUI02/index.html May be I have something else wrong. Sorry Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 4, 2017 Share Posted August 4, 2017 Ok try with your fxaa configure with a ratio of 1 instead of 1.5 Quote Link to comment Share on other sites More sharing options...
Celga Posted August 21, 2017 Author Share Posted August 21, 2017 Hello, First of all, I apologize for the late answer. I thank you for your advice, @Delatkosh. I tried with changing the fxaa configure, and... It works :).. The preview is now better. Thanks again! 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.