Loading...
Logo
Processing Forum
Hi there,

So I've got a sketch in P3D in the latest version of Processing. It's got a bit of 3D with some 2D elements overlaid once I call hint(DISABLE_DEPTH_TEST).

Problem is, even though I've got noSmooth() on, it's blurring all my images. Not just the outlines, the entire image is slightly blurred. It's not being upscaled, I'm literally just drawing the .png onto the screen with PImage. What's causing this and how can I stop it?

Replies(4)

Hello, the blurriness is due to the fact that the new P3D renderer is now based in OpenGL and a different texture interpolation mechanism. 

Add the following line:
Copy code
  1. hint(DISABLE_TEXTURE_MIPMAPS);
at the end of setup() and let me know if it removes the blurriness in the images.
Yes, hint(DISABLE_TEXTURE_MIPMAPS) disables mipmapping, but the textures are still linearly interpolated, wich can lead to blurriness if you draw an image at a size larger than its native resolution... I need to discuss with the rest of the devel team if an additional function/hint should be added to disable interpolation at all.

However, if your images are not upscaled, then they shouldn't be blurry. Can you post an sketch with demonstrates the problem with 2.0b1?
Talking about late replies... (sorry...)
9 months later...

Copy code
  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/