ozRocker

[SOLVED] Viewport confusion

Recommended Posts

Are we meant to be using

<meta name="viewport" content="width=device-width" />

so everything fits into the viewport on mobile devices?  'cos when I use this line the viewport will not render using retina display and I get a fuzzy render from the canvas.

 

Share this post


Link to post
Share on other sites

We use that for most of bjs sites:

<meta name="viewport" content="width=device-width, user-scalable=no">

Also keep in mind that by default babylonjs will limit the DPI scaling to 2. You can play with the hardware ratio with engine.setHardwareScalingRatio(0.5)

Share this post


Link to post
Share on other sites
4 hours ago, Deltakosh said:

We use that for most of bjs sites:

<meta name="viewport" content="width=device-width, user-scalable=no">

Also keep in mind that by default babylonjs will limit the DPI scaling to 2. You can play with the hardware ratio with engine.setHardwareScalingRatio(0.5)

Awesome!  That completely solved all my problems.  I didn't realise you could apply hardware scaling to desktop screens as well.  Now all my demos look twice as good :)

btw, its actually engine.setHardwareScalingLevel()

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.