Improve compatibility with GLES back-end

This commit is contained in:
Edwin Jakobs
2024-03-10 18:39:21 +01:00
parent b9b1b95ca0
commit e3f5e07b86
62 changed files with 182 additions and 195 deletions

View File

@@ -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()

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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++){

View File

@@ -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++){