- Build a sphere tracer with WebGPU (paper, paper2, youtube)
- Create model with sdf functions from here
- Add light and shadows
- ???
- PROFIT
This code tested in Chrome and Firefox, should work on PC too. Press star and subscribe.
| # MIDI to CV converter for Raspberry Pi Pico and MCP4725 DAC by @AxWax | |
| # | |
| # Demo: https://www.youtube.com/watch?v=aGfQHL1jU4I | |
| # | |
| # This is heavily based on and requires | |
| # the SimpleMIDIDecoder library by @diyelectromusic, which can be found at | |
| # https://diyelectromusic.wordpress.com/2021/06/13/raspberry-pi-pico-midi-channel-router/ | |
| # | |
| # | |
| # Wiring: |
| #include "hardware/pwm.h" | |
| #include "hardware/clocks.h" | |
| #include "hardware/irq.h" | |
| #include "pico/binary_info.h" | |
| #include "pico/cyw43_arch.h" | |
| #include "pico/stdlib.h" | |
| #include "sonovolt/time.h" | |
| #define LED_PIN 15 | |
| #define PWM_PIN LED_PIN |
| function video_to_gif { | |
| local input_video_path="$1" | |
| local output_gif_path="$2" | |
| local fps="${3:-10}" | |
| local scale="${4:-1080}" | |
| local loop="${5:-0}" | |
| ffmpeg -i "${input_video_path}" -vf "setpts=PTS/1,fps=${fps},scale=${scale}:-2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop $loop "${output_gif_path}" | |
| } |
| package org.ygl.openrndr.demos | |
| import org.openrndr.application | |
| import org.openrndr.color.ColorRGBa | |
| import org.openrndr.draw.BufferMultisample | |
| import org.openrndr.draw.DrawPrimitive | |
| import org.openrndr.draw.colorBuffer | |
| import org.openrndr.draw.renderTarget | |
| import org.openrndr.draw.shadeStyle | |
| import org.openrndr.draw.vertexBuffer |
| import org.openrndr.application | |
| import org.openrndr.color.ColorRGBa | |
| import org.openrndr.color.mix | |
| import org.openrndr.color.rgb | |
| import org.openrndr.draw.isolatedWithTarget | |
| import org.openrndr.draw.renderTarget | |
| import org.openrndr.extra.compositor.compose | |
| import org.openrndr.extra.compositor.draw | |
| import org.openrndr.extra.compositor.post |
| <script> | |
| export let text = null; | |
| let showText = false; | |
| setTimeout(() => (showText = true), 1000); | |
| </script> | |
| {#if text && showText} | |
| <p> | |
| {text} |
| { | |
| "export_version": "0.079", | |
| "framed_nodes": {}, | |
| "groups": {}, | |
| "nodes": { | |
| "A Number": { | |
| "bl_idname": "SvNumberNode", | |
| "height": 100.0, | |
| "hide": false, | |
| "label": "Surface Res", |
| #include "FFT.h" | |
| void fft(int *x_in, | |
| std::complex<double> *x_out, | |
| int N) { | |
| // Make copy of array and apply window | |
| for (int i = 0; i < N; i++) { | |
| x_out[i] = std::complex<double>(x_in[i], 0); | |
| x_out[i] *= 1; // Window |