[orx-fx] Add wrap mode support to ApproximateGaussianBlur and demo

This commit is contained in:
Edwin Jakobs
2025-08-19 13:54:55 +02:00
parent fd2d035511
commit aebec990e0
3 changed files with 58 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ uniform int window;
uniform float sigma;
uniform float spread;
uniform float gain;
uniform int wrapU;
uniform int wrapV;
uniform int sourceLevel;
@@ -19,6 +21,14 @@ void main() {
for (int x = -w; x <= w; ++x) {
float lw = exp( float(-(x*x)) / (2.0 * sigma * sigma) ) ;
vec2 tc = v_texCoord0 + float(x) * blurDirection * s;// * spread;
if (wrapU != 0) {
tc.x = mod(tc.x, 1.0);
}
if (wrapV != 0) {
tc.y = mod(tc.y, 1.0);
}
sum += texture(tex0, tc) * lw;
weight += lw;
}