Pixel Grid (Composition by smokris)

Author: smokris
License: MIT
Date: 2009.12.16
Compatibility: 10.5, 10.6
Categories:
Required plugins:
(none)

Generates an infinite grid of pixels with the specified spacing.

PreviewAttachmentSize
Pixel Grid.qtz6.25 KB

gtoledo3's picture
Re: Pixel Grid (Composition by smokris)

lol...

cybero's picture
Re: Pixel Grid (Composition by smokris)

Must be me I guess, but I installed the virtual macro and can find it in the Patch Library, but no pixel grid ensues into any renderer patch like Billboard or Sprite.

smokris's picture
Re: Pixel Grid (Composition by smokris)

Did you run it through Image Crop before passing it to the renderer? (This CI kernel produces unbounded images, similar to the Constant Color patch and others.)

cwright's picture
Re: Pixel Grid (Composition by smokris)

minor tweak:

kernel vec4 pixelGrid(float Spacing, __color GridColor, __color BackgroundColor)
{
   vec2 v = mod(destCoord(), Spacing);
   return (v.x+v.y) <= 1.
      ? GridColor : BackgroundColor;
}

mod is an expensive operation, might as well not do it so much...

smokris's picture
Re: Pixel Grid (Composition by smokris)

Ah, thanks. Composition updated.

cybero's picture
Re: Pixel Grid (Composition by smokris)

Yes, but once I updated the installed macro from the version _0 then it began working - I wonder if I haven't got something askew with my QC cache ? Restarting QC seemed to get the macro running from the updated composition.

Now its working - cheers.

cybero's picture
Re: Pixel Grid (Composition by smokris)

A dumb question, in all probability, but why do I get

[18:06:07.504]   <RenderView: 0x11792f0b0>: OpenGL error 0x0502 (invalid operation) during rendering at time 6.451997s

in the Graph Foundation Log when hooking the pixel grid to another CI filter[Motion Blur] then to a crop through to a GL Torus object ? [1.3] :-)

Actually get the same result bypassing the Motion Blur on rechecking.

jersmi's picture
Re: Pixel Grid (Composition by smokris)

Seems like such a straight-forward tool -- I don't understand why this is what I see when sending to a Billboard. I am using Crop to Destination but all the crop tools produce the same results, and when I drag the corner of the viewer window different patterns of pixels form in the black space. Am I missing something obvious?

These kind of "crop" situations come up for me. Maybe solving this issue is an opportunity to understand a little more about cropping in general in QC.

PreviewAttachmentSize
Screen shot 2010-02-06 at 4.51.52 PM.png
Screen shot 2010-02-06 at 4.51.52 PM.png45.79 KB

smokris's picture
Re: Pixel Grid (Composition by smokris)

Ooh, strange. In theory you should just be able to connect this to Crop to Destination, then Billboard. (I did exactly that just now, and it works properly on my system. 10.6, GeForce 8600M GT.)

What hardware are you using? Can you try it on other hardware?

smokris's picture
Re: Pixel Grid (Composition by smokris)

Hm, that doesn't happen for me. What hardware are you using?

cwright's picture
Re: Pixel Grid (Composition by smokris)

does it happen with other objects (sphere, cube, etc.)? If not, it's a gl torus bug, but if so, it could be a subtle texture pipeline quirk.

jersmi's picture
Re: Pixel Grid (Composition by smokris)

I can on Monday. Right now I'm on an older machine -- 2.16 Macbook Pro with an X1600.

jersmi's picture
Re: Pixel Grid (Composition by smokris)

This simple, clear patch allows me to ask a couple newb questions about Core Image.

Is it possible within the CI patch to mask the white ("pixel") part?

Is it silly to ask if there are other ways to interpolate a "pixel" other than bilinear?

Why does the grid pattern create an "X" (Actually "X" with "+")?


Screenshots: Alas, the core image pixel -- not very "pixelly":

With exposure and gamma filters: