Jump to content
GreenSock

eli-ott

Increase height of webgl canvas

Recommended Posts

So I want to resize my WebGL canvas to be bigger than window.innerHeight but more like document.body.scrollHeight.

I also don't want to lose the ration, so I would resize the width by the way (with ratio).

I already achieve some sort of resizing, but either the ratio wasn't good or the effect was not on the cursor anymore, like it was some hundreds pixels away from the cursor place.

See the Pen ExEQpqY?__cf_chl_rt_tk=8i2yLZ7dM36vzkfJmPzZZtBoR0kK3VkNFrRjnCJkH48-1659731576-0-gaNycGzNDFE by mdrei (@mdrei) on CodePen

Link to comment
Share on other sites

First up - it's definitely not a good idea to make your canvas that big. Even with something simple you're very likely to hit the webGL buffer limit and run into perf issues. (source - someone who tried and failed)

 

We also can't really advise on how to adjust code written by other people - especially complex GLSL stuff! Sorry. Happy to help with any GSAP questions but this is a little out of our remit.

 

Sorry I can't give any more helpful advice!

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×