filter

Count appearances of a value in a structure

zuvala's picture

hi there

Is it possible to detect how many times a value is repeated within a structure? ie. i've got a xml-file with a "date" key and want to create several individual representations grouped for each day.

Or divide a structure in several substructures, when a key value changes?

thanks for any advice

Worley Cellular Voronoi Noise (Composition by gtoledo3)

Author: gtoledo3
License: MIT
Date: 2013.04.06
Compatibility: 10.5, 10.6, 10.7, 10.8
Categories:
Required plugins:
(none)

This shader is something I've wanted to do for a long time; a gpu-accelerated voronoi type image filter.

This uses the concept I was thinking of here (http://kineme.net/forum/Programming/StencilbufferinQC#comment-25903) . As I was making it, I realized it would be interesting to also have a mode where the randomness of the grid was controlled by luminosity, so there are a couple of modes for that.

Parameters: -distFormula: This changes the distance formula used for the voronoi computation from linear to "manhattan".

-lightMode: This changes the shader from a flat look, to a simple gradient "lighting" look, to a more complex "lighting" look with adjustable normals, and finally a normal output of the complex look.

-displaceMode: This controls whether the grid noise is triggered by brightness, darkness, or it's a constant value.

-displaceAmt: This controls how much each cell is displaced. With the luminosity displace modes, it's a multiplier, with the constant mode, it's constant.

-density: This controls the density of the voronoi grid.

-uvOffset and Zoom: I've added this because of the nature of the worley algorithm, cells at the top and side can sometimes be right where the texture repeats. A little zoom in and recenter solves this.

-normAdj/normAdjA/B/C - This is only active with the last two lighting modes. This changes the shape of the voronoi facets.

Enjoy. Please give credit if you use it, and also note that it's MIT licensed. The sample composition uses GL Tools, because it renders to a Quad, but if you don't have it installed, just use a Billboard/Sprite/whatever.

Ashima Noise External Texture Warp (Composition by gtoledo3)

Author: gtoledo3
License: Creative Commons Attribution-NonCommercial
Date: 2012.06.25
Compatibility: 10.4, 10.5, 10.6, 10.7
Categories:
Required plugins:
(none)

This is a GLSL shader that is a "texture warp/distortion" effect.

It uses the Ashima Noise implementation that's been kicking around lately, that I particularly like and think looks nice and organic.

I'd used it for generating patterns, but had the idea a month or so ago to use the noise to perturb in input texture - which didn't occur to me at first since the whole deal was that it's a "textureless" noise implementation, but I'm glad it did!

After I had that hanging around for awhile, I decided to add some simple "feedback" loop facilitated lighting, which has a kind of eerie look :-)

I've been able to generate really cool looking abstract landscape type looks by feeding textures that have those kind of colors going on, and macerating the texture to taste. I've also achieved some pretty gross "melting flesh"/"monster" looks as well. I've had some fun with this filter in the past while, and I hope you all do as well. :-)

Go through the "Mode" values to checkout the various basic looks, 4 Modes in all.

"Amount" will increase the amount of the rippling, while "noiseFreq" will tend to increase the density of rippling per area.

"Speed" controls the pace of distortion fluctuation.

"Bump" will do some stuff to the .z channel to mess with the lighting a bit in modes where it's active.

"Spot R1/R2" control the throw of the mouse active light.

"gammaOn/gamma" controls gamma (psonice's gamma code...if it works, why not use it?).

Then there's some color channel offset stuff.

Static (Composition by gtoledo3)

Author: gtoledo3
License: MIT
Date: 2012.06.21
Compatibility: 10.5, 10.6, 10.7
Categories:
Required plugins:
(none)

This is a glsl texture filter that makes a look sort of like a tv with a decent amount of noise and static. It's not really too accurate as far as depicting what a noisy tv really looks like, but it's not too bad for a lo-fi look.

grass scene (Composition by dust)

Author: dust
License: Public Domain
Date: 2012.04.09
Compatibility: 10.6, 10.7
Categories:
Required plugins:
(none)

just a simple mesh grass and tree scene, utilizing mesh filters and noise to create animations in an otherwise static scene. I'm getting a solid 60fps with both mesh and wire images combined. you might want to take out the wire images to speed things up or to add etc... mesh files made with maya and attached.