[PD] still struggling with basic understanding of Gem dataflow

chris clepper cgclepper at gmail.com
Wed Mar 25 18:45:17 CET 2009


There are two types of objects in GEM: pix and OpenGL.

Pix objects do work in the top to bottom manner like Pd DSP objects.  One
thing to keep in mind is that the pix_ objects use 'in place' processing
which means that the pixel data is overwritten by each object.  For most
types of processing this works fine, but it you want to apply two different
processes to the same pixels then you need pix_separator.  pix_separator
copies the pixels to a new buffer for further processing.

The OpenGL objects mostly map to some GL operation (rotate or translate) or
create a piece of geometry (cube).  The GL pipeline has its own rules, but
in general it works like back to front rendering.  Each pixel drawn is put
on top of what is already there.  For example, the default state of GEM
fills the entire view with black pixels. After that any geometry renders on
top of those black pixels (alpha blending will give a mixture of the
existing and new pixel).

Objects like rotate and translate manipulate various GL matrices and those
matrices are used by the graphics card to render the geometry in the correct
orientation.  Matrices are reset for each frame and the processes are
additive (translate) or multiplicative (scale) to the existing values.

Texturing bridges the pix_ and GL objects together allowing for the image
pixels to be applied to the geometry.  The convention in GEM is to put the
GL objects after the pix_ ones showing that once the pix_ processes are done
on the CPU it is time for the GL processes on the GPU to start.

You can place GL objects before the pix_ ones and still have it work.  For
example, the rotateXYZ can be right after the gemhead and before pix_
objects as it just sets a matrix transform up for all of the GL rendering
after it and the pix_ objects have nothing to do with it.

There are lots of exceptions to Pd rules in GEM and there is really no way
around them.  It is kind of like learning English - I before E except after
C, excepting all of those words that ignore the rule.



On Wed, Mar 25, 2009 at 12:08 PM, John Harrison
<johnharrisonwsu at gmail.com>wrote:

>
> Perhaps I need some rules about how Gem is different than Pd in terms of
> dataflow. So far it seems to me that a rendering chain in Gem shows
> conections but does not reveal the order in which these connections are
> processed i.e. if 3 objects are all connected to each other in a rendering
> chain in Gem i.e.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090325/945f8d7d/attachment.htm>


More information about the Pd-list mailing list