Шейдер ударной волны для взрывов (#633)
* Adds shock wave shader (#2631) Co-authored-by: DOOM <N/A> Co-authored-by: Whisper <121047731+QuietlyWhisper@users.noreply.github.com> * add explosive shockwave * add shockwave to fireball * wd edit * cleanup * remove exgreande beeping sound --------- Co-authored-by: Vero <73014819+vero5123@users.noreply.github.com> Co-authored-by: Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Taken from cmss13 at https://github.com/cmss13-devs/cmss13/blob/add6123ac6b3263f257e4b233ef5a8fea5d3d317/icons/effects/explosion.dmi",
|
||||
"size": {
|
||||
"x": 48,
|
||||
"y": 48
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "grenade",
|
||||
"delays": [
|
||||
[
|
||||
0.1,
|
||||
0.1,
|
||||
0.1,
|
||||
0.1,
|
||||
0.1,
|
||||
0.1,
|
||||
0.1,
|
||||
0.1
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 298 B |
|
After Width: | Height: | Size: 259 B |
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 298 B |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Taken from cmss13 at https://github.com/cmss13-devs/cmss13/blob/a86a9e2e57e5c00195cab704713a4962e8bc973a/icons/obj/items/weapons/projectiles.dmi",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "autocannon"
|
||||
},
|
||||
{
|
||||
"name": "buckshot"
|
||||
},
|
||||
{
|
||||
"name": "beanbag"
|
||||
},
|
||||
{
|
||||
"name": "flechette"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Taken from cmss13 at https://github.com/cmss13-devs/cmss13/blob/a86a9e2e57e5c00195cab704713a4962e8bc973a/icons/obj/items/weapons/projectiles.dmi",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "shrapnelshot"
|
||||
},
|
||||
{
|
||||
"name": "shrapnelshot_bit"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_glass"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_light"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_xeno"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_human"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_human1"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_human2"
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_bright1",
|
||||
"delays": [
|
||||
[
|
||||
0.1,
|
||||
0.1,
|
||||
0.1
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "shrapnel_bright2",
|
||||
"delays": [
|
||||
[
|
||||
0.1,
|
||||
0.1,
|
||||
0.1
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 548 B |
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 257 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 204 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 245 B |
40
Resources/Textures/White/Shaders/shock_wave.swsl
Normal file
@@ -0,0 +1,40 @@
|
||||
uniform sampler2D SCREEN_TEXTURE;
|
||||
uniform highp vec2 renderScale;
|
||||
uniform lowp int count;
|
||||
uniform highp vec2[10] position;
|
||||
uniform highp float[10] sharpness;
|
||||
uniform highp float[10] width;
|
||||
uniform highp float[10] falloffPower;
|
||||
|
||||
void fragment() {
|
||||
highp vec2 coord = FRAGCOORD.xy * SCREEN_PIXEL_SIZE.xy;
|
||||
highp float ratio = SCREEN_PIXEL_SIZE.y / SCREEN_PIXEL_SIZE.x * 0.6;
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
highp vec2 WaveCentre = position[i];
|
||||
|
||||
highp float Dist = distance(
|
||||
vec2(coord.x, coord.y * ratio),
|
||||
vec2(WaveCentre.x, WaveCentre.y * ratio)
|
||||
);
|
||||
|
||||
// removes the first few frames of the "animation"
|
||||
Dist = max(Dist, 0.13);
|
||||
|
||||
highp float offset = (TIME - floor(TIME)) / TIME;
|
||||
highp float CurrentTime = TIME * offset;
|
||||
|
||||
if (Dist <= (CurrentTime + 0.1) && Dist >= (CurrentTime - 0.1)) {
|
||||
highp float Diff = Dist - CurrentTime;
|
||||
highp float ScaleDiff = 1.0 - pow(abs(Diff * sharpness[i]), width[i]);
|
||||
highp float DiffTime = Diff * ScaleDiff;
|
||||
highp vec2 DiffTexCoord = normalize(coord - WaveCentre);
|
||||
coord += (DiffTexCoord * DiffTime) / (CurrentTime * Dist * falloffPower[i]);
|
||||
highp vec4 Color = zTextureSpec(SCREEN_TEXTURE, coord);
|
||||
Color += (Color * ScaleDiff) / (CurrentTime * Dist * 40.0);
|
||||
COLOR = Color;
|
||||
} else {
|
||||
COLOR = zTextureSpec(SCREEN_TEXTURE, UV);
|
||||
}
|
||||
}
|
||||
}
|
||||