A question about "Make image with Shadertoy" ... which may reveal my lack of knowledge on the subject. Is the shader applied once to each pixel in the output image width and height, or (as I would expect) multisampling is being used? If the later, then how does one adjust the degree of multisampling?

Comments

Paul,

jmcc's picture
Submitted by

Paul,

The shader is applied once to each pixel in the output image with no multisampling. Make Image with Shadertoy draws a pair of triangles that completely cover the image, with no visible triangle edges. OpenGL multisampling only makes a difference for edges of triangles. Since they aren't visible, OpenGL multisampling wouldn't have any effect for this node, so Vuo disables it to improve performance.

Paul, my apologies in the

jmcc's picture
Submitted by

Paul, my apologies in the delay getting back to you.

It's true that sampling discrete pixels can lead to aliasing. Some ways to compensate for that:

  1. Modify the shader to take into account the space between the discrete sample points. The GLSL smoothstep() and fwidth() functions are useful for that — here's an introductory tutorial: https://rubendv.be/posts/fwidth/

  2. Spatially supersample — render the shader image at a higher resolution than needed, then scale it down.

  3. Render the shader image as usual, then apply an alias-reducing postprocessing filter such as FXAA