Skip to content

mizt/MSL-Hydra-Synth

Repository files navigation

MSL-Hydra-Synth

Export ojack / hydra-synth as Metal shader (WIP).

Note

  • Source buffer is not supported.
  • Number of output buffers available is currently one.

Architecture settings

  • const OS = "macosx";
  • const OS = "iphoneos";
  • const OS = "iphonesimulator";

in MSL.js

Build

$node example_11.js 

The following two files are export.

  • ./assets/u0.json
  • ./assets/s0.metal

Build MSL

macosx

$ cd ./assets
$ xcrun -sdk macosx metal -c s0.metal -o s0.air; xcrun -sdk macosx metallib s0.air -o s0.metallib

iphoneos

$ cd ./assets
$ xcrun -sdk iphoneos metal -c s0.metal -o s0.air; xcrun -sdk iphoneos metallib s0.air -o s0.metallib

iphonesimulator

$ cd ./assets
$ xcrun -sdk iphonesimulator metal -c s0.metal -o s0.air; xcrun -sdk iphonesimulator metallib s0.air -o s0.metallib

Play

Hydra-Synth-Player

Test

example_3

by Olivia Jack

osc(20, 0.03, 1.7).kaleid().mult(osc(20, 0.001, 0).rotate(1.58)).blend(o0, 0.94).modulateScale(osc(10, 0),-0.03).scale(0.8, () => (1.05 + 0.1 * Math.sin(0.05*time))).out(o0)

example_4

by Nelson Vera
twitter: @nel_sonologia

osc(8,-0.5, 1).color(-1.5, -1.5, -1.5).blend(o0).rotate(-0.5, -0.5).modulate(shape(4).rotate(0.5, 0.5).scale(2).repeatX(2, 2).modulate(o0, () => mouse.x * 0.0005).repeatY(2, 2)).out(o0)

example_6

by Débora Falleiros Gonzales
https://www.gonzalesdebora.com/

osc(5).add(noise(5, 2)).color(0, 0, 3).colorama(0.4).out()

example_10

by Zach Krall
http://zachkrall.online/

osc( 215, 0.1, 2 )
.modulate(
  osc( 2, -0.3, 100 )
  .rotate(15)
)
.mult(
  osc( 215, -0.1, 2)
  .pixelate( 50, 50 )
)
.color( 0.9, 0.0, 0.9 )
.modulate(
  osc( 6, -0.1 )
  .rotate( 9 )
)
.add(
  osc( 10, -0.9, 900 )
  .color(1,0,1)
)
.mult(
  shape(900, 0.2, 1)
  .luma()
  .repeatX(2)
  .repeatY(2)
  .colorama(10)
)
.modulate(
  osc( 9, -0.3, 900 )
  .rotate( 6 )
)
.add(
  osc(4, 1, 90)
  .color(0.2,0,1)
)
.out()

example_11

by Zach Krall http://zachkrall.online/

osc(10, 0.9, 300)
.color(0.9, 0.7, 0.8)
.diff(
  osc(45, 0.3, 100)
  .color(0.9, 0.9, 0.9)
  .rotate(0.18)
  .pixelate(12)
  .kaleid()
)
.scrollX(10)
.colorama()
.luma()
.repeatX(4)
.repeatY(4)
.modulate(
  osc(1, -0.9, 300)
)
.scale(2)
.out()

example_14

by Olivia Jack
@_ojack_

osc(20, 0.01, 1.1)
	.kaleid(5)
	.color(2.83,0.91,0.39)
	.rotate(0, 0.1)
	.modulate(o0, () => mouse.x * 0.0003)
	.scale(1.01)
  	.out(o0)

example_15

by Olivia Jack
https://ojack.github.io

osc(100, 0.01, 1.4)
.rotate(0, 0.1)
.mult(osc(10, 0.1).modulate(osc(10).rotate(0, -0.1), 1))
.color(2.83,0.91,0.39)
.out(o0)

example_16

by Olivia Jack
https://ojack.github.io

osc(4, 0.1, 0.8).color(1.04,0, -1.1).rotate(0.30, 0.1).pixelate(2, 20).modulate(noise(2.5), () => 1.5 * Math.sin(0.08 * time)).out(o0)

example_17

by Olivia Jack twitter: @ojack

pattern = () => osc(200, 0).kaleid(200).scale(1, 0.4)
//
pattern()
  .scrollX(0.1, 0.01)
  .mult(pattern())
  .out()

example_18

by Olivia Jack
https://ojack.github.io

osc(6, 0, 0.8)
  .color(1.14, 0.6,.80)
  .rotate(0.92, 0.3)
  .pixelate(20, 10)
  .mult(osc(40, 0.03).thresh(0.4).rotate(0, -0.02))
  .modulateRotate(osc(20, 0).thresh(0.3, 0.6), () => 0.1 + mouse.x * 0.002)
  .out(o0)

See also

https://note.mu/mizt/n/n5540821c2671

About

Export hydra-synth as Metal shader (WIP).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published