フラグメントシェーダを使用して、すべてのオブジェクトに波効果を適用するプラグイン – RS_WaveFilter.js

タイトル
This plugin applies the wave effect to the all objects by using the Fragment Shader.
作者名
ヘルプ

=============================================================================
Sprite
=============================================================================
The following properties applies the wave effect to Sprite.
For Information, Refer to http://biud436.tistory.com/17

- wave : The default value is false.
- wave_amp : The default value is to 0.05
- wave_length : The default value is to a maxHeight (deprecated)
- wave_speed : The default value is to 0.25
- wave_phase : The default value is to 360

=============================================================================
Picture
=============================================================================
This plugin command would activate the wave effect to your picture:

PictureWave Start picture_id wave_speed wave_amp
- picture_id : Specify the id of the game picture.
- wave_speed : The available value is the number between 0 and 1.
(The default value is to 0.25)
- wave_amp : The available value is the number between 0 and 1.
(The default value is to 0.05)

This plugin command would deactivate the wave effect of your picture:

PictureWave Stop picture_id
- picture_id : Specify the id of the game picture.

=============================================================================
Tilemap
=============================================================================

The following plugin commands applies the wave effect to Tilemap.
This plugin contains these six types the plugin commands.

These plugin commands allow you to enable or disable the wave effect

TilemapWave Enable
TilemapWave Disable

This plugin command allows you to set the speed of the wave effect.
the x is a floating-point number between 0 and 2.
Default value is to 2.0. But the fragment shader does not use this value.

TilemapWave waveSpeed x

This plugin command allows you to set the amplitude of the wave effect.
the x is a floating-point number between 0 and 1.
Default value is to 0.02

TilemapWave waveFrequency x

This plugin command allows you to set the UV speed of the wave effect.
the x is a floating-point number between 0 and 1.
Default value is to 0.25

TilemapWave UVSpeed x

=============================================================================
Event Notetags
=============================================================================

Notetags :

These note tags allow you to enable or disable the wave effect.
<WAVE true>
<WAVE false>

This note tag allows you to set the amplitude of the wave effect.
the x is a floating-point number between 0 and 1.
the default value is to 0.02

<WAVE_AMP x>

This note tag allows you to set the speed of the wave effect.
the x is a floating-point number between 0 and 1.
the default value is to 0.25

<WAVE_SPEED x>

=============================================================================
Battle Notetags
=============================================================================

These note tags allow you to set the wave effect.
You have to put the note tags in the note area of the map properties.

<BATTLEBACK_WAVE : x y>

These values must replace by a real value such as 0.02
- x : the x value is the same as a waveFrequency.
- y : the y value is the same as a waveSpeed.

For Example :
<BATTLEBACK_WAVE : 0.02 0.25>

When using Yanfly's Action Sequence Pack 1, you can enable its filter too.
This function has the pointer of the Spriteset_Battle and easy to use.

eval: $gameTemp.setBattleBackWaveEffect(cond, waveAmp, waveSpeed);
- cond : Specify true or false whether the wave effect is used.
- waveAmp : the default value is to 0.02
- waveSpeed : the default value is to 0.25

=============================================================================
Timing
=============================================================================
if you want to fade-out or fade-in the properties of the wave effect applied to the picture,
Let's call the following function.

waveUtils.quadraticBezier(start, median, end, dt);

dt stands for delta time, The delta time parameter is the elapsed time since the last frame.
if you omit it, The wave filter will measure the elapsed time automatically
and fill it (In fact, It will be filled with the current time value)

To get started with implementing this, add this code just using the script command.

var _s, _p, _e, _r;
_s = new Point(0.0, 0.0);
_p = new Point(0.07, 0.25);
_e = new Point(0.0, 0.0);
_r = waveUtils.quadraticBezier(_s, _p, _e);
$gameScreen.startWave(1, _r.x, _r.y);

The value of the wave speed is started with 0.0 and then increased until 0.07 and then decreased to 0.0.
The value of the wave amplitude is also started with 0.0 and then increased until 0.25 and then decreased to 0.0.

=============================================================================
Change Log
=============================================================================
2016.01.14 (v1.0.0) - First Release.
2016.01.16 (v1.0.1) - Added the function to remove the filter.
2016.01.18 (v1.1.0) - Added the plugin command.
2016.01.22 (v1.2.0) - Fixed the Save and Load bug
2016.02.16 (v1.3.0) - Fixed Bug (After the player came back to Menu, you had to set the wave effect again)
2016.02.26 (v1.3.1) - Fixed the default padding value of the sprite. (default value is to 512)
2016.03.03 (v1.3.2) - Added new Sprite Properties (wave_amp, wave_speed, wave_length, wave_phase)
2016.08.17 (v1.4.0) - Fixed the issue that is not working in RMMV 1.3.0 (This filter does not support for the time being in Tile-map)
2016.08.18 (v1.5.0) - Supports a wave filter in ShaderTilemap.
2016.10.20 (v1.5.1) - Fixed the issue that is not working in RMMV 1.3.2
2016.11.10 (v1.5.2) - Fixed the issue that is not working in Orange Overlay plugin.
2016.11.18 (v1.5.3) - Fixed an issue where the original tilemap is rendered when using Orange Overlay plugin.
2016.11.26 (v1.5.4) - Added certain code to remove the texture from memory.
2016.11.30 (v1.5.5) - Fixed the issue that has the black border in a filter area.
2017.12.10 (v1.5.6) - Added the plugin command called 'PictureWave' (it is tested on 1.6.0 beta version)
2018.04.12 (v1.5.7) - Fixed a cutting issue.
2018.04.13 (v1.5.7c) - Added the event note tags that can have the wave effect directly for an event graphic.
2018.04.15 (v1.5.7e) - Added a new feature that can apply the wave filter in the battle background images
2018.04.25 (v1.5.7f) - Fixed the note tag error in Battle Test.
2018.05.09 (v1.5.8) - Fixed the bug that is not working the wave filter for the battleback image.
2018.11.01 (v1.5.9) :
- Fixed the issue that the wave filter is not working in the game picture.
- Fixed the issue that the wave effect do a horizontal looping likes as Tiling Sprite.
2018.11.29 (v1.5.10) :
- Fixed the bug that causes an error when calling Erase Event event command.
2019.02.24 (v1.5.11) :
- Fixed an issue that is not loaded a save file that you saved before using this script.
=============================================================================
Terms of Use
=============================================================================
Free for commercial and non-commercial use
パラメータ
date 2016.01.12

ライセンス表記
if you omit it, The wave filter will measure the elapsed time automatically
Free for commercial and non-commercial use
The MIT License
Copyright (c) 2016 biud436
Free for commercial and non commercial use.

紹介ページ https://github.com/biud436/MV/blob/master/RS_WaveFilter.js