Skip to content
Discussion options

You must be logged in to vote

you can set pixelratio via

<Canvas pixelRatio={window.devicePixelRatio} />

but better

<Canvas pixelRatio={[1, 2]} />

which constrains it to go no lower than one and no higher than 2 (some mobile displays go up to 4 which could be too slow due to the sheer amount of pixels.

the difference between canvas pixel size and viewport size can be calculated by

const { gl, viewport, size } = useThree()

// gl.getPixelRatio()
// viewport -> size in three units
// size -> size in pixels

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dangrabcad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants