PTexture and PTextureFilter objects for Processing   1 comment

I wrote a couple of new objects to simplify the handling of opengl textures and glsl filters in Processing.

The PTexture object is a descendant of PImage. It holds an opengl texture that can be copied from and to the pixel property. Then the PTextureFilter allows for applying glsl filters to the PTexture objects. The filter can include grid mapping and distortion of the texture through the use of vertex shaders.

I tried to implement these objects in a way that they follow the “Processing style” of defining methods, etc.:

PTextureFilter pulseEmboss;
PTexture tex0, tex1;

tex0 = new PTexture(this, “milan_rubbish.jpg”);
tex1 = new PTexture(this, tex0.width, tex0.height);

pulseEmboss = new PTextureFilter(this, “pulsatingEmboss.xml”);

tex0.filter(pulseEmboss, tex1);

tex1.renderTexture(0, 0);

A full online example is available here:

http://users.design.ucla.edu/~acolubri/processing/texture/applet/

The goal is compile all this code as a new library.

Advertisements

Posted March 30, 2008 by ac in Programming

Tagged with , , , , , , ,

One response to “PTexture and PTextureFilter objects for Processing

Subscribe to comments with RSS.

  1. Pingback: Texture library for Processing « codeanticode

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: