Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
; creating the "plasma" image buffer
(import (scheme inexact))
(define plasma
(fold append #null
(map (lambda (y)
(map (lambda (x)
(let ((value (/
(+ (sin (/ y 4))
(sin (/ (+ x y) 8))
(sin (/ (sqrt (+ (* x x) (* y y))) 8))
4) 8)))
value))
(iota 256)))
(iota 256))))

View file

@ -0,0 +1,25 @@
; rendering the prepared buffer (using OpenGL)
(import (lib gl1))
(gl:set-window-size 256 256)
(glBindTexture GL_TEXTURE_2D 0)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR)
(glTexImage2D GL_TEXTURE_2D 0 GL_LUMINANCE
256 256
0 GL_LUMINANCE GL_FLOAT (cons (fft* fft-float) plasma))
(glEnable GL_TEXTURE_2D)
(gl:set-renderer (lambda (_)
(glClear GL_COLOR_BUFFER_BIT)
(glBegin GL_QUADS)
(glTexCoord2f 0 0)
(glVertex2f -1 -1)
(glTexCoord2f 0 1)
(glVertex2f -1 1)
(glTexCoord2f 1 1)
(glVertex2f 1 1)
(glTexCoord2f 1 0)
(glVertex2f 1 -1)
(glEnd)))