sebalies / hydra-extensions

super-usable hydra extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hydra-extensions

Extensions for Hydra focusing on usability.

List of extensions

Order is merely alphabetical


hydra-abbreviations

Write very small hydra code.

source / url

o(10, 0.1, 1.2).bl(ns(3)).df(sh(4, 0.6).rt(0, 0.1)).out()

open in hydra!


hydra-arithmetics

All the functions you needed to make complex visual arithmetics, easily.

docs / url

osc(10,.1,2)
	.mod(gradient().asin().cos())
	.step(noise(2).unipolar().div(o0))
	.blend(o0,.2)
	.out()

open in hydra


hydra-arrays

Extends the functionality of arrays in Hydra, letting you operate between different arrays and generate new ones.

docs / url

gradient().diff(o0)
	.hue([0,2,3,8].div(10).addWrap([0.2,0.1]).smooth())
	.rotate(Array.run(8).mult(Math.PI*2/8))
	.add(shape(64,.02)
  			.scrollX(Array.random(16,-0.4,0.4).smooth())
  			.scrollY(Array.random(16,-0.4,0.4).smooth()))
	.blend(o0,.6)
	.out()
bpm = 50

open in hydra


hydra-blend

Adds most blending modes you know from raster image softwares. Ideal for compositing.

docs / url

osc(30)
	.screen(noise(3,1).pm())
	.linearBurn(gradient(1).hue(.3))
	.out()

open in hydra


hydra-canvas

Let's you easily control Hydra's canvas.

docs / url

setResolution(256,256)
canvas.setRelativeSize(2)
canvas.setAlign("right")
canvas.setLinear()

solid(1).diff(o0).scale(.5).diff(noise(2,0.4)).out()

open in hydra


hydra-colorspaces

All the function you might need to work with color in different colorspaces such as CMYK, HSV, YUV, etc.

docs / url

gradient().rgb.aSet(0)
  	.cmyk.from()
	.hsv.hOffsetFrom(noise(1,1),.3)
	.yuv(1,.5)
	.out()

open in hydra


hydra-debug

WARNING: doesn't work in atom / pulsar

Adds a .debug() function that allows you to easily read the fragment shader of your sketch and test changes in real time.

docs / url

osc().rotate().debug(o0)

open in hydra


hydra-fractals

Adds some functions that when feedbacked are useful for creating fractals. Thanks to Kali for the idea.

docs / url

src(o0)
	.scale(.75)
	.add(noise(2,1),.4)
	.invert()
	.inversion()
	.mirrorX2()
	.blend(o0,.3)
	.out()

open in hydra


hydra-gif

WARNING: doesn't work on instance mode as of now

Let's you load .gif files into Hydra.

docs / url

s0.initGif('https://i.giphy.com/media/kZqbBT64ECtjy/giphy.gif')

src(s0)
	.out()

open in hydra


hydra-glsl

Write GLSL code directly in your patches.

docs / url

glsl('vec4(sin(uv.x*i0+(time*i1*vec3(i2,i2*2.,i2*3.))),1.0)',16,2,.3)
    .glslColor('vec4(c0.brg-(sin(c0.b)*i0),1.)',()=>Math.cos(time))
    .out()

open in hydra


hydra-mouse

Replaces Hydra's standard mouse object adding useful properties.

docs / url

noise(1)
	.add(shape(64,.01,.2).scrollX(()=>mouse.posx).scrollY(()=>mouse.posy))
	.out()

open in hydra


hydra-outputs

Change the properties of Hydra's outputs' framebuffers. Most importantly: try linear interpolation.

docs / url

o1.setLinear()

src(o1)
    .layer(osc(30,.2,1).mask(shape(4,.1,0)))
    .scale(1.01).rotate(.01)
    .out(o1)

open in hydra


hydra-pixels

Retrieve pixel values from Hydra's outputs.

docs / url

osc(40,.09,1.5)
   .diff(osc(20).luma())
   .color(1,1,()=>1+pixel[0]/255)
.out()

update = ()=> {
  pixel = o0.read(width/2,height/2) // center of the screen
}

open in hydra


hydra-src

Adds srcAbs and srcRel functions. srcAbs will act as src() but will show the source with its original width and height on screen. scrRel will act as src() but will mantain the source's aspect ratio. Works great with hydra-wrap.

url

src(o0)
	.scale(1.01)
  	.colorama(-.02).brightness(-.2)
  	.blend(o0,.8)
	.layer(srcAbs(s0).luma(.4,.1))
	.out()

open in hydra


hydra-swizzle

Replicates the swizzling functionality from GLSL.

docs / url

gradient(1).gbg
	.layer(osc(30,.1,2).bggr)
	.layer(gradient().r.mask(shape(2)))
	.out()

open in hydra


hydra-vec4

Adds wrapper functions that allow you to construct vec4's like you would in GLSL.

docs / url

noise()
	.mult( vec4( vec3(0.5) , 1 ) )
  	.add( vec4( [0.5,0].smooth() ) )
	.layer(
		vec4( vec3( [0, 1, 0.5] , vec2( ()=>time%1 ) ) , 1)
  			.mask(shape(4))
	)
  	.out()

open in hydra


hydra-wrap

Change how Hydra wraps textures, and control the wrapping of generators.

docs / url

hydraWrap.setMirror()

src(o0)
	.layer(osc().rotate().mask(shape(4,1,0)))
	.scale(.5)
	.blend(noise(),.2)
	.out()

open in hydra


Also check:

About

super-usable hydra extensions

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%