Wave Filter

● ARCHIVED · READ-ONLY
Started by biud436 48 posts Page 3 of 3 View original ↗
  1. belatucadrus said:
    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.
  2. 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');
  3. BlueCloud said:
    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.
  4. Any chance of an MZ version?
  5. Gabezin said:
    Any chance of an MZ version?
    I'm trying. I hope to migrate all of plugins as MZ version, but I don't have time to work after I got a job.
  6. resolved, it was a conflict with the -ShoraLighting- plugin
    Basically, I removed the entire contents of the updateIntensityFilter(spriteset, disable) function from -SL-

    since RPGMZ was not able to process spriteset._baseSprite.filters as a function.

    this was a crappy way to solve the problem, i'm sure there are better ways, but it solved it for now.

    sorry for the inconvenience of the question before testing all my options, this will not happen again!


    Hey man, how are you? So, I'm really enjoying the effect I get using your plugin, but I encountered a problem, when I try to access the menu or start a fight, the game returns this error, when I disable the plugin everything works normally, any idea what could be causing this? Thanks in advance.