You can keep size()
so it fits on your screen, but, in my code above, you can set the size of the grad
PGraphics to be as large as you want.
So
void setup() {
size( 600, 800, P3D );
colorMode( HSB, 1, 1, 1, 1 );
grad = createGraphics( width*2, height*2, P3D );
gradShader = new PShader( this, gradVert, gradFrag );
initControlPoints();
gradShader.set( "strength", strength );
gradShader.set( "bOklab", bOklab );
noLoop();
}
and in draw()
, change image()
to image( grad, 0, 0, width, height );
and where I have save( fileName );
change it to grad.save( fileName );
so it saves the PGraphics image rather than the screen image.