meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

Set correct device pixel ratio for rendering #102

Closed ManifoldFR closed 3 years ago

ManifoldFR commented 3 years ago

On HiDPI screens, we need to use the window object's devicePixelRatio to set the renderer's pixel density to the screen's detected pixel density. This avoids getting blurry output being rendered to the viewpoint on e.g. retina displays.

rdeits commented 3 years ago

Thanks! I don't have a retina display to test this on, but it seems to still work fine on non-retina devices, and I'll take your word that this helps out for HiDPI.