- Home /
Question by
Charles-Van-Norman · Jun 23, 2016 at 04:39 AM ·
webglresolutionscalingmouse input
How can I scale webgl canvas without losing input position?
I am building a game to WebGL, but on Retina monitors the resolution in pixels is tiny. If I scale the resolution up normally by changing the canvas width and height, the game slows to a crawl because Unity is trying to render way too many pixels. If I stretch the canvas using the canvas scale in css, it scales up fine without Unity slowing down, BUT my input locations for mouse events are all wrong.
How can I scale the canvas in the browser up (to 4x size, for example) while keeping the mouse inputs in the correct position?
Thanks in advance
Comment