openCL

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.

OpenCL Beginners examples - Clear & Update Buffer

cybero's picture

The following are two very simple OpenCL kernels , intended to be used as beginner's tutorial / study examples.

They show a simple way of clearing and updating the image buffer.

They both are setup to take an image input, one simply clears the image buffer to a constant colour, variables for which can be changed in the code.

The other takes the same image input , reads that image prior to applying whatever argument one has given to be done prior to updating the buffer.

In this case the argument is set to brightness.

TurbulentGradients-ClosedLoop (Composition by cybero)

Author: cybero
License: (unknown)
Date: 2010.08.02
Compatibility: 10.6
Categories:
Required plugins:
(none)

This is another porting of OpenCL kernels derived from the seminal noise_kernel.cl file provided by Apple as one of its Developer examples.

Instead of nesting these kernels together, as can be done in the same OpenCL kernel patch, they have been deliberately separated .

Each gradient kernel provides a very responsive, configurable graphical animation well suited to reacting to audio input.

In this current setup, the four kernels are rendered in turn via a demultiplexer.

This post is a companion to the visualizer version but is not set as an iTunes visualizer, being intended as an audio reactive loop, the inputs of which kernel can be further altered 'live'. In this construct, it is being fed audio via an Audio Input patch.

There are a lot of possibilities with this type of gradient & I'm looking forward to creating some different texture / image creation & filtering kernels in the future.

For now, do enjoy & employ these as you see fit.

I'll be interested to see how they do get used.

I shall also be looking forward to creating something very similar in Core Image.

At the present, my Core Image equivalents are only working in grayscale, which puts them about as far advanced as I was month ago with making image transformations using OpenCL. [Soon though :-)]

BTW - a big shout out and thanks to Pascal @ t-linked.com for his beautiful roll out of the gradient_noise kernel.

Provided me with much inspiration and reason to study closely.

Hopefully, these kernels will help to do the same for Kineme forum users.

Thanks to all of you whose postings have inspired and advised [ almost too many to mention ].

Turbulent Gradients (Composition by cybero)

Author: cybero
License: (unknown)
Date: 2010.08.02
Compatibility: 10.6
Categories:
Required plugins:
(none)

This is another porting of OpenCL kernels derived from the seminal noise_kernel.cl file provided by Apple as one of its Developer examples.

Instead of nesting these kernels together, as can be done in the same OpenCL kernel patch, they have been deliberately separated .

Each gradient kernel provides a very responsive, configurable graphical animation well suited to reacting to audio input.

In this current setup, the four kernels are rendered in turn via a demultiplexer.

This post is a companion to the "closed loop" version that is not set as an iTunes visualizer, but is intended to be an audio reactive loop, the inputs of which kernel can be further altered 'live'.

There are a lot of possibilities with this type of gradient & I'm looking forward to creating some different texture / image creation & filtering kernels in the future.

For now, do enjoy & employ this as you see fit.

I'll be interested to see how they get used.

Infinite Loop 2 (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2010.07.28
Compatibility: 10.6
Categories:
Required plugins:
(none)

This patch shows how you can take the events inside of an iterator, record to queue, and then spooky them outside of the iterator, so that they can be used.

This principle makes it possible to create "interaction" structures where every vertex can be "grabbed" via the interaction patch, and they are all inherently "hot".