-
I'm create a react-three-fiber app that is just a header, so it's possible to scroll to see rest of page. I'm updating the pixel ratio on export const getDevicePixelRatio = () => Math.min(window.devicePixelRatio, 2); I change the gl pixelration when:
I put console on each case, but the pixel ratio auto change with not my console has you can see in this exemple: The pixel ration switch from 2 to 1, and I created a Hook to see this in console: setInterval(() => {
const pr = gl.getPixelRatio();
console.log(pr);
if (pr !== getDevicePixelRatio()) {
console.log('ERROR-pixel ratio has change');
gl.setPixelRatio(getDevicePixelRatio());
}
}, 1000); Do you have an idee why the pixel ratio change and HOW stop this thing append. I'll check the source code to find anything. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Ok I found the solution to handle pixel ratio using But If exist a way to get the pixelratio of GL when the pixelratio change, like "add an event" ? |
Beta Was this translation helpful? Give feedback.
Ok I found the solution to handle pixel ratio using
react-three-fiber
with :dpr={[1, 2]}
the problem is solved.But If exist a way to get the pixelratio of GL when the pixelratio change, like "add an event" ?