Re-organizing the Resources folder. Part 1. (#1234)
* First commit * Lockers * Lockers electric boogaloo * Crates and Lockers * Almost finishing the Textures folder * Updating texture paths. Reminder to fix: * Lockers * Windows * Vending Machines * APC * Catwalks * Bedsheets and Cloaks * Status effects * dont know what happened here * Commit before merge * re-organizing * Lockers broken * Commit before merge * Submodule * renaming * Fixing most issues * forgot these ones * Updating submodule * typo * Fixing some paths * fixing some paths * updating submodule * (hopefully) fixing the submodule
This commit is contained in:
17
Resources/Textures/Shaders/circle_mask.swsl
Normal file
17
Resources/Textures/Shaders/circle_mask.swsl
Normal file
@@ -0,0 +1,17 @@
|
||||
vec4 circle(in vec2 uv, in vec2 pos, float rad, in vec3 color) {
|
||||
float d = length(pos - uv) - rad;
|
||||
float t = clamp(d, 0.0, 1.0);
|
||||
return vec4(color, t);
|
||||
}
|
||||
void fragment(){
|
||||
vec2 uv = FRAGCOORD.xy;
|
||||
vec2 res_xy = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
|
||||
vec2 center = res_xy*0.5;
|
||||
float radius = 0.05 * res_xy.y;
|
||||
|
||||
vec4 layer1 = vec4(vec3(0), 0.0);
|
||||
|
||||
vec4 layer2 = circle(uv, center, radius, vec3(0));
|
||||
|
||||
COLOR = mix(layer1, layer2, layer2.a);
|
||||
}
|
||||
25
Resources/Textures/Shaders/cooldown.swsl
Normal file
25
Resources/Textures/Shaders/cooldown.swsl
Normal file
@@ -0,0 +1,25 @@
|
||||
light_mode unshaded;
|
||||
|
||||
const float PI = 3.14159265;
|
||||
|
||||
uniform float progress = 0.0;
|
||||
|
||||
void fragment() {
|
||||
vec4 col = texture(TEXTURE, UV);
|
||||
vec2 center = vec2(0.5,0.5);
|
||||
vec2 delta = UV.xy - center;
|
||||
|
||||
float angle = atan(delta.x, -delta.y) + PI;
|
||||
|
||||
float dist = length(delta);
|
||||
float dist_fwidth = fwidth(dist) * 0.67;
|
||||
|
||||
float dist_alpha = smoothstep(0.1-dist_fwidth, 0.1, abs(dist-0.35));
|
||||
|
||||
float angle_delta = (progress * PI * 2) - angle;
|
||||
float arc_length = angle_delta * dist;
|
||||
|
||||
float angle_alpha = progress > 0 ? smoothstep(dist_fwidth, 0.0, arc_length) : 0.0;
|
||||
|
||||
COLOR = vec4(col.xyz, 1-max(dist_alpha, angle_alpha));
|
||||
}
|
||||
18
Resources/Textures/Shaders/flashed_effect.swsl
Normal file
18
Resources/Textures/Shaders/flashed_effect.swsl
Normal file
@@ -0,0 +1,18 @@
|
||||
uniform float percentComplete;
|
||||
uniform float fadeFalloffExp = 8;
|
||||
|
||||
void fragment() {
|
||||
// Higher exponent -> stronger blinding effect
|
||||
float remaining = -pow(percentComplete, fadeFalloffExp) + 1;
|
||||
|
||||
// Two ghost textures that spin around the character
|
||||
vec4 tex1 = texture(TEXTURE, vec2(UV.x + (0.02) * sin(TIME * 3), UV.y + (0.02) * cos(TIME * 3)));
|
||||
vec4 tex2 = texture(TEXTURE, vec2(UV.x + (0.01) * sin(TIME * 2), UV.y + (0.01) * cos(TIME * 2)));
|
||||
|
||||
vec4 textureMix = mix(tex1, tex2, 0.5);
|
||||
|
||||
// Gradually mixes between the texture mix and a full-white texture, causing the "blinding" effect
|
||||
vec4 mixed = mix(vec4(1, 1, 1, 1), textureMix, percentComplete);
|
||||
|
||||
COLOR = vec4(mixed.rgb, remaining);
|
||||
}
|
||||
23
Resources/Textures/Shaders/gradient_circle_mask.swsl
Normal file
23
Resources/Textures/Shaders/gradient_circle_mask.swsl
Normal file
@@ -0,0 +1,23 @@
|
||||
uniform float percentagedistanceshow = 0.05;
|
||||
uniform float gradientfalloffwidth = 3.0;
|
||||
|
||||
vec4 circle(in vec2 uv, in vec2 pos, float rad, in vec3 color) {
|
||||
float d = length(pos - uv) - rad;
|
||||
float t = clamp(d, 0.0, 1.0);
|
||||
return vec4(color, t);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = FRAGCOORD.xy;
|
||||
vec2 res_xy = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
|
||||
vec2 center = res_xy*0.5;
|
||||
float radius = percentagedistanceshow * res_xy.y;
|
||||
|
||||
vec4 grad = vec4(0.8 - length( uv - center )/res_xy.y * gradientfalloffwidth);
|
||||
|
||||
vec4 layer1 = vec4(vec3(255.0),0.0);
|
||||
|
||||
vec4 layer2 = circle(uv, center, radius, grad.rgb);
|
||||
|
||||
COLOR = mix(layer1, layer2, layer2.a);
|
||||
}
|
||||
77
Resources/Textures/Shaders/outline.swsl
Normal file
77
Resources/Textures/Shaders/outline.swsl
Normal file
@@ -0,0 +1,77 @@
|
||||
// Taken from the godot-demo-projects repo.
|
||||
// GODOT ENGINE
|
||||
// http://www.godotengine.org
|
||||
//
|
||||
// ************************************************************************
|
||||
//
|
||||
// Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//************************************************************************
|
||||
|
||||
light_mode unshaded;
|
||||
//shader_type canvas_item;
|
||||
uniform float outline_width = 2.0;
|
||||
// TODO: implement that hint_color thingy.
|
||||
//uniform vec4 outline_color: hint_color;
|
||||
uniform vec4 outline_color=vec4(1,0,0,0.33);
|
||||
|
||||
void fragment() {
|
||||
vec4 col = texture(TEXTURE, UV);
|
||||
vec2 ps = TEXTURE_PIXEL_SIZE;
|
||||
float a;
|
||||
float maxa = col.a;
|
||||
float mina = col.a;
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(0, -outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(-outline_width, -outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(0, outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(outline_width, -outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(-outline_width,0)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(-outline_width, outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(outline_width, 0)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
a = texture(TEXTURE, UV + vec2(outline_width, outline_width)*ps).a;
|
||||
maxa = max(a, maxa);
|
||||
mina = min(a, mina);
|
||||
|
||||
COLOR = mix(col, outline_color, maxa-col.a);
|
||||
}
|
||||
3
Resources/Textures/Shaders/stencil_clear.swsl
Normal file
3
Resources/Textures/Shaders/stencil_clear.swsl
Normal file
@@ -0,0 +1,3 @@
|
||||
void fragment() {
|
||||
COLOR = vec4(0);
|
||||
}
|
||||
7
Resources/Textures/Shaders/stencil_mask.swsl
Normal file
7
Resources/Textures/Shaders/stencil_mask.swsl
Normal file
@@ -0,0 +1,7 @@
|
||||
void fragment() {
|
||||
if (texture(TEXTURE, UV).a == 0) {
|
||||
discard; // Discard if no alpha so that there's a hole in the stencil buffer.
|
||||
}
|
||||
|
||||
COLOR = vec4(0);
|
||||
}
|
||||
Reference in New Issue
Block a user