Skip to content

Instantly share code, notes, and snippets.

package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.BlendMode
import org.openrndr.draw.CircleBatchBuilder
import org.openrndr.draw.circleBatch
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.post
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.mix
import org.openrndr.color.rgb
import org.openrndr.draw.LineCap
import org.openrndr.draw.LineJoin
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
package org.ygl.openrndr.demos
import org.openrndr.Application
import org.openrndr.application
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.post
import org.openrndr.extra.fx.blur.ZoomBlur
import org.openrndr.ffmpeg.ScreenRecorder
@ylegall
ylegall / SpiralLoop.kt
Created August 25, 2020 17:00
looping spiral animation in openRNDR
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.rgb
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.ffmpeg.ScreenRecorder
@ylegall
ylegall / CandyTunnel.kt
Created August 23, 2020 15:32
openRNDR code for orbiting inside colorful torus
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.VertexElementType
import org.openrndr.draw.shadeStyle
import org.openrndr.draw.vertexBuffer
import org.openrndr.draw.vertexFormat
import org.openrndr.extra.compositor.blend
import org.openrndr.extra.compositor.compose
@ylegall
ylegall / TriangleSpiral.kt
Created August 21, 2020 15:39
triangle spiral
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.rgb
import org.openrndr.draw.LineCap
import org.openrndr.draw.LineJoin
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.post
@ylegall
ylegall / distortion.kt
Last active August 15, 2020 23:25
openRNDR demo for doing an inversion distortion effect
import org.openrndr.application
import org.openrndr.draw.isolatedWithTarget
import org.openrndr.draw.renderTarget
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.ffmpeg.ScreenRecorder
// shader-based inversion distortion effect
@ylegall
ylegall / Orbit.kt
Last active August 12, 2020 04:55
openRNDR blackhole sketch
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.mix
import org.openrndr.draw.LineCap
import org.openrndr.draw.LineJoin
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.post
@ylegall
ylegall / DepthOfField.kt
Last active May 8, 2020 21:27
demo of depth of field blur using OpenRNDR
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.BlendMode
import org.openrndr.draw.ColorType
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.VertexElementType
import org.openrndr.draw.isolatedWithTarget
import org.openrndr.draw.renderTarget
@ylegall
ylegall / QuickSelect.kt
Last active February 16, 2020 18:35
quick-select algorithm to find top K numbers in an unsorted list
private fun MutableList<Int>.swap(a: Int, b: Int) {
val tmp = this[a]
this[a] = this[b]
this[b] = tmp
}
/**
* partitions the list between low and high and returns the size
* of the partition.