biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
173
Reaction score
186
First Language
Korean
Primarily Uses
RMMV
I prefer to use your plugin rather than the pixi filter controller one

I'm still hoping someone comes with a fix for the wave speeding up when scrolling vertically lol
I've tried a lot to solve that problem.
I think that the problem is related with UV and $gameMap._displayY, but it's hard to solve it yet.
 

BlueCloud

Villager
Member
Joined
May 28, 2021
Messages
9
Reaction score
2
First Language
English
Primarily Uses
RMMV
This is a really nice plugin, thanks.

I made modifications to the Fragment shader to have vertical axis and both axis versions. If you wanted to build these into the plugin with a way to switch between Horizontal (Default), Vertical and Both Axis that would be great.

Vertical Wave:

Code:
     var fragmentSrc = [
       'precision mediump float;',

       'varying vec2 vTextureCoord;',

       'uniform float waveHeight;',
       'uniform float waveFrequency;',
       'uniform float waveTime;',
       'uniform float wavePhase;',
       'uniform float UVSpeed;',

       'uniform vec4 filterArea;',
       'uniform vec4 filterClamp;',
       'uniform vec2 origin;',

       'uniform sampler2D uSampler;',

       'void main(void) {',
       '   float time = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.x / (waveHeight / filterArea.x)) );',
       '   vec2 vCoord = vec2(vTextureCoord.x, vTextureCoord.y + time * UVSpeed);',
       '   gl_FragColor = texture2D(uSampler, clamp(vCoord, filterClamp.xy, filterClamp.zw));',
       '}'
     ].join('\n');

Both Axis Wave:

Code:
     var fragmentSrc = [
       'precision mediump float;',

       'varying vec2 vTextureCoord;',

       'uniform float waveHeight;',
       'uniform float waveFrequency;',
       'uniform float waveTime;',
       'uniform float wavePhase;',
       'uniform float UVSpeed;',

       'uniform vec4 filterArea;',
       'uniform vec4 filterClamp;',
       'uniform vec2 origin;',

       'uniform sampler2D uSampler;',

       'void main(void) {',
       '   float timeh = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.y / (waveHeight / filterArea.y)) );',
       '   float timev = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.x / (waveHeight / filterArea.x)) );',
       '   vec2 vCoord = vec2(vTextureCoord.x + timeh * UVSpeed, vTextureCoord.y + timev * UVSpeed);',

       '   gl_FragColor = texture2D(uSampler, clamp(vCoord, filterClamp.xy, filterClamp.zw));',
       '}'
     ].join('\n');
 

biud436

Veteran
Veteran
Joined
Sep 28, 2014
Messages
173
Reaction score
186
First Language
Korean
Primarily Uses
RMMV
This is a really nice plugin, thanks.

I made modifications to the Fragment shader to have vertical axis and both axis versions. If you wanted to build these into the plugin with a way to switch between Horizontal (Default), Vertical and Both Axis that would be great.

Vertical Wave:

Code:
     var fragmentSrc = [
       'precision mediump float;',

       'varying vec2 vTextureCoord;',

       'uniform float waveHeight;',
       'uniform float waveFrequency;',
       'uniform float waveTime;',
       'uniform float wavePhase;',
       'uniform float UVSpeed;',

       'uniform vec4 filterArea;',
       'uniform vec4 filterClamp;',
       'uniform vec2 origin;',

       'uniform sampler2D uSampler;',

       'void main(void) {',
       '   float time = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.x / (waveHeight / filterArea.x)) );',
       '   vec2 vCoord = vec2(vTextureCoord.x, vTextureCoord.y + time * UVSpeed);',
       '   gl_FragColor = texture2D(uSampler, clamp(vCoord, filterClamp.xy, filterClamp.zw));',
       '}'
     ].join('\n');

Both Axis Wave:

Code:
     var fragmentSrc = [
       'precision mediump float;',

       'varying vec2 vTextureCoord;',

       'uniform float waveHeight;',
       'uniform float waveFrequency;',
       'uniform float waveTime;',
       'uniform float wavePhase;',
       'uniform float UVSpeed;',

       'uniform vec4 filterArea;',
       'uniform vec4 filterClamp;',
       'uniform vec2 origin;',

       'uniform sampler2D uSampler;',

       'void main(void) {',
       '   float timeh = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.y / (waveHeight / filterArea.y)) );',
       '   float timev = waveFrequency * sin( wavePhase * (waveTime - vTextureCoord.x / (waveHeight / filterArea.x)) );',
       '   vec2 vCoord = vec2(vTextureCoord.x + timeh * UVSpeed, vTextureCoord.y + timev * UVSpeed);',

       '   gl_FragColor = texture2D(uSampler, clamp(vCoord, filterClamp.xy, filterClamp.zw));',
       '}'
     ].join('\n');

Oh, it is pretty brilliant. I need to do some research how to switch a method of vertically or horizontally in this plugin's flow dynamically.
 

Latest Threads

Latest Posts

Latest Profile Posts

It's been a long time since I was here but I have a lot of updates... btw I am teaching again about game programming and game design in some schools here in Brazil hahahaha It's good to see kids and teens learning this kind of thing!
welp, I literally can't continue working on ALEX now that my MZ trial is up (unless I somehow place in the jam which I don't remotely deserve to for my unfinished crap) so I am back on my bullshit
some test stuff. Empty for now. My other project (this project) needs more attention. The lagging really kicks up when I try to capture gameplay. ✨
Real-Time Battles, Pixel Filter, Animate Cursor & Menus & Windows | RPG Maker News #114

Forum statistics

Threads
113,887
Messages
1,078,210
Members
147,980
Latest member
gpc_826
Top