core image

CI Normal Map_gtII (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2011.01.24
Compatibility: 10.4, 10.5, 10.6
Categories:
Required plugins:
(none)

This is a companion to the other normal map filter, that samples from more pixels than CINormalMap_gt to make it's normal map from heightfield.

Included is another composition that makes a normal map on the fly using this filter.

CINormalMap_gt (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2011.01.18
Compatibility: 10.4, 10.5, 10.6
Categories:
Required plugins:
(none)

This is a core image filter that takes a greyscale heightfield (bump map) image, and outputs a normal map, in the style of nVidia Normal Map Filter plugin for photoshop, or NMG.

This allows one to create greyscale imagery in Quartz Composer, run image through this filter, and generate normals that can be rendered in the GLSL shader. This example uses Christopher Wright's Normal Map 1.qtz as a rendering destination, to show how it works.

Normal mapping is used to fake the appearance of a higher poly mesh than is actually being used when using GL Lighting.

http://en.wikipedia.org/wiki/Normal_mapping

GT Emboss (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2010.09.29
Compatibility: 10.4, 10.5, 10.6
Categories:
Required plugins:
(none)

This is a mix of a height field from mask with emboss filter, with a blend mode that adds color of the source back in. I've used this extensively for a long time, and thought it might be useful to post.

Shaded Material Core Image patch

cybero's picture

The Shaded Material patch

Quote:

Produces a shaded image from a height field. The height field is defined to have greater heights with lighter shades, and lesser heights (lower areas) with darker shades. You can combine this filter with the CIHeightFieldFromMask filter to produce quick shadings of masks, such as text.

The resulting image can be used as a backdrop, texture, illustration, whatever.

I have found no CIHeightFieldFromMask filter anywhere :-).

That apart, this patch does a pretty tidy job and has huge scaling range on the shadings produced. I like it. I have found though that it sometimes acts up under certain construct conditions.

These always include that the image being presented to the patch are resized and that size is congruent with the size of any image input into the OpenCL kernel routine creating one part of the two image inputs into the Shaded Material patch.

However, these same conditions also apply within those constructs that work without fail. The more that the noise texture image being used changes, say through a multiplex or a movie, the more likely the snarl up is with the Shaded Material patch.

Just wondered if anyone else had found this a useful patch and if they had any insight as to why it can seemingly unpredictable, cause a graphics related crash. It's as id the resize doesn't actually stick and causes a leak. No OpenCL leaking, just mentioned as being part of the construct.

Droste - Sample Code

cybero's picture

A new Core Image routine and spiffy example from the Developer Sample Code section - new accession to the stacks :-).

Requires 10.6.x, which I guess underlines how much 10.6 suits tasks unachievable under 10.5.x and earlier, even with Core Image.