enve/examples/shaderEffects/eExplode.gre

40 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2019-08-24 15:07:28 +00:00
<!-- enve - 2D animations software -->
2020-01-02 19:46:10 +00:00
<!-- Copyright (C) 2016-2020 Maurycy Liebner -->
2019-08-24 15:07:28 +00:00
<!-- This program is free software: you can redistribute it and/or modify -->
<!-- it under the terms of the GNU General Public License as published by -->
<!-- the Free Software Foundation, either version 3 of the License, or -->
<!-- (at your option) any later version. -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program. If not, see <http://www.gnu.org/licenses/>. -->
<ShaderEffect name="Explode" menuPath="Examples">
<Properties>
<Property name="displacement" type="vec2" min="0" max="999" step="1" ini="10" resolutionScaled="true" influenceScaled="true"/>
<Property name="steps" type="int" min="1" max="99" step="1" ini="1" glValue="true"/>
<Property name="directions" type="int" min="1" max="99" step="1" ini="6" glValue="true"/>
</Properties>
2019-08-12 10:25:38 +00:00
<Script>
<Calculate>
var hDispl = displacement[0];
var vDispl = displacement[1];
var widthWithMargin = 2*hDispl + _eRect[2];
var heightWithMargin = 2*vDispl + _eRect[3];
extern displScaled = [hDispl/widthWithMargin, vDispl/heightWithMargin];
</Calculate>
</Script>
<glValues>
<glValue name="displacementXY" type="vec2" value="displScaled"/>
</glValues>
2019-08-12 10:25:38 +00:00
<Margin value="displacement"/>
</ShaderEffect>