Switch back to fun main()

This commit is contained in:
Edwin Jakobs
2021-08-30 17:18:54 +02:00
parent c5a95f8d17
commit 9a2f10f81d
187 changed files with 313 additions and 316 deletions

View File

@@ -2,7 +2,7 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.draw.loadImage import org.openrndr.draw.loadImage
suspend fun main() { fun main() {
application { application {
program { program {
val image16 = loadImage("demo-data/images/16-bit.png") val image16 = loadImage("demo-data/images/16-bit.png")

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
import org.openrndr.shape.contour import org.openrndr.shape.contour
suspend fun main() = application { fun main() = application {
program { program {
class A: Animatable() { class A: Animatable() {
var x = 0.0 var x = 0.0

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
import org.openrndr.shape.contour import org.openrndr.shape.contour
suspend fun main() = application { fun main() = application {
program { program {
val a = object { val a = object {
var x = 0.0 var x = 0.0

View File

@@ -1,7 +1,7 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.internal.colorBufferLoader import org.openrndr.internal.colorBufferLoader
suspend fun main() { fun main() {
application { application {
program { program {
extend { extend {

View File

@@ -10,7 +10,7 @@ import org.openrndr.math.Vector2
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
suspend fun main() = application { fun main() = application {
configure { configure {
multisample = WindowMultisample.SampleCount(8) multisample = WindowMultisample.SampleCount(8)

View File

@@ -2,15 +2,15 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
import org.openrndr.math.CatmulRomChain2 import org.openrndr.math.CatmullRomChain2
import org.openrndr.math.Polar import org.openrndr.math.Polar
import org.openrndr.shape.ShapeContour import org.openrndr.shape.ShapeContour
import org.openrndr.shape.toContour import org.openrndr.shape.toContour
suspend fun main() = application { fun main() = application {
program { program {
val points = List(6) { Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center } val points = List(6) { Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center }
val cmr = CatmulRomChain2(points, 1.0, loop = true) val cmr = CatmullRomChain2(points, 1.0, loop = true)
val contour = ShapeContour.fromPoints(cmr.positions(200), true) val contour = ShapeContour.fromPoints(cmr.positions(200), true)
extend { extend {

View File

@@ -4,7 +4,7 @@ import org.openrndr.color.ColorRGBa
/* /*
This demo just verifies that drawing a single circle still works with revamped circle drawing code This demo just verifies that drawing a single circle still works with revamped circle drawing code
*/ */
suspend fun main() = application { fun main() = application {
program { program {
extend { extend {
drawer.clear(ColorRGBa.GRAY) drawer.clear(ColorRGBa.GRAY)

View File

@@ -11,7 +11,7 @@ Batches are (currently) static but stored in GPU memory but can be
animated using a vertex shader. Batches are fast to draw. animated using a vertex shader. Batches are fast to draw.
*/ */
suspend fun main() = application { fun main() = application {
program { program {
val batch = drawer.circleBatch { val batch = drawer.circleBatch {
for (i in 0 until 2000) { for (i in 0 until 2000) {

View File

@@ -8,7 +8,7 @@ import kotlin.math.abs
This program demonstrates dynamic circle batches This program demonstrates dynamic circle batches
*/ */
suspend fun main() = application { fun main() = application {
program { program {
extend { extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application { fun main() = application {
program { program {
val cb0 = loadImage("demo-data/images/image-001.png") val cb0 = loadImage("demo-data/images/image-001.png")
val cb1 = cb0.createEquivalent() val cb1 = cb0.createEquivalent()

View File

@@ -6,7 +6,7 @@ import org.openrndr.shape.drawComposition
import org.openrndr.svg.toSVG import org.openrndr.svg.toSVG
import org.openrndr.svg.writeSVG import org.openrndr.svg.writeSVG
suspend fun main() { fun main() {
application { application {
program { program {
extend { extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.shape.ClipMode import org.openrndr.shape.ClipMode
import org.openrndr.shape.drawComposition import org.openrndr.shape.drawComposition
suspend fun main() { fun main() {
application { application {
program { program {
val cd = drawComposition { val cd = drawComposition {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.shape.ClipMode import org.openrndr.shape.ClipMode
import org.openrndr.shape.drawComposition import org.openrndr.shape.drawComposition
suspend fun main() { fun main() {
application { application {
program { program {
val cd = drawComposition { val cd = drawComposition {

View File

@@ -7,7 +7,7 @@ import org.openrndr.shape.Circle
* *
* This was made to assist in resolving https://github.com/openrndr/openrndr/issues/164 * This was made to assist in resolving https://github.com/openrndr/openrndr/issues/164
*/ */
suspend fun main() = application { fun main() = application {
program { program {
val c = Circle(200.0, 200.0, 10.0).contour val c = Circle(200.0, 200.0, 10.0).contour
extend { extend {

View File

@@ -18,7 +18,7 @@ fun arc(start: Vector2, end: Vector2, radius: Double): ShapeContour {
} }
} }
suspend fun main() = application { fun main() = application {
configure { configure {
width = 800 width = 800
height = 800 height = 800

View File

@@ -4,7 +4,7 @@ import org.openrndr.draw.isolated
import org.openrndr.shape.Circle import org.openrndr.shape.Circle
import org.openrndr.shape.Rectangle import org.openrndr.shape.Rectangle
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 720 width = 720

View File

@@ -5,7 +5,7 @@ import org.openrndr.shape.Circle
import org.openrndr.shape.Rectangle import org.openrndr.shape.Rectangle
import org.openrndr.shape.intersections import org.openrndr.shape.intersections
suspend fun main() { fun main() {
application { application {
program { program {
extend { extend {

View File

@@ -8,7 +8,7 @@ import kotlin.math.PI
import kotlin.math.cos import kotlin.math.cos
import kotlin.math.sin import kotlin.math.sin
suspend fun main() = application { fun main() = application {
program { program {
val points = 200 val points = 200
extend { extend {

View File

@@ -6,7 +6,7 @@ import org.openrndr.draw.shadeStyle
import org.openrndr.extras.camera.Orbital import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application { fun main() = application {
program { program {
val cubemap = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cubemap = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application { fun main() = application {
program { program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh() val cube = boxMesh()

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application { fun main() = application {
program { program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh() val cube = boxMesh()

View File

@@ -1,7 +1,7 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.draw.loadImage import org.openrndr.draw.loadImage
suspend fun main() { fun main() {
application { application {
program { program {
val image = loadImage("demo-data/images/image-001.dds") val image = loadImage("demo-data/images/image-001.dds")

View File

@@ -7,7 +7,7 @@ import org.openrndr.extras.meshgenerators.boxMesh
import org.openrndr.resourceText import org.openrndr.resourceText
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
suspend fun main() { fun main() {
application { application {
program { program {
val vb = boxMesh() val vb = boxMesh()

View File

@@ -6,7 +6,7 @@ import org.openrndr.internal.Driver
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
suspend fun main() = application { fun main() = application {
program { program {
val shader = Shader.createFromCode(vsCode = val shader = Shader.createFromCode(vsCode =

View File

@@ -6,7 +6,7 @@ import org.openrndr.internal.Driver
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
suspend fun main() = application { fun main() = application {
program { program {
val cb = colorBuffer(128, 128) val cb = colorBuffer(128, 128)
extend { extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.draw.* import org.openrndr.draw.*
suspend fun main() = application { fun main() = application {
program { program {
val cb = colorBuffer(128, 128) val cb = colorBuffer(128, 128)
val at = arrayTexture(128, 128, 32) val at = arrayTexture(128, 128, 32)

View File

@@ -13,7 +13,7 @@ import org.openrndr.shape.Triangle
* a 3x3 grid of triangles and lines. * a 3x3 grid of triangles and lines.
*/ */
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 720 width = 720

View File

@@ -4,7 +4,7 @@ import org.openrndr.draw.shadeStyle
import org.openrndr.extensions.Screenshots import org.openrndr.extensions.Screenshots
import org.openrndr.math.Polar import org.openrndr.math.Polar
import org.openrndr.shape.contour import org.openrndr.shape.contour
suspend fun main() = application { fun main() = application {
program { program {
val style = shadeStyle { val style = shadeStyle {
//fragmentTransform = "x_stroke.a *= step(0.5, fract(c_contourPosition / p_dashLen));" //fragmentTransform = "x_stroke.a *= step(0.5, fract(c_contourPosition / p_dashLen));"

View File

@@ -1,7 +1,7 @@
import org.openrndr.CursorType import org.openrndr.CursorType
import org.openrndr.application import org.openrndr.application
suspend fun main() { fun main() {
application { application {
program { program {
keyboard.character.listen { keyboard.character.listen {

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
import org.openrndr.draw.pointBatch import org.openrndr.draw.pointBatch
suspend fun main() = application { fun main() = application {
program { program {
val storedBatch = drawer.pointBatch { val storedBatch = drawer.pointBatch {
for (y in 10 until height step 20) { for (y in 10 until height step 20) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.meshgenerators.boxMesh
import org.openrndr.ffmpeg.VideoPlayerFFMPEG import org.openrndr.ffmpeg.VideoPlayerFFMPEG
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
suspend fun main() { fun main() {
application { application {
program { program {
val cube = boxMesh() val cube = boxMesh()

View File

@@ -5,7 +5,7 @@ import org.openrndr.math.Vector3
import org.openrndr.resourceText import org.openrndr.resourceText
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
suspend fun main() { fun main() {
application { application {
program { program {
val vb = vertexBuffer(vertexFormat { val vb = vertexBuffer(vertexFormat {

View File

@@ -8,7 +8,7 @@ import org.openrndr.resourceText
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import org.openrndr.shape.Ellipse import org.openrndr.shape.Ellipse
suspend fun main() { fun main() {
application { application {
program { program {
val ellipse = Ellipse(width/2.0, height/2.0, 100.0, 300.0).contour val ellipse = Ellipse(width/2.0, height/2.0, 100.0, 300.0).contour

View File

@@ -8,7 +8,7 @@ import org.openrndr.resourceText
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import org.openrndr.shape.Ellipse import org.openrndr.shape.Ellipse
suspend fun main() { fun main() {
application { application {
program { program {

View File

@@ -14,7 +14,7 @@ import org.openrndr.shape.path3D
import org.openrndr.extra.shaderphrases.preprocessedFromUrls import org.openrndr.extra.shaderphrases.preprocessedFromUrls
import kotlin.math.cos import kotlin.math.cos
suspend fun main() { fun main() {
application { application {
program { program {
extend(Orbital()) extend(Orbital())

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.draw.* import org.openrndr.draw.*
import org.openrndr.extensions.Screenshots import org.openrndr.extensions.Screenshots
suspend fun main() = application { fun main() = application {
program { program {
val volumeTexture = VolumeTexture.create(128,128,32) val volumeTexture = VolumeTexture.create(128,128,32)
val rt = renderTarget(128, 128) { val rt = renderTarget(128, 128) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.noise.Random
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
import org.openrndr.shape.Rectangle import org.openrndr.shape.Rectangle
suspend fun main() = application { fun main() = application {
program { program {
val margin = 5.0 val margin = 5.0
val squareSize = 100.0 val squareSize = 100.0

View File

@@ -3,7 +3,7 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
suspend fun main() = application { fun main() = application {
program { program {
extend { extend {
drawer.clear(ColorRGBa.GRAY) drawer.clear(ColorRGBa.GRAY)

View File

@@ -3,7 +3,7 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
import org.openrndr.draw.rectangleBatch import org.openrndr.draw.rectangleBatch
suspend fun main() = application { fun main() = application {
program { program {
val batch = drawer.rectangleBatch { val batch = drawer.rectangleBatch {
fill = ColorRGBa.PINK fill = ColorRGBa.PINK

View File

@@ -3,7 +3,7 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
suspend fun main() = application { fun main() = application {
program { program {
extend { extend {
drawer.clear(ColorRGBa.GRAY) drawer.clear(ColorRGBa.GRAY)

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.meshgenerators.sphereMesh
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
import kotlin.math.cos import kotlin.math.cos
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 800 width = 800

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.meshgenerators.sphereMesh
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
import kotlin.math.cos import kotlin.math.cos
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 800 width = 800

View File

@@ -10,7 +10,7 @@ import org.openrndr.math.Vector2
import org.openrndr.math.map import org.openrndr.math.map
import org.openrndr.shape.Rectangle import org.openrndr.shape.Rectangle
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -9,7 +9,7 @@ import org.openrndr.extras.color.palettes.rangeTo
import org.openrndr.extras.color.presets.CORAL import org.openrndr.extras.color.presets.CORAL
import org.openrndr.extras.color.spaces.toHSLUVa import org.openrndr.extras.color.spaces.toHSLUVa
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.color.spaces.toOKLABa
import org.openrndr.extras.color.spaces.toOKLCHa import org.openrndr.extras.color.spaces.toOKLCHa
import org.openrndr.extras.color.spaces.toXSLUVa import org.openrndr.extras.color.spaces.toXSLUVa
suspend fun main() { fun main() {
application { application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only

View File

@@ -13,7 +13,7 @@ import org.openrndr.extras.color.spaces.toXSLUVa
import org.openrndr.extras.meshgenerators.sphereMesh import org.openrndr.extras.meshgenerators.sphereMesh
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 800 width = 800

View File

@@ -11,7 +11,7 @@ import org.openrndr.extras.color.spaces.ColorHSLUVa
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
import org.openrndr.shape.Rectangle import org.openrndr.shape.Rectangle
suspend fun main() { fun main() {
application { application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only

View File

@@ -8,7 +8,7 @@ import org.openrndr.math.Polar
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
import kotlin.math.sqrt import kotlin.math.sqrt
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 720 width = 720

View File

@@ -5,7 +5,7 @@ import org.openrndr.draw.loadImage
import org.openrndr.extensions.SingleScreenshot import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extras.color.statistics.calculateHistogramRGB import org.openrndr.extras.color.statistics.calculateHistogramRGB
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -6,7 +6,7 @@ import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extras.color.statistics.calculateHistogramRGB import org.openrndr.extras.color.statistics.calculateHistogramRGB
import kotlin.math.pow import kotlin.math.pow
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -5,7 +5,7 @@ import org.openrndr.draw.loadImage
import org.openrndr.extensions.SingleScreenshot import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extras.color.statistics.calculateHistogramRGB import org.openrndr.extras.color.statistics.calculateHistogramRGB
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.color.spaces.toHSLUVa
import org.openrndr.math.Polar import org.openrndr.math.Polar
import org.openrndr.shape.contour import org.openrndr.shape.contour
suspend fun main() { fun main() {
class Arc(val start: Double, val radius: Double, val length: Double, val height: Double) { class Arc(val start: Double, val radius: Double, val length: Double, val height: Double) {
fun split(offset: Double = 0.0): List<Arc> { fun split(offset: Double = 0.0): List<Arc> {
val hl = length / 2.0 val hl = length / 2.0

View File

@@ -1,9 +1,6 @@
import Orx_embed_shaders_gradle.EmbedShadersTask
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
kotlin("plugin.serialization") kotlin("plugin.serialization")
id("orx.embed-shaders")
} }
val kotlinxSerializationVersion: String by rootProject.extra val kotlinxSerializationVersion: String by rootProject.extra

View File

@@ -16,7 +16,7 @@ import kotlin.random.Random
* with a different amount of blur in each layer, * with a different amount of blur in each layer,
* simulating depth of field * simulating depth of field
*/ */
suspend fun main() = application { fun main() = application {
configure { configure {
width = 900 width = 900
height = 900 height = 900

View File

@@ -29,7 +29,7 @@ import kotlin.random.Random
// Toggle to see the difference between a simple blur and multilayer bloom // Toggle to see the difference between a simple blur and multilayer bloom
const val effectEnabled = true const val effectEnabled = true
suspend fun main() = application { fun main() = application {
configure { configure {
width = 900 width = 900
height = 900 height = 900

View File

@@ -4,7 +4,7 @@ import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extras.easing.* import org.openrndr.extras.easing.*
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -59,7 +59,6 @@ kotlin {
sourceSets { sourceSets {
val shaderKotlin by creating { val shaderKotlin by creating {
//this.kotlin.srcDir("$projectDir/build/generated/shaderKotlin")
this.kotlin.srcDir(embedShaders.outputDir) this.kotlin.srcDir(embedShaders.outputDir)
} }
@Suppress("UNUSED_VARIABLE") @Suppress("UNUSED_VARIABLE")

View File

@@ -1,9 +1,9 @@
package org.openrndr.extra.fx.demo package org.openrndr.extra.fx.demo
import org.openrndr.applicationSynchronous import org.openrndr.application
import org.openrndr.extra.fx.blend.* import org.openrndr.extra.fx.blend.*
fun main() { fun main() {
applicationSynchronous { application {
program { program {
val add = Add() val add = Add()
val colorBurn = ColorBurn() val colorBurn = ColorBurn()

View File

@@ -6,7 +6,7 @@ import org.openrndr.extra.fx.blur.*
import org.openrndr.math.Polar import org.openrndr.math.Polar
import kotlin.math.sin import kotlin.math.sin
suspend fun main() { fun main() {
application { application {
program { program {

View File

@@ -5,7 +5,7 @@ import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.fx.distort.FluidDistort import org.openrndr.extra.fx.distort.FluidDistort
import org.openrndr.extra.fx.patterns.Checkers import org.openrndr.extra.fx.patterns.Checkers
suspend fun main() { fun main() {
application { application {
program { program {
val fd = FluidDistort() val fd = FluidDistort()

View File

@@ -13,7 +13,7 @@
//import org.openrndr.math.Vector2 //import org.openrndr.math.Vector2
//import kotlin.math.absoluteValue //import kotlin.math.absoluteValue
// //
//suspend fun main() = application { //fun main() = application {
// configure { // configure {
// width = 1280 // width = 1280
// height = 720 // height = 720

View File

@@ -7,6 +7,8 @@ varying vec2 v_texCoord0;
uniform vec2 textureSize0; uniform vec2 textureSize0;
uniform sampler2D tex0; uniform sampler2D tex0;
uniform bool logPolar;
#ifndef OR_GL_FRAGCOLOR #ifndef OR_GL_FRAGCOLOR
out vec4 o_color; out vec4 o_color;
#endif #endif
@@ -16,8 +18,11 @@ out vec4 o_color;
void main() { void main() {
vec2 uv = v_texCoord0 - vec2(0.5); vec2 uv = v_texCoord0 - vec2(0.5);
float arg = atan(uv.y, uv.x); float arg = atan(uv.y, uv.x);
float radius = length(uv);
vec2 sourceUV = vec2(arg / (2*PI) + 0.5, radius/sqrt(0.5)); float bias = 0.0;
float radius = logPolar? log(1.0 + length(uv)*(exp(1.0)-bias)) / log(1.0+(exp(1.0)-bias)*sqrt(0.5)) : (length(uv) / sqrt(0.5));
vec2 sourceUV = vec2(arg / (2*PI) + 0.5, radius);
#ifndef OR_GL_TEXTURE2D #ifndef OR_GL_TEXTURE2D
vec4 result = texture(tex0, sourceUV); vec4 result = texture(tex0, sourceUV);

View File

@@ -17,13 +17,14 @@ out vec4 o_color;
uniform int angleLevels; uniform int angleLevels;
uniform int radiusLevels; uniform int radiusLevels;
uniform bool logPolar;
void main() { void main() {
vec2 uv = v_texCoord0 - origin; vec2 uv = v_texCoord0;
float arg = (uv.x-0.5) * 2 * PI; float arg = (uv.x-0.5) * 2 * PI;
float radius = (uv.y) * sqrt(0.5); float radius = logPolar? (((exp(uv.y)-1.0) / (exp(1.0)-1.0))) : uv.y;
vec2 sourceUV = (radius * sqrt(0.5) * vec2(cos(arg), sin(arg)) + vec2(0.5));
vec2 sourceUV = radius * vec2(cos(arg), sin(arg)) + vec2(0.5);
#ifndef OR_GL_TEXTURE2D #ifndef OR_GL_TEXTURE2D
vec4 result = texture(tex0, sourceUV); vec4 result = texture(tex0, sourceUV);

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.compositor.post
import org.openrndr.extra.fx.patterns.Checkers import org.openrndr.extra.fx.patterns.Checkers
import org.openrndr.extra.jumpfill.fx.InnerGlow import org.openrndr.extra.jumpfill.fx.InnerGlow
suspend fun main() = application { fun main() = application {
program { program {
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) { extend(SingleScreenshot()) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.compositor.post
import org.openrndr.extra.fx.patterns.Checkers import org.openrndr.extra.fx.patterns.Checkers
import org.openrndr.extra.jumpfill.fx.InnerGlow import org.openrndr.extra.jumpfill.fx.InnerGlow
suspend fun main() = application { fun main() = application {
program { program {
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) { extend(SingleScreenshot()) {

View File

@@ -9,7 +9,7 @@ import org.openrndr.math.transforms.transform
import org.openrndr.shape.Circle import org.openrndr.shape.Circle
import org.openrndr.svg.loadSVG import org.openrndr.svg.loadSVG
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -12,7 +12,7 @@ import org.openrndr.math.transforms.transform
import org.openrndr.svg.loadSVG import org.openrndr.svg.loadSVG
import kotlin.math.min import kotlin.math.min
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -11,7 +11,7 @@ import org.openrndr.extra.jumpfill.ops.*
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
import org.openrndr.svg.loadSVG import org.openrndr.svg.loadSVG
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -13,7 +13,7 @@ import org.openrndr.math.transforms.transform
import org.openrndr.shape.Circle import org.openrndr.shape.Circle
import org.openrndr.svg.loadSVG import org.openrndr.svg.loadSVG
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -17,7 +17,7 @@ import org.openrndr.svg.loadSVG
import kotlin.math.cos import kotlin.math.cos
import kotlin.math.sin import kotlin.math.sin
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -9,7 +9,7 @@ import org.openrndr.extra.jumpfill.fx.Skeleton
import org.openrndr.extra.jumpfill.fx.StraightSkeleton import org.openrndr.extra.jumpfill.fx.StraightSkeleton
import org.openrndr.extra.noise.simplex import org.openrndr.extra.noise.simplex
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -8,7 +8,7 @@ import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.jumpfill.fx.StraightSkeleton import org.openrndr.extra.jumpfill.fx.StraightSkeleton
import org.openrndr.extra.noise.simplex import org.openrndr.extra.noise.simplex
suspend fun main() { fun main() {
application { application {
configure { configure {
width = 1280 width = 1280

View File

@@ -13,7 +13,7 @@ import org.openrndr.extensions.SingleScreenshot
import kotlin.math.cos import kotlin.math.cos
import kotlin.math.sin import kotlin.math.sin
suspend fun main() { fun main() {
application { application {
program { program {

View File

@@ -5,7 +5,7 @@ import org.openrndr.draw.loadImage
import org.openrndr.extensions.SingleScreenshot import org.openrndr.extensions.SingleScreenshot
suspend fun main() { fun main() {
application { application {
program { program {
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -5,7 +5,7 @@ import org.openrndr.draw.loadImage
import org.openrndr.extensions.SingleScreenshot import org.openrndr.extensions.SingleScreenshot
suspend fun main() { fun main() {
application { application {
program { program {
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -18,7 +18,7 @@ import org.openrndr.shape.ShapeContour
import org.openrndr.shape.simplify import org.openrndr.shape.simplify
import org.openrndr.shape.toContour import org.openrndr.shape.toContour
suspend fun main() { fun main() {
application { application {
program { program {

View File

@@ -2,7 +2,7 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa import org.openrndr.color.ColorRGBa
import org.openrndr.extra.osc.OSC import org.openrndr.extra.osc.OSC
suspend fun main() = application { fun main() = application {
configure { configure {
width = 500 width = 500

View File

@@ -11,7 +11,7 @@ import org.openrndr.math.mod_
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.dnk3.renderers.dryRenderer
import org.openrndr.math.* import org.openrndr.math.*
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -10,7 +10,7 @@ import org.openrndr.extras.meshgenerators.groundPlaneMesh
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -11,7 +11,7 @@ import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
import org.openrndr.shape.path3D import org.openrndr.shape.path3D
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -29,7 +29,7 @@ import java.io.File
import kotlin.math.cos import kotlin.math.cos
import kotlin.math.sin import kotlin.math.sin
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -9,7 +9,7 @@ import org.openrndr.extras.camera.Orbital
import org.openrndr.math.* import org.openrndr.math.*
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -9,7 +9,7 @@ import org.openrndr.extras.camera.Orbital
import org.openrndr.math.* import org.openrndr.math.*
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -9,7 +9,7 @@ import org.openrndr.extras.camera.Orbital
import org.openrndr.math.* import org.openrndr.math.*
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -7,7 +7,7 @@ import org.openrndr.extras.camera.Orbital
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
program { program {
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) { extend(SingleScreenshot()) {

View File

@@ -10,7 +10,7 @@ import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -11,7 +11,7 @@ import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -10,7 +10,7 @@ import org.openrndr.extras.meshgenerators.sphereMesh
import org.openrndr.math.Vector3 import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform import org.openrndr.math.transforms.transform
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -11,7 +11,7 @@ import org.openrndr.math.Vector3
import org.openrndr.math.mod_ import org.openrndr.math.mod_
import java.io.File import java.io.File
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -18,7 +18,7 @@ import java.io.File
import kotlin.math.cos import kotlin.math.cos
import kotlin.math.sin import kotlin.math.sin
suspend fun main() = application { fun main() = application {
configure { configure {
width = 1280 width = 1280
height = 720 height = 720

View File

@@ -9,7 +9,7 @@ import org.openrndr.shape.Circle
/** /**
* A simple demonstration of a GUI for drawing some circles * A simple demonstration of a GUI for drawing some circles
*/ */
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -14,7 +14,7 @@ enum class BackgroundColors {
Yellow Yellow
} }
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -11,7 +11,7 @@ import org.openrndr.extra.parameters.*
* [Left Shift] + [0]..[9] => store current gui values to a preset * [Left Shift] + [0]..[9] => store current gui values to a preset
* [0]..[9] => recall a preset * [0]..[9] => recall a preset
*/ */
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -9,7 +9,7 @@ import org.openrndr.shape.Circle
/** /**
* A simple demonstration of a GUI for drawing some circles * A simple demonstration of a GUI for drawing some circles
*/ */
suspend fun main() = application { fun main() = application {
program { program {
// -- this block is for automation purposes only // -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") { if (System.getProperty("takeScreenshot") == "true") {

View File

@@ -5,7 +5,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.XYParameter import org.openrndr.extra.parameters.XYParameter
import org.openrndr.math.Vector2 import org.openrndr.math.Vector2
suspend fun main() = application { fun main() = application {
configure { configure {
width = 800 width = 800
height = 800 height = 800

View File

@@ -4,7 +4,7 @@ import org.openrndr.extra.keyframer.Keyframer
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import java.net.URL import java.net.URL
suspend fun main() = application { fun main() = application {
program { program {
class Animation: Keyframer() { class Animation: Keyframer() {
val position by Vector2Channel(arrayOf("x", "y")) val position by Vector2Channel(arrayOf("x", "y"))

View File

@@ -5,7 +5,7 @@ import org.openrndr.extra.keyframer.KeyframerFormat
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import java.net.URL import java.net.URL
suspend fun main() = application { fun main() = application {
program { program {
class Animation: Keyframer() { class Animation: Keyframer() {
val position by Vector2Channel(arrayOf("x", "y")) val position by Vector2Channel(arrayOf("x", "y"))

View File

@@ -8,7 +8,7 @@ import org.openrndr.panel.elements.slider
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import java.net.URL import java.net.URL
suspend fun main() = application { fun main() = application {
program { program {
// -- replace the default clock with an offset clock // -- replace the default clock with an offset clock

View File

@@ -4,7 +4,7 @@ import org.openrndr.extra.keyframer.Keyframer
import org.openrndr.resourceUrl import org.openrndr.resourceUrl
import java.net.URL import java.net.URL
suspend fun main() = application { fun main() = application {
program { program {
class Animation: Keyframer() { class Animation: Keyframer() {
val position by Vector2Channel(arrayOf("x", "y")) val position by Vector2Channel(arrayOf("x", "y"))

Some files were not shown because too many files have changed in this diff Show More