ShaderToy-Chrome-Plugin icon indicating copy to clipboard operation
ShaderToy-Chrome-Plugin copied to clipboard

Suggestion: Resolution upscale

Open MichaelMoroz opened this issue 3 years ago • 3 comments

Would be nice to have the option to not only divide the resolution, but also increase it. It's mostly useful for better quality and benchmarking.

On top of Alt + 1..9 for downscale something like Ctrl + 1..9 or Alt+Shift+1...9 for upscale would be nice.

MichaelMoroz avatar Feb 13 '22 16:02 MichaelMoroz

Aye, I would love to be able to change the canvas to 3840x2160 so-as to record the output in 4K

589290 avatar Oct 02 '23 10:10 589290

It turns out... all you have to do is open dev tools and execute something like this to change the canvas res :

gShaderToy.iSetResolution(3840,2160);

But still, it would be nice to have this as a feature under Toggle Controls somewhere....

589290 avatar Oct 02 '23 11:10 589290

Actually, it's a little more involved.... see: https://github.com/patuwwy/ShaderToy-Chrome-Plugin/blob/7a87138bc6152ac1d13168abf08887c797fea75b/app/shadertoy-plugin.js#L319...L334 but this works :

// change ST res

var mE = gShaderToy.mEffect;
var xres = 3840;
var yres = 2160;

gShaderToy.mEffect.mRO.unobserve(gShaderToy.mCanvas);

mE.mCanvas.setAttribute('width', xres);
mE.mCanvas.setAttribute('height', yres);
mE.mCanvas.width = xres;
mE.mCanvas.height = yres;
mE.mXres = xres;
mE.mYres = yres;

mE.ResizeBuffers(xres, yres);

gShaderToy.iSetResolution(xres, yres);

589290 avatar Oct 02 '23 11:10 589290