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

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

View File

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

View File

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

View File

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

View File

@@ -7,6 +7,8 @@ varying vec2 v_texCoord0;
uniform vec2 textureSize0;
uniform sampler2D tex0;
uniform bool logPolar;
#ifndef OR_GL_FRAGCOLOR
out vec4 o_color;
#endif
@@ -16,8 +18,11 @@ out vec4 o_color;
void main() {
vec2 uv = v_texCoord0 - vec2(0.5);
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
vec4 result = texture(tex0, sourceUV);

View File

@@ -17,13 +17,14 @@ out vec4 o_color;
uniform int angleLevels;
uniform int radiusLevels;
uniform bool logPolar;
void main() {
vec2 uv = v_texCoord0 - origin;
vec2 uv = v_texCoord0;
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 * vec2(cos(arg), sin(arg)) + vec2(0.5);
vec2 sourceUV = (radius * sqrt(0.5) * vec2(cos(arg), sin(arg)) + vec2(0.5));
#ifndef OR_GL_TEXTURE2D
vec4 result = texture(tex0, sourceUV);