3
我在OSX和Windows上都使用了处理3(和2)。屏外PGraphics缓冲区中的线性图形比直接画出的线条要粗糙得多。看起来形状边缘的抗锯齿效果不好。处理3离屏难看
你能帮我让离屏缓冲区图形更好吗?
exmple图像 ugly offscreen on the right, on-screen on the left
示例代码
PGraphics pg;
void setup(){
size (1024,768, P2D);
pixelDensity(2);
smooth();
pg = createGraphics(width, height, P2D);
noLoop();
}
void draw(){
background (0);
pushMatrix();
translate (width/2-100, height/2);
rotate (PI/6);
stroke(255);
noFill();
strokeWeight(0.5);
rect (0,0,100,100);
popMatrix();
pg.beginDraw();
pg.smooth();
pg.clear();
pg.translate (width/2+100, height/2);
pg.rotate (PI/6);
pg.stroke(255);
pg.noFill();
pg.strokeWeight(0.5);
pg.rect (0,0,100,100);
pg.endDraw();
image(pg,0,0, width, height);
save("shot.png");
}
谢谢!
该问题已被交叉处理论坛here。
请多个列表之间的链接:https://forum.processing.org/two/discussion/13355/offscreen-pgraphics-is-ugly –