patriciogonzalezvivo / glslCanvas

Simple tool to load GLSL shaders on HTML Canvas using WebGL
http://patriciogonzalezvivo.github.io/glslCanvas/
MIT License
1.97k stars 183 forks source link

Is it possible to force a lower framerate than 60? #68

Open JL102 opened 3 years ago

JL102 commented 3 years ago

Hi,

I'm kinda surprised that having an idle animation with glslCanvas causes a non-negligible amount of CPU usage. When my animation is idle, it uses 6-7% of my CPU, and when I mouse over it, it uses ~15% of my CPU. I figure it would be less resource intensive if I force it to refresh at 30 frames per second instead of 60. Is there a simple way of doing that?

JL102 commented 3 years ago

I edited glslCanvas myself to add that functionality, and it works quite well. Here's what I changed:

benosse commented 2 years ago

Thanks, works like a charm! I think it would be a nice addition to the source :)