From e3f5e07b867b9d6ecf9055acd2af8d30f257e444 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sun, 10 Mar 2024 18:39:21 +0100 Subject: [PATCH] Improve compatibility with GLES back-end --- .../src/main/kotlin/CollectScreenShots.kt | 4 +- .../extra/convention/kotlin-jvm.gradle.kts | 4 ++ .../kotlin-multiplatform.gradle.kts | 8 +++- gradlew | 17 ++++---- .../src/demo/kotlin/DemoCircleBatch02.kt | 4 +- .../src/demo/kotlin/DemoCubemap01.kt | 7 +-- .../src/demo/kotlin/DemoCubemap02.kt | 2 +- .../src/demo/kotlin/DemoCubemap03.kt | 2 +- .../src/commonMain/kotlin/phrases/Phrases.kt | 6 +-- .../src/jvmDemo/kotlin/DemoCompositor02.kt | 3 +- .../commonMain/kotlin/blend/BlendSpectral.kt | 8 ++-- .../src/commonMain/kotlin/distort/Lenses.kt | 2 +- orx-fx/src/jvmDemo/kotlin/DemoBlur01.kt | 1 - .../kotlin/DemoDitherLumaHalftone01.kt | 1 - .../src/jvmDemo/kotlin/DemoFluidDistort01.kt | 5 --- orx-fx/src/shaders/glsl/blend/add.frag | 6 +-- orx-fx/src/shaders/glsl/blend/hard-light.frag | 6 +-- orx-fx/src/shaders/glsl/blend/normal.frag | 6 +-- orx-fx/src/shaders/glsl/blend/overlay.frag | 2 +- orx-fx/src/shaders/glsl/blend/subtract.frag | 4 +- .../glsl/blur/approximate-gaussian-blur.frag | 2 +- .../shaders/glsl/blur/bloom-downscale.frag | 12 +++--- .../src/shaders/glsl/blur/bloom-upscale.frag | 40 +++++++++--------- .../src/shaders/glsl/blur/gaussian-blur.frag | 10 ++--- orx-fx/src/shaders/glsl/color/posterize.frag | 4 +- .../src/shaders/glsl/color/rgb-to-ycbcr.frag | 4 +- .../src/shaders/glsl/color/ycbcr-to-rgb.frag | 2 +- .../shaders/glsl/distort/displace-blend.frag | 2 +- .../shaders/glsl/distort/fluid-distort.frag | 8 ++-- orx-fx/src/shaders/glsl/distort/lenses.frag | 2 +- .../shaders/glsl/distort/stack-repeat.frag | 8 ++-- .../src/shaders/glsl/distort/tape-noise.frag | 18 ++++---- .../shaders/glsl/distort/video-glitch.frag | 10 ++--- orx-fx/src/shaders/glsl/dither/a-dither.frag | 18 ++++---- .../shaders/glsl/dither/cmyk-halftone.frag | 8 ++-- .../shaders/glsl/dither/luma-halftone.frag | 12 +++--- .../glsl/edges/canny-edge-detector.frag | 5 ++- orx-fx/src/shaders/glsl/edges/contour.frag | 4 +- orx-fx/src/shaders/glsl/edges/luma-sobel.frag | 4 +- .../src/shaders/glsl/patterns/checkers.frag | 2 +- .../shaders/glsl/shadow/dropshadow-blend.frag | 2 +- .../shaders/glsl/shadow/dropshadow-blur.frag | 6 +-- .../shaders/glsl/tonemap/aces-tonemap.frag | 4 +- .../glsl/tonemap/reinhard-tonemap.frag | 2 +- .../glsl/tonemap/uncharted2-tonemap.frag | 2 +- .../src/shaders/glsl/encode-subpixel.frag | 24 +++++------ .../src/shaders/glsl/pixel-direction.frag | 4 +- .../src/shaders/glsl/straight-skeleton.frag | 2 +- .../orx-dnk3/src/main/kotlin/PBRMaterial.kt | 6 +-- .../orx-dnk3/src/main/kotlin/SceneRenderer.kt | 2 +- .../src/main/kotlin/ShaderUtilities.kt | 4 +- orx-jvm/orx-dnk3/src/main/kotlin/Shadows.kt | 14 +++--- .../src/main/kotlin/gltf/GltfScene.kt | 2 +- .../shaders/screenspace-reflections.frag | 2 +- .../resources/shaders/segment-contours.frag | 6 +-- orx-jvm/orx-olive/images/DemoOlive01Kt.png | Bin 33331 -> 0 bytes .../src/demo/kotlin/DemoPoissonFill01.kt | 4 +- .../shaders/gl3/poisson/downscale.frag | 6 +-- .../shaders/gl3/poisson/fill-boundary.frag | 2 - .../shaders/gl3/poisson/fill-combine.frag | 2 - .../resources/shaders/gl3/poisson/filter.frag | 4 +- .../shaders/gl3/poisson/upscale.frag | 4 +- 62 files changed, 182 insertions(+), 195 deletions(-) delete mode 100644 orx-jvm/orx-olive/images/DemoOlive01Kt.png diff --git a/buildSrc/src/main/kotlin/CollectScreenShots.kt b/buildSrc/src/main/kotlin/CollectScreenShots.kt index 8b0a3a63e..fbdb1ad17 100644 --- a/buildSrc/src/main/kotlin/CollectScreenShots.kt +++ b/buildSrc/src/main/kotlin/CollectScreenShots.kt @@ -73,7 +73,9 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() { this.jvmArgs( "-DtakeScreenshot=true", "-DscreenshotPath=${outputDir.get().asFile}/$imageName.png", - "-Dorg.openrndr.exceptions=JVM" + "-Dorg.openrndr.exceptions=JVM", + "-Dorg.openrndr.gl3.debug=true", + "-Dorg.openrndr.gl3.delete_angle_on_exit=false" ) } } diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts index 22212f1cc..c951d34aa 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts @@ -49,6 +49,10 @@ dependencies { "demoImplementation"(main.output.classesDirs + main.runtimeClasspath) "demoImplementation"(libs.openrndr.application) "demoImplementation"(libs.openrndr.extensions) + + if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) { + "demoRuntimeOnly"(libs.openrndr.gl3.natives.macos.arm64) + } "demoRuntimeOnly"(libs.openrndr.gl3.core) "demoRuntimeOnly"(libs.slf4j.simple) } diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index a676ddce4..8076a777a 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -1,11 +1,10 @@ package org.openrndr.extra.convention import CollectScreenshotsTask -import gradle.kotlin.dsl.accessors._a37e1a3c5785f18372ed85a4dc9bbdf6.testRuntimeOnly import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.net.URI val libs = the() @@ -49,6 +48,11 @@ kotlin { outputDir.set(project.file(project.projectDir.toString() + "/images")) dependsOn(compileTaskProvider) } + dependencies { + if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) { + runtimeOnly(libs.openrndr.gl3.natives.macos.arm64) + } + } } } testRuns["test"].executionTask { diff --git a/gradlew b/gradlew index fcb6fca14..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/openrndr-demos/src/demo/kotlin/DemoCircleBatch02.kt b/openrndr-demos/src/demo/kotlin/DemoCircleBatch02.kt index b07a947ec..16771dc2b 100644 --- a/openrndr-demos/src/demo/kotlin/DemoCircleBatch02.kt +++ b/openrndr-demos/src/demo/kotlin/DemoCircleBatch02.kt @@ -29,8 +29,8 @@ fun main() = application { // sets angle and radius based on time and shape ID. drawer.shadeStyle = shadeStyle { vertexTransform = """ - float a = c_instance + p_time * 0.1; - float r = 200 + 100 * sin(a * 0.998); + float a = float(c_instance) + p_time * 0.1; + float r = 200.0 + 100.0 * sin(a * 0.998); x_position.x += r * sin(a); x_position.y += r * cos(a); """.trimIndent() diff --git a/openrndr-demos/src/demo/kotlin/DemoCubemap01.kt b/openrndr-demos/src/demo/kotlin/DemoCubemap01.kt index cf72e7f0d..fd052c05a 100644 --- a/openrndr-demos/src/demo/kotlin/DemoCubemap01.kt +++ b/openrndr-demos/src/demo/kotlin/DemoCubemap01.kt @@ -1,15 +1,12 @@ import org.openrndr.application -import org.openrndr.draw.Cubemap -import org.openrndr.draw.DrawPrimitive -import org.openrndr.draw.Session -import org.openrndr.draw.shadeStyle +import org.openrndr.draw.* import org.openrndr.extra.camera.Orbital import org.openrndr.extra.meshgenerators.boxMesh fun main() = application { program { - val cubemap = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) + val cubemap = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cube = boxMesh() extend(Orbital()) { diff --git a/openrndr-demos/src/demo/kotlin/DemoCubemap02.kt b/openrndr-demos/src/demo/kotlin/DemoCubemap02.kt index d91394008..f3cb0972f 100644 --- a/openrndr-demos/src/demo/kotlin/DemoCubemap02.kt +++ b/openrndr-demos/src/demo/kotlin/DemoCubemap02.kt @@ -5,7 +5,7 @@ import org.openrndr.extra.meshgenerators.boxMesh fun main() = application { program { - val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) + val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cube = boxMesh() val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active) cubemap1.copyTo(cubemap2, 0, 0) diff --git a/openrndr-demos/src/demo/kotlin/DemoCubemap03.kt b/openrndr-demos/src/demo/kotlin/DemoCubemap03.kt index 369d48979..8b0027c5d 100644 --- a/openrndr-demos/src/demo/kotlin/DemoCubemap03.kt +++ b/openrndr-demos/src/demo/kotlin/DemoCubemap03.kt @@ -5,7 +5,7 @@ import org.openrndr.extra.meshgenerators.boxMesh fun main() = application { program { - val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active) + val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active) val cube = boxMesh() val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active) cubemap1.copyTo(cubemap2, 0, 0) diff --git a/orx-color/src/commonMain/kotlin/phrases/Phrases.kt b/orx-color/src/commonMain/kotlin/phrases/Phrases.kt index 0a0d3354a..c8a94d670 100644 --- a/orx-color/src/commonMain/kotlin/phrases/Phrases.kt +++ b/orx-color/src/commonMain/kotlin/phrases/Phrases.kt @@ -61,9 +61,9 @@ object ColorPhraseBook : ShaderPhraseBook("color") { |vec4 linear_rgb_to_srgb(vec4 c) { | const float t = 0.00313066844250063; | return vec4( - | c.r <= t ? c.r * 12.92 : 1.055 * pow(c.r, 1 / 2.4) - 0.055, - | c.g <= t ? c.g * 12.92 : 1.055 * pow(c.g, 1 / 2.4) - 0.055, - | c.b <= t ? c.b * 12.92 : 1.055 * pow(c.b, 1 / 2.4) - 0.055, + | c.r <= t ? c.r * 12.92 : 1.055 * pow(c.r, 1.0 / 2.4) - 0.055, + | c.g <= t ? c.g * 12.92 : 1.055 * pow(c.g, 1.0 / 2.4) - 0.055, + | c.b <= t ? c.b * 12.92 : 1.055 * pow(c.b, 1.0 / 2.4) - 0.055, | c.a); |}""".trimMargin()) diff --git a/orx-compositor/src/jvmDemo/kotlin/DemoCompositor02.kt b/orx-compositor/src/jvmDemo/kotlin/DemoCompositor02.kt index ec152cebb..997995bf7 100644 --- a/orx-compositor/src/jvmDemo/kotlin/DemoCompositor02.kt +++ b/orx-compositor/src/jvmDemo/kotlin/DemoCompositor02.kt @@ -14,6 +14,7 @@ import org.openrndr.shape.Rectangle * Try changing which layer has multisampling applied and observe the results. */ fun main() = application { + System.setProperty("org.openrndr.gl3.debug", "true") configure { width = 800 height = 800 @@ -21,7 +22,7 @@ fun main() = application { program { val layers = compose { - layer(multisample = BufferMultisample.SampleCount(16)) { + layer(multisample = BufferMultisample.SampleCount(4)) { draw { drawer.translate(drawer.bounds.center) drawer.rotate(seconds) diff --git a/orx-fx/src/commonMain/kotlin/blend/BlendSpectral.kt b/orx-fx/src/commonMain/kotlin/blend/BlendSpectral.kt index b66fb0aa9..f89b39d1e 100644 --- a/orx-fx/src/commonMain/kotlin/blend/BlendSpectral.kt +++ b/orx-fx/src/commonMain/kotlin/blend/BlendSpectral.kt @@ -33,9 +33,9 @@ vec3 srgb_to_linear(vec3 c) { vec3 linear_to_srgb(vec3 c) { const float t = 0.00313066844250063; return vec3( - c.r <= t ? c.r * 12.92 : 1.055 * pow(c.r, 1 / 2.4) - 0.055, - c.g <= t ? c.g * 12.92 : 1.055 * pow(c.g, 1 / 2.4) - 0.055, - c.b <= t ? c.b * 12.92 : 1.055 * pow(c.b, 1 / 2.4) - 0.055 + c.r <= t ? c.r * 12.92 : 1.055 * pow(c.r, 1.0 / 2.4) - 0.055, + c.g <= t ? c.g * 12.92 : 1.055 * pow(c.g, 1.0 / 2.4) - 0.055, + c.b <= t ? c.b * 12.92 : 1.055 * pow(c.b, 1.0 / 2.4) - 0.055 ); } @@ -86,7 +86,7 @@ void main() { */ @Suppress("RUNTIME_ANNOTATION_NOT_SUPPORTED") @Description("Blend spectral") -class BlendSpectral : Filter2to1(filterShaderFromCode(spectralBlendShader, "color-burn")) { +class BlendSpectral : Filter2to1(filterShaderFromCode(spectralBlendShader, "blend-spectral")) { @BooleanParameter("source clip") var clip: Boolean by parameters diff --git a/orx-fx/src/commonMain/kotlin/distort/Lenses.kt b/orx-fx/src/commonMain/kotlin/distort/Lenses.kt index 69605af83..68be3d86e 100644 --- a/orx-fx/src/commonMain/kotlin/distort/Lenses.kt +++ b/orx-fx/src/commonMain/kotlin/distort/Lenses.kt @@ -12,7 +12,7 @@ import org.openrndr.extra.parameters.IntParameter import org.openrndr.shape.Rectangle @Description("Lenses") -class Lenses : Filter1to1(mppFilterShader(fx_lenses, "block-repeat")) { +class Lenses : Filter1to1(mppFilterShader(fx_lenses, "lenses")) { @IntParameter("rows", 1, 64, order = 0) var rows: Int by parameters diff --git a/orx-fx/src/jvmDemo/kotlin/DemoBlur01.kt b/orx-fx/src/jvmDemo/kotlin/DemoBlur01.kt index 50866c77f..12967a92c 100644 --- a/orx-fx/src/jvmDemo/kotlin/DemoBlur01.kt +++ b/orx-fx/src/jvmDemo/kotlin/DemoBlur01.kt @@ -1,7 +1,6 @@ import org.openrndr.application import org.openrndr.color.ColorRGBa import org.openrndr.draw.* -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.fx.blur.* import org.openrndr.math.Polar import kotlin.math.sin diff --git a/orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt b/orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt index 9d488ff1d..8f74f3390 100644 --- a/orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt +++ b/orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt @@ -2,7 +2,6 @@ import org.openrndr.application import org.openrndr.draw.createEquivalent import org.openrndr.draw.loadImage import org.openrndr.extra.fx.dither.LumaHalftone -import org.openrndr.math.mod_ fun main() { application { diff --git a/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt b/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt index 7a990c4e9..b6992d134 100644 --- a/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt +++ b/orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt @@ -16,11 +16,6 @@ fun main() { checkers.size = 64.0 checkers.apply(emptyArray(), image) - if (System.getProperty("takeScreenshot") == "true") { - extend(SingleScreenshot()) { - this.outputFile = System.getProperty("screenshotPath") - } - } extend { fd.blend = mouse.position.x/width fd.apply(image, distorted) diff --git a/orx-fx/src/shaders/glsl/blend/add.frag b/orx-fx/src/shaders/glsl/blend/add.frag index c2a5f43db..f557b46ec 100644 --- a/orx-fx/src/shaders/glsl/blend/add.frag +++ b/orx-fx/src/shaders/glsl/blend/add.frag @@ -21,14 +21,14 @@ void main() { vec4 b = texture2D(tex1, v_texCoord0); #endif - vec3 na = a.a > 0 ? a.rgb/a.a : vec3(0.0); - vec3 nb = b.a > 0 ? b.rgb/b.a : vec3(0.0); + vec3 na = a.a > 0.0 ? a.rgb/a.a : vec3(0.0); + vec3 nb = b.a > 0.0 ? b.rgb/b.a : vec3(0.0); vec3 addColor = b.rgb; vec4 result; if (clip) { - result = vec4((na + addColor), 1) * a.a; + result = vec4((na + addColor), 1.0) * a.a; } else { result = (1.0-a.a) * b + a.a * b.a * vec4(min(na + nb, vec3(1.0)), 1.0) + (1.0-b.a) * a; } diff --git a/orx-fx/src/shaders/glsl/blend/hard-light.frag b/orx-fx/src/shaders/glsl/blend/hard-light.frag index a45a82c71..ca8cb2bce 100644 --- a/orx-fx/src/shaders/glsl/blend/hard-light.frag +++ b/orx-fx/src/shaders/glsl/blend/hard-light.frag @@ -25,9 +25,9 @@ void main() { vec3 nb = b.a == 0.0 ? vec3(0.0): b.rgb / b.a; vec3 m = vec3( - nb.r <= 0.5? 2*na.r * nb.r : 1.0 - 2.0*(1.0 - na.r)*(1.0 - nb.r), - nb.g <= 0.5? 2*na.g * nb.g : 1.0 - 2.0*(1.0 - na.g)*(1.0 - nb.g), - nb.b <= 0.5? 2*na.b * nb.b : 1.0 - 2.0*(1.0 - na.b)*(1.0 - nb.b) + nb.r <= 0.5? 2.0*na.r * nb.r : 1.0 - 2.0*(1.0 - na.r)*(1.0 - nb.r), + nb.g <= 0.5? 2.0*na.g * nb.g : 1.0 - 2.0*(1.0 - na.g)*(1.0 - nb.g), + nb.b <= 0.5? 2.0*na.b * nb.b : 1.0 - 2.0*(1.0 - na.b)*(1.0 - nb.b) ); vec4 result; diff --git a/orx-fx/src/shaders/glsl/blend/normal.frag b/orx-fx/src/shaders/glsl/blend/normal.frag index 199d2ff52..6ea8e99c6 100644 --- a/orx-fx/src/shaders/glsl/blend/normal.frag +++ b/orx-fx/src/shaders/glsl/blend/normal.frag @@ -21,14 +21,14 @@ void main() { vec4 b = texture2D(tex1, v_texCoord0); #endif - float alpha = min(1,max(0, b.a)); + float alpha = min(1.0, max(0.0, b.a)); vec4 result; if (!clip) { - result = a * (1.0-alpha) + b; + result = a * (1.0 - alpha) + b; result.a = clamp(o_color.a, 0.0, 1.0); } else { - result = a * (1.0-alpha) + b * a.a; + result = a * (1.0 - alpha) + b * a.a; } #ifdef OR_GL_FRAGCOLOR diff --git a/orx-fx/src/shaders/glsl/blend/overlay.frag b/orx-fx/src/shaders/glsl/blend/overlay.frag index ece28e0e7..11b14196b 100644 --- a/orx-fx/src/shaders/glsl/blend/overlay.frag +++ b/orx-fx/src/shaders/glsl/blend/overlay.frag @@ -13,7 +13,7 @@ out vec4 o_color; #endif vec3 demul(vec4 c) { - if (c.a == 0) { + if (c.a == 0.0) { return vec3(0.0); } else { return c.rgb / c.a; diff --git a/orx-fx/src/shaders/glsl/blend/subtract.frag b/orx-fx/src/shaders/glsl/blend/subtract.frag index e5cce4dc3..d4f2189a5 100644 --- a/orx-fx/src/shaders/glsl/blend/subtract.frag +++ b/orx-fx/src/shaders/glsl/blend/subtract.frag @@ -21,8 +21,8 @@ void main() { vec4 b = texture2D(tex1, v_texCoord0); #endif - vec3 na = a.a > 0 ? a.rgb/a.a : vec3(0.0); - vec3 nb = b.a > 0 ? b.rgb/b.a : vec3(0.0); + vec3 na = a.a > 0.0 ? a.rgb/a.a : vec3(0.0); + vec3 nb = b.a > 0.0 ? b.rgb/b.a : vec3(0.0); vec3 subColor = b.rgb; vec4 result; if (clip) { diff --git a/orx-fx/src/shaders/glsl/blur/approximate-gaussian-blur.frag b/orx-fx/src/shaders/glsl/blur/approximate-gaussian-blur.frag index f1f9999f7..ae304d9f9 100644 --- a/orx-fx/src/shaders/glsl/blur/approximate-gaussian-blur.frag +++ b/orx-fx/src/shaders/glsl/blur/approximate-gaussian-blur.frag @@ -20,7 +20,7 @@ void main() { float lw = exp( float(-(x*x)) / (2.0 * sigma * sigma) ) ; vec2 tc = v_texCoord0 + float(x) * blurDirection * s;// * spread; #ifndef OR_WEBGL2 - sum += textureLod(tex0, tc, sourceLevel) * lw; + sum += textureLod(tex0, tc, float(sourceLevel)) * lw; #else sum += texture(tex0, tc); #endif diff --git a/orx-fx/src/shaders/glsl/blur/bloom-downscale.frag b/orx-fx/src/shaders/glsl/blur/bloom-downscale.frag index a4d3583fa..682180974 100644 --- a/orx-fx/src/shaders/glsl/blur/bloom-downscale.frag +++ b/orx-fx/src/shaders/glsl/blur/bloom-downscale.frag @@ -8,12 +8,12 @@ void main() { float centerWeight = 0.16210282163712664; vec2 diagonalOffsets = vec2(0.3842896354828526, 1.2048616327242379); - vec4 offsets = vec4(-diagonalOffsets.xy, +diagonalOffsets.xy) / textureSize(tex0, 0).xyxy; + vec4 offsets = vec4(-diagonalOffsets.xy, +diagonalOffsets.xy) / vec2(textureSize(tex0, 0)).xyxy; float diagonalWeight = 0.2085034734347498; - o_output = textureLod(tex0, v_texCoord0, 0) * centerWeight + - textureLod(tex0, v_texCoord0 + offsets.xy, 0) * diagonalWeight + - textureLod(tex0, v_texCoord0 + offsets.wx, 0) * diagonalWeight + - textureLod(tex0, v_texCoord0 + offsets.zw, 0) * diagonalWeight + - textureLod(tex0, v_texCoord0 + offsets.yz, 0) * diagonalWeight; + o_output = textureLod(tex0, v_texCoord0, 0.0) * centerWeight + + textureLod(tex0, v_texCoord0 + offsets.xy, 0.0) * diagonalWeight + + textureLod(tex0, v_texCoord0 + offsets.wx, 0.0) * diagonalWeight + + textureLod(tex0, v_texCoord0 + offsets.zw, 0.0) * diagonalWeight + + textureLod(tex0, v_texCoord0 + offsets.yz, 0.0) * diagonalWeight; } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/blur/bloom-upscale.frag b/orx-fx/src/shaders/glsl/blur/bloom-upscale.frag index 09daaca0b..573d10d90 100644 --- a/orx-fx/src/shaders/glsl/blur/bloom-upscale.frag +++ b/orx-fx/src/shaders/glsl/blur/bloom-upscale.frag @@ -20,55 +20,55 @@ uniform sampler2D tex4; uniform sampler2D tex5; vec4 sampleBloom(vec2 pos, float shape) { - vec4 sum = vec4(0); - float total = 0; + vec4 sum = vec4(0.0); + float total = 0.0; { float weight = pow(0.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 2 - 1) / textureSize(tex0, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 2.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex0, pos + rnd * noiseGain, 0.0) * weight; total += weight; } { float weight = pow(1.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 2 - 1) / textureSize(tex1, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 2.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex1, pos + rnd * noiseGain, 0.0) * weight; total += weight; } { float weight = pow(2.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 2 - 1) / textureSize(tex2, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 2.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex2, pos + rnd * noiseGain, 0.0) * weight; total += weight; } { float weight = pow(3.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 3 - 1) / textureSize(tex3, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 3.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex3, pos + rnd * noiseGain, 0.0) * weight; total += weight; } { float weight = pow(4.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 3 - 1) / textureSize(tex3, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 3.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex4, pos + rnd * noiseGain, 0.0) * weight; total += weight; } { float weight = pow(5.0, shape); - vec2 rnd = vec2(nrand(3 + 0.0 + pos.xy + noiseSeed), - nrand(5 + 0.0 + pos.yx - noiseSeed)); - rnd = (rnd * 3 - 1) / textureSize(tex3, 0); + vec2 rnd = vec2(nrand(3.0 + 0.0 + pos.xy + noiseSeed), + nrand(5.0 + 0.0 + pos.yx - noiseSeed)); + rnd = (rnd * 3.0 - 1.0) / vec2(textureSize(tex0, 0)); sum += textureLod(tex5, pos + rnd * noiseGain, 0.0) * weight; total += weight; } diff --git a/orx-fx/src/shaders/glsl/blur/gaussian-blur.frag b/orx-fx/src/shaders/glsl/blur/gaussian-blur.frag index f769d71fc..8ff165588 100644 --- a/orx-fx/src/shaders/glsl/blur/gaussian-blur.frag +++ b/orx-fx/src/shaders/glsl/blur/gaussian-blur.frag @@ -10,17 +10,17 @@ uniform float gain; out vec4 o_color; void main() { - vec2 s = textureSize(tex0, 0).xy; + vec2 s = vec2(textureSize(tex0, 0).xy); s = vec2(1.0/s.x, 1.0/s.y); int w = window; - vec4 sum = vec4(0,0,0,0); - float weight = 0; + vec4 sum = vec4(0.0, 0.0, 0.0, 0.0); + float weight = 0.0; for (int y = -w; y<= w; ++y) { for (int x = -w; x<= w; ++x) { - float lw = exp(-(x*x+y*y) / (2 * sigma * sigma)); - sum+=texture(tex0, v_texCoord0 + vec2(x,y) * s * spread) * lw; + float lw = exp(-float(x*x+y*y) / (2.0 * sigma * sigma)); + sum+=texture(tex0, v_texCoord0 + vec2(x, y) * s * spread) * lw; weight+=lw; } } diff --git a/orx-fx/src/shaders/glsl/color/posterize.frag b/orx-fx/src/shaders/glsl/color/posterize.frag index 92a3ae696..40f1ba581 100644 --- a/orx-fx/src/shaders/glsl/color/posterize.frag +++ b/orx-fx/src/shaders/glsl/color/posterize.frag @@ -5,7 +5,7 @@ uniform int levels; out vec4 o_output; void main() { vec4 c = texture(tex0, v_texCoord0); - vec2 step = 1.0 / textureSize(tex0, 0); + vec2 step = 1.0 / vec2(textureSize(tex0, 0)); float w = 0.0; vec3 s = vec3(0.0); for (int v = -window; v <= window; ++v) { @@ -14,7 +14,7 @@ void main() { if (c.a != 0.0) { c.rgb /= c.a; } - vec3 q = min(floor(c.rgb * float(levels))/float(levels-1.0), vec3(1.0)); + vec3 q = min(floor(c.rgb * float(levels))/float(levels-1), vec3(1.0)); s += q; w += 1.0; } diff --git a/orx-fx/src/shaders/glsl/color/rgb-to-ycbcr.frag b/orx-fx/src/shaders/glsl/color/rgb-to-ycbcr.frag index c3a66eae8..546fe9bfd 100644 --- a/orx-fx/src/shaders/glsl/color/rgb-to-ycbcr.frag +++ b/orx-fx/src/shaders/glsl/color/rgb-to-ycbcr.frag @@ -10,7 +10,7 @@ void main() { } c.rgb *= 255.0; float y = 0.0 + 0.299 * c.r + 0.587 * c.g + 0.114 * c.b; - float cb = 128 - (0.168736 * c.r) - (0.331264 * c.g) + (0.5 * c.b); - float cr = 128 + (0.5 * c.r) - 0.418688 * c.g - 0.081312 * c.b; + float cb = 128.0 - (0.168736 * c.r) - (0.331264 * c.g) + (0.5 * c.b); + float cr = 128.0 + (0.5 * c.r) - 0.418688 * c.g - 0.081312 * c.b; o_color = vec4(y/255.0, cb/255.0, cr/255.0, 1.0) * c.a; } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/color/ycbcr-to-rgb.frag b/orx-fx/src/shaders/glsl/color/ycbcr-to-rgb.frag index acf900205..28cabf825 100644 --- a/orx-fx/src/shaders/glsl/color/ycbcr-to-rgb.frag +++ b/orx-fx/src/shaders/glsl/color/ycbcr-to-rgb.frag @@ -4,7 +4,7 @@ uniform sampler2D tex0; out vec4 o_color; void main() { - vec2 ts = textureSize(tex0, 0); + vec2 ts = vec2(textureSize(tex0, 0)); vec4 c = texture(tex0, v_texCoord0); if (c.a != 0.0) { diff --git a/orx-fx/src/shaders/glsl/distort/displace-blend.frag b/orx-fx/src/shaders/glsl/distort/displace-blend.frag index 9b56b4d44..2990a9be8 100644 --- a/orx-fx/src/shaders/glsl/distort/displace-blend.frag +++ b/orx-fx/src/shaders/glsl/distort/displace-blend.frag @@ -22,7 +22,7 @@ void main() { float ar = targetSize.y / targetSize.x; - vec4 nb = b.a > 0? b/b.a : vec4(0.0); + vec4 nb = b.a > 0.0? b/b.a : vec4(0.0); vec2 offset = (nb.rg - vec2(offset))*vec2(gain) * nb.a; offset = rm * offset * vec2(1.0, ar); diff --git a/orx-fx/src/shaders/glsl/distort/fluid-distort.frag b/orx-fx/src/shaders/glsl/distort/fluid-distort.frag index ac3cca011..da87c2200 100644 --- a/orx-fx/src/shaders/glsl/distort/fluid-distort.frag +++ b/orx-fx/src/shaders/glsl/distort/fluid-distort.frag @@ -34,11 +34,11 @@ uniform float blend; out vec4 o_color; float getRot(vec2 pos, vec2 b) { - vec2 Res = textureSize(tex0, 0); + vec2 Res = vec2(textureSize(tex0, 0)); vec2 p = b; float rot = 0.0; for (int i = 0; i < RotNum; i++) { - rot += dot(texture(tex0, fract((pos + p) / Res.xy)).xy -vec2(0.5), p.yx * vec2(1, -1)); + rot += dot(texture(tex0, fract((pos + p) / Res.xy)).xy -vec2(0.5), p.yx * vec2(1.0, -1.0)); p = m * p; } return rot / float(RotNum)/dot(b, b); @@ -46,10 +46,10 @@ float getRot(vec2 pos, vec2 b) { void main() { vec2 pos = v_texCoord0 * targetSize; - vec2 Res = textureSize(tex0, 0); + vec2 Res = vec2(textureSize(tex0, 0)); vec2 b = vec2(cos(ang * random), sin(ang * random)); - vec2 v = vec2(0); + vec2 v = vec2(0.0); float bbMax = 0.5 * Res.y; bbMax *= bbMax; for (int l = 0; l < 20; l++) { diff --git a/orx-fx/src/shaders/glsl/distort/lenses.frag b/orx-fx/src/shaders/glsl/distort/lenses.frag index a171da995..8240e9fe8 100644 --- a/orx-fx/src/shaders/glsl/distort/lenses.frag +++ b/orx-fx/src/shaders/glsl/distort/lenses.frag @@ -18,7 +18,7 @@ void main() { float ca = cos(radians(rotation)); float sa = sin(radians(rotation)); - vec2 ts = textureSize(tex0, 0); + vec2 ts = vec2(textureSize(tex0, 0)); mat2 rm = mat2(1.0, 0.0, 0.0, ts.x / ts.y) * mat2(vec2(ca, sa), vec2(-sa, ca)) * mat2(1.0, 0.0, 0.0, ts.y / ts.x); vec2 ruv = (uv - blockCenter); vec2 luv; diff --git a/orx-fx/src/shaders/glsl/distort/stack-repeat.frag b/orx-fx/src/shaders/glsl/distort/stack-repeat.frag index 3a9198f1e..debd0ba63 100644 --- a/orx-fx/src/shaders/glsl/distort/stack-repeat.frag +++ b/orx-fx/src/shaders/glsl/distort/stack-repeat.frag @@ -11,11 +11,11 @@ uniform float rotation; out vec4 o_color; void main() { vec2 origin = vec2((xOrigin+1.0)/2.0, (yOrigin+1.0)/2.0); - vec2 ts = textureSize(tex0, 0); + vec2 ts = vec2(textureSize(tex0, 0)); float r = ts.x/ts.y; vec2 offset = vec2(1.0, r) * vec2(xOffset, yOffset); vec2 uv = v_texCoord0 - vec2(origin); - float rad = (rotation/180) * 3.1415926535; + float rad = (rotation / 180.0) * 3.1415926535; vec2 cs0 = vec2(cos(rad), -sin(rad)); vec2 cs1 = vec2(sin(rad), cos(rad)); mat2 rotStep = mat2(cs0, cs1); @@ -24,7 +24,7 @@ void main() { vec4 c = texture(tex0, v_texCoord0); for (int i = 1; i <= repeats; ++i) { //vec2 s = (uv * (1.0 + zoom) * i) + vec2(0.5); - vec2 s = (rot * uv * pow(1.0 + zoom,i*1.0) )+ vec2(origin) + vec2(offset) * i; + vec2 s = (rot * uv * pow(1.0 + zoom, float(i) * 1.0))+ vec2(origin) + vec2(offset) * float(i); float f = s.x >= 0.0 && s.y > 0.0 && s.x < 1.0 && s.y < 1.0? 1.0 : 0.0; vec4 sc = texture(tex0, s) * f; @@ -34,7 +34,5 @@ void main() { } rot *= rotStep; } - - o_color = c; } diff --git a/orx-fx/src/shaders/glsl/distort/tape-noise.frag b/orx-fx/src/shaders/glsl/distort/tape-noise.frag index d9c93d0c1..edc00ef8c 100644 --- a/orx-fx/src/shaders/glsl/distort/tape-noise.frag +++ b/orx-fx/src/shaders/glsl/distort/tape-noise.frag @@ -35,19 +35,19 @@ void main() { o_output = vec4(0.0); for (int k = 0; k < 10; ++k ) { vec2 duv = v_texCoord0; - duv.y += smoothstep(pow(cos(time+k*dk+v_texCoord0.y*1.0),10.0)*0.1+0.1, 0.0, v_texCoord0.x)*deformAmplitude * cos((time+k*dk)*deformFrequency); - duv.y += smoothstep(pow(1.0-cos(time+k*dk+v_texCoord0.y*1.0),10.0)*0.1+0.1, 0.9, v_texCoord0.x)*deformAmplitude * cos((time+k*dk)*deformFrequency); + duv.y += smoothstep(pow(cos(time+float(k)*dk+v_texCoord0.y*1.0),10.0)*0.1+0.1, 0.0, v_texCoord0.x)*deformAmplitude * cos((time+float(k)*dk)*deformFrequency); + duv.y += smoothstep(pow(1.0-cos(time+float(k)*dk+v_texCoord0.y*1.0),10.0)*0.1+0.1, 0.9, v_texCoord0.x)*deformAmplitude * cos((time+float(k)*dk)*deformFrequency); duv.y += sin(v_texCoord0.x*3.1415926535)*0.0; - float bc = floor(hash22(vec2(time+k*dk, (time+k*dk)*0.1)).x*20.0); + float bc = floor(hash22(vec2(time+float(k)*dk, (time+float(k)*dk)*0.1)).x*20.0); float gb3 = floor(duv.y*bc)/bc; - vec2 v = hash22(duv.xy*0.003+time+k*dk); - vec2 v2 = hash22(duv.xy*0.03+time+k*dk); - vec2 v2b = hash22(duv.yx*0.03+time+k*dk); - float stretch = (cos(time+k*dk)*0.001+0.002)*0.3+0.001; - vec2 h = hash22(duv.yy*stretch+time+k*dk); - float gap = smoothstep(gapLow, gapHigh, cos(gb3*(gapFrequency+duv.y*gapFrequency + (time+k*dk)*gapFrequency) +duv.x*gapFrequency)) * (cos(gb3)*0.5+0.5); + vec2 v = hash22(duv.xy*0.003+time+float(k)*dk); + vec2 v2 = hash22(duv.xy*0.03+time+float(k)*dk); + vec2 v2b = hash22(duv.yx*0.03+time+float(k)*dk); + float stretch = (cos(time+float(k)*dk)*0.001+0.002)*0.3+0.001; + vec2 h = hash22(duv.yy*stretch+time+float(k)*dk); + float gap = smoothstep(gapLow, gapHigh, cos(gb3*(gapFrequency+duv.y*gapFrequency + (time+float(k)*dk)*gapFrequency) +duv.x*gapFrequency)) * (cos(gb3)*0.5+0.5); float r = smoothstep(noiseLow, noiseHigh, h.x*gap*v2.x)*1.0; float g = smoothstep(noiseLow, noiseHigh, h.x*gap*v2.y)*1.0; diff --git a/orx-fx/src/shaders/glsl/distort/video-glitch.frag b/orx-fx/src/shaders/glsl/distort/video-glitch.frag index a1cfda36d..1955c24d5 100644 --- a/orx-fx/src/shaders/glsl/distort/video-glitch.frag +++ b/orx-fx/src/shaders/glsl/distort/video-glitch.frag @@ -30,8 +30,8 @@ vec4 getVideo(vec2 uv, float amplitude, float seconds) { float iTime = seconds; vec2 look = mod(uv, vec2(1.0)); float window = 1.0/(1.0 + 20.0*(look.y-mod(iTime*vfreq, 1.0))*(look.y-mod(iTime*vfreq, 1.))); - look.x = look.x + sin(look.y*pfreq + poffset * 3.1415)/50 *(1.+cos(iTime*hfreq))*window*amplitude; - look.y = mod(look.y, 1.); + look.x = look.x + sin(look.y*pfreq + poffset * 3.1415)/50.0 *(1.0+cos(iTime*hfreq))*window*amplitude; + look.y = mod(look.y, 1.0); vec4 video = texture(tex0, look); return video; @@ -48,11 +48,11 @@ void main() { float ds = scrollOffset1 - scrollOffset0; if (aa > 0.0 || ds > 0.0) { for (int i = 1; i < 16; ++i) { - vec4 lc = getVideo(v_texCoord0 + vec2(0.0, scrollOffset0+ds*i), aa, time-i/(16*60.0)); + vec4 lc = getVideo(v_texCoord0 + vec2(0.0, scrollOffset0+ds*float(i)), aa, time-float(i)/(16.0*60.0)); if (!linearInput) { lc.rgb = pow(lc.rgb, vec3(2.2)); } - c += lc * (3.0/16.0) * aberrationColor(i/16.0); + c += lc * (3.0/16.0) * aberrationColor(float(i)/16.0); } o_output = c; } else { @@ -63,6 +63,6 @@ void main() { o_output = lc; } if (!linearOutput) { - o_output.rgb = pow(o_output.rgb, vec3(1/2.2)); + o_output.rgb = pow(o_output.rgb, vec3(1.0/2.2)); } } diff --git a/orx-fx/src/shaders/glsl/dither/a-dither.frag b/orx-fx/src/shaders/glsl/dither/a-dither.frag index e92f2972d..8789895ed 100644 --- a/orx-fx/src/shaders/glsl/dither/a-dither.frag +++ b/orx-fx/src/shaders/glsl/dither/a-dither.frag @@ -7,22 +7,22 @@ uniform int pattern; uniform int levels; float mask1(int levels, float l, int x, int y, int c) { - float mask = ((x ^ y * 149) * 1234& 511)/511.0; - return floor(levels * l + mask)/levels; + float mask = float((x ^ y * 149) * 1234& 511)/511.0; + return floor(float(levels) * l + mask)/float(levels); } float mask2(int levels, float l, int x, int y, int c) { - float mask = (((x+c*17) ^ y * 149) * 1234 & 511)/511.0; - return floor(levels * l + mask)/levels; + float mask = float(((x+c*17) ^ y * 149) * 1234 & 511)/511.0; + return floor(float(levels) * l + mask)/float(levels); } float mask3(int levels, float l, int x, int y, int c) { - float mask = ((x + y * 237) * 119 & 255)/255.0; - return floor(levels * l + mask)/levels; + float mask = float((x + y * 237) * 119 & 255)/255.0; + return floor(float(levels) * float(l) + mask)/float(levels); } float mask4(int levels, float l, int x, int y, int c) { - float mask = (((x+c*67) + y * 236) * 119 & 255)/255.0; - return floor(levels * l + mask)/levels; + float mask = float(((x+c*67) + y * 236) * 119 & 255)/255.0; + return floor(float(levels) * float(l) + mask)/float(levels); } out vec4 o_color; @@ -31,7 +31,7 @@ void main() { if (c.a > 0.0) { c.rgb/=c.a; } - ivec2 ic = ivec2(v_texCoord0 * textureSize(tex0, 0)); + ivec2 ic = ivec2(v_texCoord0 * vec2(textureSize(tex0, 0))); vec4 rgba = vec4(0.0); if (pattern == 0) { diff --git a/orx-fx/src/shaders/glsl/dither/cmyk-halftone.frag b/orx-fx/src/shaders/glsl/dither/cmyk-halftone.frag index 55ebf9919..a5c31ea7f 100644 --- a/orx-fx/src/shaders/glsl/dither/cmyk-halftone.frag +++ b/orx-fx/src/shaders/glsl/dither/cmyk-halftone.frag @@ -23,7 +23,7 @@ vec3 cmyki2rgb(in vec4 c) return c.rgb * c.a; } vec3 u(vec4 c) { - if (c.a == 0) { + if (c.a == 0.0) { return vec3(0.0); } else { return c.rgb/c.a; @@ -46,7 +46,7 @@ vec4 cmyki2rgba(in vec4 cmyk){ vec2 px2uv(in vec2 px) { - return vec2(px / textureSize(tex0, 0)); + return vec2(px / vec2(textureSize(tex0, 0))); } vec2 grid(in vec2 px) @@ -63,7 +63,7 @@ vec4 halftone(in vec2 fc,in mat2 m) { vec2 smp = (grid(m*fc) + 0.5*scale) * m; float s = min(length(fc-smp) / (dotSize*0.5*scale), 1.0); - vec3 texc = texture(tex0, px2uv(smp+textureSize(tex0, 0)/2.0)).rgb; + vec3 texc = texture(tex0, px2uv(smp+vec2(textureSize(tex0, 0))/2.0)).rgb; vec4 c = rgb2cmyki(texc); return c+s; } @@ -79,7 +79,7 @@ mat2 rotm(in float r) } void main() { - vec2 fc = v_texCoord0 * textureSize(tex0, 0) - textureSize(tex0, 0)/2.0; + vec2 fc = v_texCoord0 * vec2(textureSize(tex0, 0)) - vec2(textureSize(tex0, 0))/2.0; mat2 mc = rotm(rotation + radians(15.0)); mat2 mm = rotm(rotation + radians(75.0)); diff --git a/orx-fx/src/shaders/glsl/dither/luma-halftone.frag b/orx-fx/src/shaders/glsl/dither/luma-halftone.frag index 23da91f7b..ba835e74c 100644 --- a/orx-fx/src/shaders/glsl/dither/luma-halftone.frag +++ b/orx-fx/src/shaders/glsl/dither/luma-halftone.frag @@ -16,7 +16,7 @@ float cosine_sample(vec2 uv){ float ca = cos(radians(rotation)); float sa = sin(radians(rotation)); - vec2 ts = textureSize(tex0, 0); + vec2 ts = vec2(textureSize(tex0, 0)); mat2 rm = mat2(1.0, 0.0, 0.0, ts.x/ts.y) * mat2(vec2(ca, sa), vec2(-sa, ca)) * mat2(1.0, 0.0, 0.0, ts.y/ts.x); vec2 cuv = (rm * (uv - vec2(0.5))) + vec2(0.5); @@ -28,7 +28,7 @@ float cosine_sample(vec2 uv){ } float l = dot(vec3(1.0/3.0), c.rgb); if (invert) { - l = 1 - l; + l = 1.0 - l; } float t = 0.0; @@ -38,14 +38,14 @@ float cosine_sample(vec2 uv){ float cosine_halftone(vec2 uv) { int w = 3; - vec2 step = 1.0 / textureSize(tex0, 0); - step /= (2*w); + vec2 step = 1.0 / vec2(textureSize(tex0, 0)); + step /= (2.0*float(w)); float weight = 0.0; float sum = 0.0; for (int v = -w; v <= w; ++v) { for (int u = -w; u <= w; ++u) { sum += cosine_sample(uv + step * vec2(u, v)); - weight+=1; + weight+=1.0; } } return sum / weight; @@ -56,7 +56,7 @@ void main() { vec4 c = texture(tex0, v_texCoord0); float t = cosine_halftone(v_texCoord0); if (invert) { - t = 1 - t; + t = 1.0 - t; } o_color = vec4(t, t, t, 1.0) * c.a; } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/edges/canny-edge-detector.frag b/orx-fx/src/shaders/glsl/edges/canny-edge-detector.frag index f1a0552a2..9e9c9db78 100644 --- a/orx-fx/src/shaders/glsl/edges/canny-edge-detector.frag +++ b/orx-fx/src/shaders/glsl/edges/canny-edge-detector.frag @@ -15,8 +15,7 @@ uniform vec4 foregroundColor; uniform float backgroundOpacity; uniform float foregroundOpacity; -vec2 iResolution = textureSize(tex0, 0); -vec2 fragCoord = v_texCoord0 * iResolution; +vec2 iResolution; float getAve(vec2 uv){ vec3 rgb = texture(tex0, uv).rgb; @@ -104,6 +103,8 @@ float cannyEdge(vec2 fragCoord, float mn, float mx){ } void main(){ + iResolution = vec2(textureSize(tex0, 0)); + vec2 fragCoord = v_texCoord0 * iResolution; float edge = cannyEdge(fragCoord, threshold0, threshold1); o_output = mix(foregroundColor * foregroundOpacity, backgroundColor * backgroundOpacity, 1.-edge); } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/edges/contour.frag b/orx-fx/src/shaders/glsl/edges/contour.frag index 3d82721dc..25a759453 100644 --- a/orx-fx/src/shaders/glsl/edges/contour.frag +++ b/orx-fx/src/shaders/glsl/edges/contour.frag @@ -17,13 +17,13 @@ float calc_contour(vec2 uv) { } void main() { - vec2 step = 1.0 / textureSize(tex0, 0); + vec2 step = 1.0 / vec2(textureSize(tex0, 0)); float contour = 0.0; float weight = 0.0; for (int i = -window; i <= window; ++i) { for (int j = -window; j <= window; ++j) { - contour += calc_contour(v_texCoord0 + step/(window+1.0) * vec2(i, j)); + contour += calc_contour(v_texCoord0 + step/(float(window)+1.0) * vec2(float(i), float(j))); weight += 1.0; } } diff --git a/orx-fx/src/shaders/glsl/edges/luma-sobel.frag b/orx-fx/src/shaders/glsl/edges/luma-sobel.frag index 67fd3cdf1..3220633e6 100644 --- a/orx-fx/src/shaders/glsl/edges/luma-sobel.frag +++ b/orx-fx/src/shaders/glsl/edges/luma-sobel.frag @@ -16,7 +16,7 @@ float luma(vec4 color){ } void main() { - vec2 step = 1.0 / textureSize(tex0, 0); + vec2 step = 1.0 / vec2(textureSize(tex0, 0)); float tl = luma(texture(tex0, v_texCoord0 + vec2(-step.x, step.y))); float l = luma(texture(tex0, v_texCoord0 + vec2(-step.x, 0))); @@ -39,7 +39,7 @@ void main() { float x = tl + 2.0 * l + bl - tr - 2.0 * r - br; float y = -tl - 2.0 * t - tr + bl + 2.0 * b + br; - float intensity = sqrt((x*x) + (y*y)) / sqrt(2); + float intensity = sqrt(x*x + y*y) / sqrt(2.0); vec4 color = mix(vec4(backgroundColor.rgb, backgroundOpacity), vec4(edgeColor.rgb, edgeOpacity), intensity); vec4 a = texture(tex0, v_texCoord0); diff --git a/orx-fx/src/shaders/glsl/patterns/checkers.frag b/orx-fx/src/shaders/glsl/patterns/checkers.frag index c94e7299e..c6102654c 100644 --- a/orx-fx/src/shaders/glsl/patterns/checkers.frag +++ b/orx-fx/src/shaders/glsl/patterns/checkers.frag @@ -21,7 +21,7 @@ void main() { vec2 cell = (uv / size); ivec2 cellIndex = ivec2(floor(cell)); - vec2 cellUV = cell - cellIndex; + vec2 cellUV = cell - vec2(cellIndex); int c = (cellIndex.x + cellIndex.y) % 2; vec2 w = fwidth(cell); diff --git a/orx-fx/src/shaders/glsl/shadow/dropshadow-blend.frag b/orx-fx/src/shaders/glsl/shadow/dropshadow-blend.frag index 0ed91c324..99168750a 100644 --- a/orx-fx/src/shaders/glsl/shadow/dropshadow-blend.frag +++ b/orx-fx/src/shaders/glsl/shadow/dropshadow-blend.frag @@ -7,6 +7,6 @@ out vec4 o_color; void main() { vec4 a = texture(tex0, v_texCoord0-shift); vec4 b = texture(tex1, v_texCoord0); - float alpha = min(1,max(0, b.a)); + float alpha = min(1.0,max(0.0, b.a)); o_color = a * (1.0-alpha) + b; } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/shadow/dropshadow-blur.frag b/orx-fx/src/shaders/glsl/shadow/dropshadow-blur.frag index 0a593b172..42aa1e0e1 100644 --- a/orx-fx/src/shaders/glsl/shadow/dropshadow-blur.frag +++ b/orx-fx/src/shaders/glsl/shadow/dropshadow-blur.frag @@ -10,16 +10,16 @@ uniform float spread; uniform vec4 color; out vec4 o_color; void main() { - vec2 s = textureSize(tex0, 0).xy; + vec2 s = vec2(textureSize(tex0, 0)).xy; s = vec2(1.0/s.x, 1.0/s.y); int w = window; vec4 sum = vec4(0, 0, 0, 0); - float weight = 0; + float weight = 0.0; for (int x = -w; x<= w; ++x) { float lw = 1.0; - sum += texture(tex0, v_texCoord0 + x * blurDirection * s * spread); + sum += texture(tex0, v_texCoord0 + float(x) * blurDirection * s * spread); weight += lw; } diff --git a/orx-fx/src/shaders/glsl/tonemap/aces-tonemap.frag b/orx-fx/src/shaders/glsl/tonemap/aces-tonemap.frag index db244c2ae..d477d39b9 100644 --- a/orx-fx/src/shaders/glsl/tonemap/aces-tonemap.frag +++ b/orx-fx/src/shaders/glsl/tonemap/aces-tonemap.frag @@ -20,6 +20,6 @@ vec3 ACESFilm(vec3 x) { void main() { vec3 texColor = texture(tex0,v_texCoord0).rgb; vec3 color = ACESFilm(texColor * exposureBias); - vec3 retColor = pow(color, vec3(1/2.2)); - o_output = vec4(retColor, 1); + vec3 retColor = pow(color, vec3(1.0/2.2)); + o_output = vec4(retColor, 1.0); } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/tonemap/reinhard-tonemap.frag b/orx-fx/src/shaders/glsl/tonemap/reinhard-tonemap.frag index 2b9fde226..834e2e50a 100644 --- a/orx-fx/src/shaders/glsl/tonemap/reinhard-tonemap.frag +++ b/orx-fx/src/shaders/glsl/tonemap/reinhard-tonemap.frag @@ -28,6 +28,6 @@ vec3 reinhard_extended_luminance(vec3 v, float max_white_l) { void main() { vec3 texColor = texture(tex0,v_texCoord0).rgb; vec3 color = reinhard_extended_luminance(texColor * exposureBias, maxLuminance); - vec3 retColor = pow(color, vec3(1/2.2)); + vec3 retColor = pow(color, vec3(1.0/2.2)); o_output = vec4(retColor, 1); } \ No newline at end of file diff --git a/orx-fx/src/shaders/glsl/tonemap/uncharted2-tonemap.frag b/orx-fx/src/shaders/glsl/tonemap/uncharted2-tonemap.frag index dc0d25b8f..e5bf89afa 100644 --- a/orx-fx/src/shaders/glsl/tonemap/uncharted2-tonemap.frag +++ b/orx-fx/src/shaders/glsl/tonemap/uncharted2-tonemap.frag @@ -22,6 +22,6 @@ void main() { vec3 whiteScale = 1.0f/Uncharted2Tonemap(vec3(W)); vec3 color = curr*whiteScale; - vec3 retColor = pow(color, vec3(1/2.2)); + vec3 retColor = pow(color, vec3(1.0/2.2)); o_output = vec4(retColor, 1); } \ No newline at end of file diff --git a/orx-jumpflood/src/shaders/glsl/encode-subpixel.frag b/orx-jumpflood/src/shaders/glsl/encode-subpixel.frag index c357759fe..299c9ffb9 100644 --- a/orx-jumpflood/src/shaders/glsl/encode-subpixel.frag +++ b/orx-jumpflood/src/shaders/glsl/encode-subpixel.frag @@ -42,31 +42,31 @@ void main() { if (mask == 1) { offset.x = 1.0 - (threshold-t10) / zd(t00-t10); offset.y = 1.0 - ((threshold-t01) / zd(t00-t01)); - offset /= 2; + offset /= 2.0; } if (mask == 2) { offset.x = ((threshold-t00) / zd(t10-t00)); offset.y = 1.0-(threshold-t11) / zd(t10-t11); - offset /= 2; + offset /= 2.0; } if (mask == 3) { // OK float dy0 = 1.0 - (threshold - t01) / zd(t00 - t01); float dy1 = 1.0 - (threshold - t11) / zd(t10 - t11); offset.y = dy0 + dy1; offset.x = 1.0; - offset /= 2; + offset /= 2.0; } if (mask == 4) { // OK offset.x = 1.0 - (threshold-t11) / zd(t01-t11); offset.y = (threshold-t00) / zd(t01-t00); - offset /= 2; + offset /= 2.0; } if (mask == 5) { // OK float dx0 = 1.0- (threshold - t10) / zd(t00 - t10); float dx1 = 1.0-(threshold - t11) / zd(t01 - t11); offset.x = dx0 + dx1; offset.y = 1.0; - offset /= 2; + offset /= 2.0; } if (mask == 6 || mask == 9) { offset = vec2(0.5); @@ -74,41 +74,41 @@ void main() { if (mask == 7) { // OK offset.x = 1.0 - (threshold-t11) / zd(t01-t11); offset.y = 1.0 - (threshold-t11) / zd(t10-t11); - offset /= 2; + offset /= 2.0; } if (mask == 8) { // OK offset.x = (threshold-t01) / zd(t11-t01); offset.y = (threshold-t10) / zd(t11-t10); - offset /= 2; + offset /= 2.0; } if (mask == 10) { // OK float dx0 = (threshold - t00) / zd(t10 - t00); float dx1 = (threshold - t01) / zd(t11 - t01); offset.x = (dx0 + dx1); offset.y = 1.0; - offset /= 2; + offset /= 2.0; } if (mask == 11) { // OK offset.x = (threshold-t01) / zd(t11-t01); offset.y = (threshold-t01) / zd(t00-t01); - offset /= 2; + offset /= 2.0; } if (mask == 12) { // OK float dy0 = (threshold - t00) / zd(t01 - t00); float dy1 = (threshold - t10) / zd(t11 - t10); offset.y = dy0 + dy1; offset.x = 1.0; - offset /= 2; + offset /= 2.0; } if (mask == 13) { // OK offset.x = 1.0 - (threshold-t10) / zd(t00-t10); offset.y = (threshold-t10) / zd(t11-t10); - offset /= 2; + offset /= 2.0; } if (mask == 14) { // OK offset.x = (threshold-t00) / zd(t10-t00); offset.y = (threshold-t00) / zd(t01-t00); - offset /= 2; + offset /= 2.0; } float contour = (mask != 0 && mask != 15)?1.0:0.0; diff --git a/orx-jumpflood/src/shaders/glsl/pixel-direction.frag b/orx-jumpflood/src/shaders/glsl/pixel-direction.frag index 428fd7f50..f38b592bc 100644 --- a/orx-jumpflood/src/shaders/glsl/pixel-direction.frag +++ b/orx-jumpflood/src/shaders/glsl/pixel-direction.frag @@ -51,9 +51,9 @@ void main() { } #else if (!normalizedDistance) { - o_color = vec4( length(pixelDistance * distanceScale).xx, outputData, 1.0); + o_color = vec4( vec2(length(pixelDistance * distanceScale)), outputData, 1.0); } else if (!unitDirection) { - o_color = vec4( length(pixelDistance / originalSize).xx, outputData, 1.0); + o_color = vec4( vec2(length(pixelDistance / originalSize)), outputData, 1.0); } #endif } \ No newline at end of file diff --git a/orx-jumpflood/src/shaders/glsl/straight-skeleton.frag b/orx-jumpflood/src/shaders/glsl/straight-skeleton.frag index e0aaf9076..3dc16bc2a 100644 --- a/orx-jumpflood/src/shaders/glsl/straight-skeleton.frag +++ b/orx-jumpflood/src/shaders/glsl/straight-skeleton.frag @@ -39,7 +39,7 @@ void main() { fc += backgroundColor * backgroundColor.a; } - if ((d0 < angleTreshold || d1 < angleTreshold || d2 < angleTreshold || d3 < angleTreshold) && ct.z > 0.0 && length(ct.xy) > 4) { + if ((d0 < angleTreshold || d1 < angleTreshold || d2 < angleTreshold || d3 < angleTreshold) && ct.z > 0.0 && length(ct.xy) > 4.0) { fc = fc * (1.0 - skeletonColor.a) + (skeletonColor * skeletonColor.a); } o_color = fc; diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/PBRMaterial.kt b/orx-jvm/orx-dnk3/src/main/kotlin/PBRMaterial.kt index 6df39305a..c038e3ace 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/PBRMaterial.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/PBRMaterial.kt @@ -41,7 +41,7 @@ private fun PointLight.fs(index: Int, hasNormalAttribute: Boolean): String = """ | vec3 L = normalize(Lr); | | float side = ${if (hasNormalAttribute) "dot(L, N)" else "3.1415"}; -| f_diffuse += attenuation * max(0, side / 3.1415) * p_lightColor$index.rgb * m_color.rgb; +| f_diffuse += attenuation * max(0.0, side / 3.1415) * p_lightColor$index.rgb * m_color.rgb; | f_specular += attenuation * ggx(N, V, L, m_roughness, m_f0) * p_lightColor$index.rgb * m_color.rgb; } """.trimMargin() @@ -71,7 +71,7 @@ private fun DirectionalLight.fs(index: Int, hasNormalAttribute: Boolean) = """ private fun HemisphereLight.fs(index: Int, hasNormalAttribute: Boolean): String = """ |{ -| float f = ${if (hasNormalAttribute) "dot(N, p_lightDirection$index) * 0.5 + 0.5" else "1"}; +| float f = ${if (hasNormalAttribute) "dot(N, p_lightDirection$index) * 0.5 + 0.5" else "1.0"}; | vec3 irr = ${irradianceMap?.let { "texture(p_lightIrradianceMap$index, N).rgb" } ?: "vec3(1.0)"}; | f_diffuse += mix(p_lightDownColor$index.rgb, p_lightUpColor$index.rgb, f) * irr * ((1.0 - m_metalness) * m_color.rgb) * m_ambientOcclusion; |} @@ -460,7 +460,7 @@ class PBRMaterial : Material { vec3 Vr = ep - v_worldPosition; vec3 V = normalize(Vr); - float NoV = ${if (primitiveContext.hasNormalAttribute) "abs(dot(N, V)) + 1e-5" else "1"}; + float NoV = ${if (primitiveContext.hasNormalAttribute) "abs(dot(N, V)) + 1e-5" else "1.0"}; ${if (environmentMap && materialContext.meshCubemaps.isNotEmpty() && primitiveContext.hasNormalAttribute) """ { diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/SceneRenderer.kt b/orx-jvm/orx-dnk3/src/main/kotlin/SceneRenderer.kt index d5626e346..c7082069b 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/SceneRenderer.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/SceneRenderer.kt @@ -84,7 +84,7 @@ class SceneRenderer { } val target = shadowLightTargets.getOrPut(shadowLight) { val mapSize = (shadowLight.shadows as Shadows.MappedShadows).mapSize - pass.createPassTarget(mapSize, mapSize, DepthFormat.DEPTH16) + pass.createPassTarget(mapSize, mapSize, DepthFormat.DEPTH_STENCIL) } target.clearDepth(depth = 1.0) diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/ShaderUtilities.kt b/orx-jvm/orx-dnk3/src/main/kotlin/ShaderUtilities.kt index b81f47441..80ed275ba 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/ShaderUtilities.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/ShaderUtilities.kt @@ -93,7 +93,7 @@ val shaderVSM = """ |// -- shaderVSM |float linstep(float min, float max, float v) |{ -| return clamp((v - min) / (max - min), 0, 1); +| return clamp((v - min) / (max - min), 0.0, 1.0); |} |// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch08.html |float chebyshevUpperBound(vec2 moments, float t, float minVariance) { @@ -224,7 +224,7 @@ float ggx(vec3 N, vec3 V, vec3 L, float roughness, float F0) D = alphaSqr/(pi * denom * denom); // F - float dotLH5 = pow(1.0f-dotLH,5); + float dotLH5 = pow(1.0f-dotLH,5.0); F = F0 + (1.0-F0)*(dotLH5); // V diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/Shadows.kt b/orx-jvm/orx-dnk3/src/main/kotlin/Shadows.kt index 9c2178e89..35fedf987 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/Shadows.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/Shadows.kt @@ -27,7 +27,7 @@ fun Shadows.VSM.fs(index: Int) : String = """ |{ | vec4 smc = (p_lightTransform$index * vec4(v_worldPosition,1.0)); | vec3 lightProj = (smc.xyz/smc.w) * 0.5 + 0.5; -| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0 && lightProj.y < 1) { +| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0.0 && lightProj.y < 1.0) { | vec2 moments = texture(p_lightShadowMap$index, lightProj.xy).xy; | attenuation *= (chebyshevUpperBound(moments, length(Lr), 50.0)); | } @@ -38,9 +38,9 @@ fun Shadows.Simple.fs(index: Int): String = """ |{ | vec4 smc = (p_lightTransform$index * vec4(v_worldPosition,1.0)); | vec3 lightProj = (smc.xyz/smc.w) * 0.5 + 0.5; -| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0 && lightProj.y < 1) { +| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0.0 && lightProj.y < 1.0) { | vec3 smz = texture(p_lightShadowMap$index, lightProj.xy).rgb; -| vec2 step = 1.0 / textureSize(p_lightShadowMap$index,0); +| vec2 step = 1.0 / vec2(textureSize(p_lightShadowMap$index,0)); | float result = 0.0; | float compToZ = (lightProj.z- 0.0020 * tan(acos(NoL))) - 0.0003; | float currentDepth = lightProj.z; @@ -69,19 +69,19 @@ fun Shadows.PCF.fs(index: Int): String = """ | fTaps_Poisson[11] = vec2(-.792,-.598); | vec4 smc = (p_lightTransform$index * vec4(v_worldPosition,1.0)); | vec3 lightProj = (smc.xyz/smc.w) * 0.5 + 0.5; -| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0 && lightProj.y < 1) { +| if (lightProj.x > 0.0 && lightProj.x < 1.0 && lightProj.y > 0.0 && lightProj.y < 1.0) { | vec3 smz = texture(p_lightShadowMap$index, lightProj.xy).rgb; -| vec2 stepSize = 1.0 / textureSize(p_lightShadowMap$index,0); +| vec2 stepSize = 1.0 / vec2(textureSize(p_lightShadowMap$index,0)); | float result = 0.0; | float compToZ = (lightProj.z- 0.0020 * tan(acos(NoL))) - 0.0003; | float noise = hash22(lightProj.xy*10.0).x; | float r = noise * 3.1415926535 * 2.0; | mat2 rot = mat2( vec2(cos(r), -sin(r)), vec2(sin(r),cos(r))); | for (int i = 0; i < 12; ++i) { -| float depth = texture(p_lightShadowMap$index, lightProj.xy + rot*fTaps_Poisson[i]*i*lrl*stepSize ).r; +| float depth = texture(p_lightShadowMap$index, lightProj.xy + rot*fTaps_Poisson[i]*float(i)*lrl*stepSize ).r; | result += step(compToZ, depth); | } -| result /= 12; +| result /= 12.0; | float currentDepth = lightProj.z; | float closestDepth = smz.x; | float shadow = result;// (currentDepth - 0.0020 * tan(acos(NoL))) - 0.0003 >= closestDepth ? 0.0 : 1.0; diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt b/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt index eed4a3a90..c2d699c90 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/gltf/GltfScene.kt @@ -97,7 +97,7 @@ fun GltfFile.buildSceneNodes(): GltfSceneData { val cb = loadImage(MPPBuffer(localBuffer)) cb.generateMipmaps() cb.filter(MinifyingFilter.LINEAR_MIPMAP_LINEAR, MagnifyingFilter.LINEAR) - cb.anisotropy = 100.0 + cb.anisotropy = 10.0 localBuffer.limit(localBuffer.capacity()) cb } ?: error("no uri and no bufferview") diff --git a/orx-jvm/orx-dnk3/src/main/resources/shaders/screenspace-reflections.frag b/orx-jvm/orx-dnk3/src/main/resources/shaders/screenspace-reflections.frag index 0259fc8d3..98fbc4230 100644 --- a/orx-jvm/orx-dnk3/src/main/resources/shaders/screenspace-reflections.frag +++ b/orx-jvm/orx-dnk3/src/main/resources/shaders/screenspace-reflections.frag @@ -295,7 +295,7 @@ void main() { float angle = abs(dot(reflected, viewNormal)); - float frontalFade = clamp(-reflected.z,0, 1); + float frontalFade = clamp(-reflected.z,0.0, 1.0); if ( true ) { bool hit = traceScreenSpaceRay1( viewPos, diff --git a/orx-jvm/orx-dnk3/src/main/resources/shaders/segment-contours.frag b/orx-jvm/orx-dnk3/src/main/resources/shaders/segment-contours.frag index 91bd08066..f6b9c5255 100644 --- a/orx-jvm/orx-dnk3/src/main/resources/shaders/segment-contours.frag +++ b/orx-jvm/orx-dnk3/src/main/resources/shaders/segment-contours.frag @@ -1,12 +1,10 @@ -#version 330 - -uniform usampler2D tex0; +uniform highp usampler2D tex0; in vec2 v_texCoord0; out vec4 o_output; void main() { ivec2 ts = textureSize(tex0, 0); - ivec2 pixel = ivec2(v_texCoord0 * ts); + ivec2 pixel = ivec2(v_texCoord0 * vec2(ts)); ivec2 c = pixel; ivec2 n = c + ivec2(0, -1); diff --git a/orx-jvm/orx-olive/images/DemoOlive01Kt.png b/orx-jvm/orx-olive/images/DemoOlive01Kt.png deleted file mode 100644 index e4a00494b098ceface6e330af3f8b74b32347e9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33331 zcmd3OcT`j97Vk+h1UX3TNvIiY*a#4%LjWhyQ4~k7T?{>z5mZzZghVh{2t^!0EJQQ5 z(NT092NfX@K~xZ;qoN`Nv0x=23exiSIR`}VoxAQ@Z>?GH%^w*x`P%+={q4QK9ey)~ z#{Jp-5d<-wHg(F62tt8BlKFHR{LkeKX&!<|+ow(Onj7UGbo%UBeFe9_z(>TR{_V#U zI#*uuK}=7Qss8Sx)KID!pc1dJG?r=@%zytN$*?cK`;UMB@>>~)>q6mXofiK6`qXVI zv4MzpDdq1M$G$WEFB=on(d!K6K@!vVfs(^zlmGK$tGDO^tX=(I*2cc0{Vhqby~={< zNw<-tV{iWE)Y$2~INV3D_WS=_7T?PM%eAq6QU1%m*krXGRS<>Gk|~0YZXIw^0Qv=xigUk|7B)osxtTO+eeZu zT(Cg3ifKH@AgeurRnJnmozUnls|-cdi|_XBW3m?PTd2s~Czb#Fv$S7Tj=>H)2a0KX(hO7~@GO0- zxUDMC>m}y0IJ7|D9neO3%kOOOGA->kdJ%uEySt-8mz^e+4y>Antfy5uJ29P{omsiL zxvI>>#6;=-{rgE%;;%VLnpdq_r5#W#e#-7M!7+q)`E#!qC*dF~a^u-e*&bU0+jMml zCQ#;3UH$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..ea9d8bc08 100644 --- a/orx-jvm/orx-poisson-fill/src/demo/kotlin/DemoPoissonFill01.kt +++ b/orx-jvm/orx-poisson-fill/src/demo/kotlin/DemoPoissonFill01.kt @@ -8,11 +8,9 @@ import org.openrndr.draw.ColorType import org.openrndr.draw.colorBuffer import org.openrndr.draw.isolatedWithTarget import org.openrndr.draw.renderTarget -import org.openrndr.extensions.SingleScreenshot import org.openrndr.extra.noise.Random import org.openrndr.math.Polar import org.openrndr.math.clamp -import org.openrndr.math.mix import org.openrndr.poissonfill.PoissonFill import org.openrndr.shape.Rectangle import kotlin.math.sin @@ -25,7 +23,7 @@ fun main() { val dry = renderTarget(width, height) { colorBuffer(type = ColorType.FLOAT32) } - val wet = colorBuffer(width, height) + val wet = colorBuffer(width, height, type = ColorType.FLOAT32) val fx = PoissonFill() diff --git a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/downscale.frag b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/downscale.frag index ec0749399..90260d11b 100644 --- a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/downscale.frag +++ b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/downscale.frag @@ -1,7 +1,4 @@ // from https://github.com/kosua20/Rendu/blob/master/resources/common/shaders/screens/convolution-pyramid/downscale.frag - -#version 330 - in vec2 v_texCoord0; uniform vec2 targetSize; @@ -43,7 +40,8 @@ void main(){ continue; //accum = vec4(1.0, 0.0, 0.0, 1.0); } - accum += h1[dx+2] * h1[dy+2] * texelFetch(tex0, newPix,0); + accum += h1[dx+2] * h1[dy+2] * texelFetch(tex0, newPix,0 + ); } } o_output = accum; diff --git a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-boundary.frag b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-boundary.frag index faa8a563a..684db8b6c 100644 --- a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-boundary.frag +++ b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-boundary.frag @@ -1,7 +1,5 @@ // from https://github.com/kosua20/Rendu/blob/master/resources/common/shaders/screens/convolution-pyramid/fill-boundary.frag -#version 330 - in vec2 v_texCoord0; uniform sampler2D tex0; diff --git a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-combine.frag b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-combine.frag index ca5069f6b..106b5683c 100644 --- a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-combine.frag +++ b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/fill-combine.frag @@ -1,7 +1,5 @@ // from https://github.com/kosua20/Rendu/blob/master/resources/common/shaders/screens/convolution-pyramid/fill-combine.frag -#version 330 - in vec2 v_texCoord0; uniform sampler2D tex0; // result of pyramid convolution diff --git a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/filter.frag b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/filter.frag index 203d3a8a5..b6fea945b 100644 --- a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/filter.frag +++ b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/filter.frag @@ -1,7 +1,5 @@ // from https://github.com/kosua20/Rendu/blob/master/resources/common/shaders/screens/convolution-pyramid/filter.frag -#version 330 - //layout(binding = 0) uniform sampler2D screenTexture; ///< Level to filter. uniform sampler2D tex0; @@ -24,7 +22,7 @@ void main(){ vec4 accum = vec4(0.0); ivec2 size = textureSize(tex0, 0).xy; - ivec2 coords = ivec2(v_texCoord0 * size); + ivec2 coords = ivec2(v_texCoord0 * vec2(size)); for(int dy = -1; dy <=1; dy++){ for(int dx = -1; dx <=1; dx++){ diff --git a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/upscale.frag b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/upscale.frag index 392bdbad1..8dfaf990c 100644 --- a/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/upscale.frag +++ b/orx-jvm/orx-poisson-fill/src/main/resources/shaders/gl3/poisson/upscale.frag @@ -1,7 +1,5 @@ // from https://github.com/kosua20/Rendu/blob/master/resources/common/shaders/screens/convolution-pyramid/upscale.frag -#version 330 - in vec2 v_texCoord0; uniform sampler2D tex0; ///< Current h1 filtered level. @@ -27,7 +25,7 @@ bool isOutside(ivec2 pos, ivec2 size){ void main(){ vec4 accum = vec4(0.0); ivec2 size = textureSize(tex0, 0).xy; - ivec2 coords = ivec2(v_texCoord0 * size); + ivec2 coords = ivec2(v_texCoord0 * vec2(size)); for(int dy = -1; dy <=1; dy++){ for(int dx = -1; dx <=1; dx++){