New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DPI #482
Comments
I think this is something worth investing in, especially for the potential performance gains as we would potentially be able to upscale from lower rendered resolutions. I'll start looking into this |
I added some rudimentary support for This is also dependent on a change to BabylonJS which properly calls these new NativeEngine members. I'll open a PR Thursday when I return and begin looking into implementing a polyfill for |
Looking at MSDN:
This gives me the impression that window.devicePixelRatio can be implemented native-side as another scalar applied to calculate the resolution of the BGFX window. I'll most likely implment this similarily to how I'm currently implementing |
I think we can deduce |
Babylon.js has some support for scaling the display in different ways, based on the
adaptToDeviceRatio
Engine
constructor parameter,Engine.setHardwardScalingLevel
, andwindow.devicePixelRatio
. I believe Babylon Native does not currently support any of this, and that currently we always specify view size in device pixels. I think that also means on mobile devices we are probably rendering at very high resolutions, perhaps higher than necessary with an associated resource cost. We should think about how to support this as it could have a huge impact on mobile performance.The text was updated successfully, but these errors were encountered: