Intro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PGraphics tex; | |
PImage src; | |
float t; | |
float size = 1920/8; | |
float w = size*2; | |
float h = sqrt(3)*size; | |
float xstep = w*(3/4f); | |
float ystep = h; | |
int hexCountX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mutex> | |
#include <vlc/vlc.h> | |
#include <stb_image.h> | |
#include <nanogui/nanogui.h> | |
class VideoView: public nanogui::GLCanvas { | |
public: | |
nanogui::GLShader shader; | |
GLuint textureId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SHADER=$1 | |
SEC=$1 | |
COUNTER=0 | |
for i in `seq -w 0.01 .031 $SEC`; do | |
echo $i | |
`glslViewer $SHADER -s $i -o frame-$COUNTER.png` | |
let COUNTER=COUNTER+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample code showing how to create a modern OpenGL window and rendering context on Win32. | |
#include <windows.h> | |
#include <gl/gl.h> | |
#include <stdbool.h> | |
typedef HGLRC WINAPI wglCreateContextAttribsARB_type(HDC hdc, HGLRC hShareContext, | |
const int *attribList); | |
wglCreateContextAttribsARB_type *wglCreateContextAttribsARB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Sine(ctx) { | |
this.sampleRate = ctx.sampleRate; | |
this.processor = ctx.createScriptProcessor(512,0,1) | |
this.processor.connect(ctx.destination); | |
this.offset = 0; | |
} | |
Sine.prototype.play = function(freq) { | |
this.processor.onaudioprocess = function(e) { | |
var out = e.outputBuffer.getChannelData(0); |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);