Skip to content

Instantly share code, notes, and snippets.

@ylegall
ylegall / ComplexShader.kt
Created February 6, 2024 04:14
openRNDR code for genuary 2024 day 30: meromorphic shader
import org.intellij.lang.annotations.Language
import org.openrndr.application
import org.openrndr.draw.ColorFormat
import org.openrndr.draw.ColorType
import org.openrndr.draw.bufferTexture
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.noise.simplex
import org.openrndr.ffmpeg.H264Profile
import org.openrndr.ffmpeg.ScreenRecorder
import org.openrndr.math.Vector2
@ylegall
ylegall / tetrahedron_roll.vex
Last active July 25, 2022 00:27
houdini vex: procedural tetrahedron roll about center point
float t = chf('time');
float seed = chf('seed');
int ti = int(6 * t) % 6; // integer time from 0-5
float tf = frac(6 * t); // fraction time
// some random easing and motion reshaping:
float start = lerp(0.0, 0.05, rand(seed + 5 * ti));
float stop = lerp(0.95, 1.0, rand(seed + 7 * ti));
float shape = lerp(0.5, 0.65, rand(seed + 11 * ti));
@ylegall
ylegall / PixelOffset.kt
Last active September 20, 2021 04:44
openRNDR slit scan example. each pixel can come from a different frame in the image sequence.
import org.openrndr.WindowMultisample
import org.openrndr.application
import org.openrndr.draw.ImageFileFormat
import org.openrndr.draw.arrayTexture
import org.openrndr.draw.loadImage
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.layer
import org.openrndr.extra.compositor.post
@ylegall
ylegall / blobs.py
Last active April 24, 2021 17:45
Blender Blobs
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix, kdtree
from math import sin, cos, tau, pi, sqrt, radians
frame_count = 0.0
frame_start = 1
total_frames = 100
@ylegall
ylegall / circle-inversion.py
Last active April 8, 2021 17:58
blocks transformed by circle inversion
import bpy
import bmesh
import random
from easing_functions import CubicEaseInOut, QuadEaseInOut
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, sqrt, radians
from utils.interpolation import *
from utils.math import *
from utils.color import *
@ylegall
ylegall / utils.py
Last active April 9, 2021 05:19
python graphics utilties
from mathutils import Vector, Matrix
def scale_matrix(x: float, y: float, z: float) -> Matrix:
matx = Matrix.Scale(x, 4, Vector((1, 0, 0)))
maty = Matrix.Scale(y, 4, Vector((0, 1, 0)))
matz = Matrix.Scale(z, 4, Vector((0, 0, 1)))
return matx @ maty @ matz
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians, sqrt
from utils.interpolation import *
from utils.math import *
from utils.color import *
frame_start = 1
@ylegall
ylegall / attractors.py
Created February 19, 2021 00:24
code for animating strange attractors in blender
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians
from utils.interpolation import *
from easing_functions import *
frame_start = 1
total_frames = 120
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, modf
from utils.interpolation import *
from utils.math import *
from utils.color import *
from easing_functions import QuadEaseOut
@ylegall
ylegall / Dots.kt
Last active April 2, 2021 01:29
code for morphing point portraits
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.ColorFormat
import org.openrndr.draw.colorBuffer
import org.openrndr.draw.loadImage
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.noise.poissonDiskSampling
import org.openrndr.extra.olive.oliveProgram
import org.openrndr.extras.easing.easeQuadIn
import org.openrndr.extras.easing.easeQuadInOut