stevensona/shader-toy

Feature Request: Resolution Setting

enci opened this issue · 4 comments

enci commented

It would be great to have an option to set resolution/size for the preview window. It's a minor thing and I have a workaround by putting a small window underneath.

How are we imagining this though?
Afaik we don't have an impact on the actual window in VS Code, I could be wrong.
Instead we could add black bars to the rendering to enforce an aspect ratio of the rendering, the preview window itself would be unaffected.

@enci I imagine your use case is to enforce an aspect ratio and not precise pixels sizes. Am I mistaken in this?

enci commented

Indeed, aspect ratio would work lovely as well. Adding background color bars to enforce that ratio is would be perfect.

I know too little about Three.js and VS Code to tinker myself. It looks like the render() function explicitly reads the window's size and resolution, and uses that to draw a quad in that window.

It should be simple enough, hopefully I'm not too optimistic. I'll take a look in the weekend :)

Added in #40