I often wondered why shaders and effects ask for resolution, which i always assumed i have to fill in canvas size, but i noticed when going through the threejs examples sometimes see fixed values, sometimes canvas size, sometimes 1 / canvassize. Could somebody explain?
I also don’t see any difference in quality between canvas size and fixed, other than size. In this example for instance https://codesandbox.io/s/react-three-fiber-line2-wireframe-iup24 512/512 make the lines a little wider, but when i adjust the lineWidth i see no difference to full canvas resolution. But can i assume that smaller, fixed values are faster?
The resolution value is normally used to consistently sample a texel’s neighborhood in the fragment shader. A good example is the implementation of SobelOperatorShader:
Well, lower resolutions in general speed up the performance in the fragment shader. But the above code will not be executed faster for a single fragment if resolution is smaller.