ian Posted June 1, 2016 Share Posted June 1, 2016 How can we control engine or canvas screen resolution? Can we with lower resolution get betther Frams per seconds? Can se set fulscreen with resolution 800x600 or 1280x1024 If yes, how can we do it? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 1, 2016 Share Posted June 1, 2016 hi yes you can resize your canvas and create engine again and back to current size you just lose your quality you can optimize that with detect retina display or (x2 ox3 or x4 or ultra ) and divide size to current canvas.style.width = "800px"; canvas.style.height = "600px"; renderer = new BABYLON.Engine( canvas, true); canvas.style.width = '100%'; canvas.style.height = '100%'; Quote Link to comment Share on other sites More sharing options...
ian Posted July 1, 2016 Author Share Posted July 1, 2016 Thank you. I Will try to see if performace Will be better with low resolutions. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 1, 2016 Share Posted July 1, 2016 canvas.style.width = oldwidth / window.devicePixelRatio; canvas.style.height = oldheight / window.devicePixelRatio; renderer = new BABYLON.Engine( canvas, true); canvas.style.width = '100%'; canvas.style.height = '100%'; it can be help more Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 3, 2016 Share Posted July 3, 2016 As I believe @NasimiAsl might be directing you to consider: canvas.style.width = '80%'; //(80%), (75%) etc. as read below: canvas.style.height = '60%'; //as above, (60%) is simply an "arbitrary" variation on canvas size - as I would certainly be specific in setting these percentages depending on my scene(s) and target device(s) - and I mention it in these terms as I rarely see developers rely on percentages as opposed to using strictly 100% in coordination with pixel size and aspect ratios. So if you want to do some testing to avoid worrying about specific pixel resolution for multiple devices since many manufacturer's devices such as Apple Ipads often have dramatically different resolutions between releases on similar devices and OS only months apart by release date - and if you're not relying wholly on WebGL and instead relying on HTML for canvas size, you'll find that your canvas' will often be drawn very poorly when setting specific pixel resolutions as opposed to using varying canvas percentages. Just another point of view to consider, but one which often helps me build better optimized canvas' for browsers on differring hardware and OS with dramatically varying displays. Especially when it comes to smartphones. DB ian 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.