Skip to content

Instantly share code, notes, and snippets.

View technologyarts's full-sized avatar

technologyarts

View GitHub Profile
@technologyarts
technologyarts / index.html
Created February 8, 2022 16:54 — forked from micahscopes/index.html
A/V hybrid synth (routes pixels from a WebGL to WebAudio)
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>reaction diffusion space ship (a/v synth)</title>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aPos;
attribute vec2 aTexCoord;
varying vec2 pixel;
void main(void) {
gl_Position = vec4(aPos, 1.);

Ray marching, glslify, and signed-distance functions

Show examples

  • ray marched bug
  • First basic red sphere
  • Final repeated, warped sphere

How does ray marching work?

  • for every pixel, start a ray from an origin, through the camera view plane, until it hits something
  • draw?