Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Disable antialiasing on images. P3D Processing 2.0a6

$
0
0
Talking about late replies... (sorry...)
9 months later...

  1. import processing.opengl.*;
  2. import javax.media.opengl.*;
  3. PGraphics buffer;
  4. GL2 gl;
  5. PGraphicsOpenGL pgl;
  6. void setup() {
  7.   size(320, 240, OPENGL);
  8.   noSmooth();
  9.   hint(DISABLE_TEXTURE_MIPMAPS);
  10.   ((PGraphicsOpenGL)g).textureSampling(3);
  11. }
  12. void draw() {
  13.   buffer=createGraphics(width/8, height/8, P3D);
  14.   buffer.noSmooth();
  15.   buffer.beginDraw();
  16.   buffer.background(0);
  17.   buffer.stroke(255);
  18.   buffer.line(0, 0, buffer.width, buffer.height);
  19.   buffer.endDraw();
  20.   image(buffer, 0, 0, width, height);
  21. }
I guess this is the same issue marked for the PGraphics fitering for offscreen use.
I think this disabling interpolation thing could be really useful for processing, for using generated graphics, using small resolutions but large screen space with a pixely look, undersampling offscreen buffers to improve performance.

-
http://draconiansolo.wordpress.com/

Viewing all articles
Browse latest Browse all 1768

Trending Articles