GUI and setHardwareScalingLevel

Version: 7.45.0
Engine: any
Browser: any

There is a setHardwareScalingLevel method of engine, which is often used to adapt for scaling of the browser, of dpi scaling of the OS.
Setting this can get better pixel-aligned rendering of the 3d content without changing the size of rendered meshes, but in case of 2d (gui), it changes the size of rendered gui.

See this playground for example of how setHardwareScalingLevel affect GUI (CreateFullscreenUI in this case):

So, is there an option, or should there be one, to make 2d GUI have the same behavior as 3d meshes, to not scale when setHardwareScalingLevel changes?

You can compensate with renderScale:
gg | Babylon.js Playground

3 Likes

So it’s only possible to do it manually? Should there be an option that the renderScale would auto align with setHardwareScalingLevel?

It is possible to add this to the resize function of the advanced dynamic texture, but it will be a break change so we will need to put it behind a flag.

1 Like