@H6J0)N0]3_Y}ABTG1HP%%0.png (61.24 KB, 下载次数: 28)
2.26 KB, 下载次数: 15
1071257831 发表于 2022-8-23 08:11
插件看起来可以,
我给插件写了一个帮助方便用,如果有冒犯到了您,我会第一时间删除。
var frag2 = " \ varying vec2 vTextureCoord;\ uniform sampler2D uSampler;\ uniform float m_time;\ uniform float period;\ uniform float velocity;\ uniform float amplitude;\ uniform float brightness;\ float PI = 3.14159;\ void main(void){\ float v = sin((vTextureCoord.x - m_time * velocity) * 2.0 * PI * period);\ vec4 color = texture2D(uSampler, vTextureCoord + vec2(0.0, v * amplitude * vTextureCoord.x));\ \ if (color.a > 0.0) {\ float delta = sin((vTextureCoord.x + 0.001 - m_time * velocity) * 2.0 * PI * period) - v;\ if (delta < 0.0) {\ color = mix(color, vec4(1.0), -delta * brightness);\ }\ }\ gl_FragColor = color;\ }\ "; var simpleShader = new PIXI.Filter(vert, frag2); renderSprite._filters = [simpleShader]; var filter = renderSprite._filters[0].uniforms filter.period = 3.0 filter.amplitude = 0.04 filter.velocity = 0.3 filter.brightness = 8.0 filter.m_time = filterstate.m_time
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |