# Genuary2024_Shaders

# ShaderMash

**Genuary2024 Prompt 30: Shaderpark** was used as the basis for this sketch alongside **SonicPI** to showcase how a mash of shader shapes can interact with each other

## Poem

```ocaml
Shaders Mashing and Rolling
Roaming and stashing
As they play alongside the coding
Across the Screen, they can be seen Dashing
```

## Video

<iframe width="560" height="315" src="https://www.youtube.com/embed/gOi5519kWEQ?si=g2t07Ek_-d5Vuzev"></iframe>

## Code

### ShaderPark

```javascript
color(0.1, 1.0, 0.1);

rotateY(sin(time) + 1);
torus(0.3, 0.08,1);

color(0.5,0.61,0.81);
displace(0.2, sin(time), 0.2);
sphere(0.3 + sin(time/2))
displace(0.2,0.2,0.2);

rotateZ((time));
rotateX(tan(time) + 1);
color(1.0,0.1,0.1);
torus(0.1,0.3,0.08);


color(0.5,0.1,0.6);
mirrorX(sin(time));
displace(0.2, cos(time), 0.2);
mirrorZ(cos(time));
displace(sin(time), 0.2, 0.2);
rotateX(time/2);
rotateZ(cos(time));
rotateY(sin(time) + 1);
torus(0.3, sin(time),1);
```

### SonicPi

```ruby
#blips takeover

with_fx :reverb do
  live_loop :blips do
    use_bpm 120
    sample :elec_blip, pan: rrand(-0.9,0.9), rate: rrand(-1.5, 1.5)
    sleep [0.5,1,2].choose
  end
end

with_fx :ixi_techno do
  live_loop :blips1, sync: :blips do
    use_bpm 60
    sample :elec_blip, pitch: 4, pitch_stretch: 0.4, rate: rrand(-2.5, 2.5)
    sleep [0.5,1,2].choose
  end
end

with_fx :echo do
  live_loop :blips2, sync: :blips do
    use_bpm 120
    sample :elec_blip,amp: dice(5), rate: rrand(0,4)
    sleep [0.5,1,2].choose
  end
end
```
