-
-
Save ccellado/e3d5e739208cb1fd2902bc952871d501 to your computer and use it in GitHub Desktop.
How to record cycled video from shadertoy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // copy paste this in console | |
| function shader_exporter(duration, width, heigth, paused) { | |
| document.getElementById('demogl').style.width = width + 'px'; | |
| document.getElementById('demogl').style.height = heigth + 'px'; | |
| document.getElementById('myResetButton').click(); | |
| document.getElementById('myRecord').click(); | |
| if (paused) document.getElementById('myPauseButton').click(); | |
| let t0 = performance.now(); | |
| function loop(){ | |
| if (performance.now() - t0 > duration * 1000) { | |
| document.getElementById('myRecord').click(); | |
| if (paused) document.getElementById('myPauseButton').click(); | |
| } else { | |
| requestAnimFrame(loop) | |
| } | |
| }; | |
| requestAnimFrame(loop); | |
| } | |
| shader_exporter(6.28318530, 512, 512, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment