godot-4.2
John Montagu, the 4th Earl of Sandvich 2023-09-10 17:51:55 -07:00
parent 25694724be
commit 93fd0eac9b
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
4 changed files with 16 additions and 12 deletions

View File

@ -60,9 +60,6 @@ public partial class DynamicDoorSwitch : StaticBody2D
RefreshMapState(newState); RefreshMapState(newState);
GD.Print($"Map state \"{MapStateKey}\" {oldState} -> {newState}"); GD.Print($"Map state \"{MapStateKey}\" {oldState} -> {newState}");
//var a = _animPlayer.CurrentAnimation;
//GetNode<Node2D>(nodePath).SetProcess(true);
} }
public void SetAnimations(bool isEnabled) public void SetAnimations(bool isEnabled)

View File

@ -14,7 +14,7 @@ uniform float angle : hint_range(-5, 5) = -0.3;
uniform float position = -0.2; uniform float position = -0.2;
uniform float spread : hint_range(0.0, 1.0) = 0.5; uniform float spread : hint_range(0.0, 1.0) = 0.5;
uniform float cutoff : hint_range(-1.0, 1.0) = 0.1; uniform float cutoff : hint_range(-1.0, 1.0) = 0.1;
uniform float falloff : hint_range(0.0, 1.0) = 0.2; uniform float falloff : hint_range(0.0, 2.0) = 0.2;
uniform float edge_fade : hint_range(0.0, 1.0) = 0.15; uniform float edge_fade : hint_range(0.0, 1.0) = 0.15;
uniform float speed = 1.0; uniform float speed = 1.0;
@ -29,6 +29,7 @@ uniform float seed = 5.0;
// Random and noise functions from Book of Shader's chapter on Noise. // Random and noise functions from Book of Shader's chapter on Noise.
float random(vec2 _uv) { float random(vec2 _uv) {
_uv += min(TIME,0.0);
return fract(sin(dot(_uv.xy, return fract(sin(dot(_uv.xy,
vec2(12.9898, 78.233))) * vec2(12.9898, 78.233))) *
43758.5453123); 43758.5453123);
@ -65,6 +66,15 @@ vec4 screen(vec4 base, vec4 blend){
return 1.0 - (1.0 - base) * (1.0 - blend); return 1.0 - (1.0 - base) * (1.0 - blend);
} }
float custom_smooth_step(float limit1, float limit2, float x) {
if (x <= limit1) {
return 0.0;
} else if (x >= limit2) {
return 1.0;
}
return (limit1 + x) / (limit1 + limit2);
}
void fragment() void fragment()
{ {
@ -93,7 +103,7 @@ void fragment()
} }
// Fade out edges // Fade out edges
rays *= smoothstep(0.0, falloff, (1.0 - UV.y)); // Bottom rays *= custom_smooth_step(0.0, falloff, (1.0 - UV.y)); // Bottom
rays *= smoothstep(0.0 + cutoff, edge_fade + cutoff, transformed_uv.x); // Left rays *= smoothstep(0.0 + cutoff, edge_fade + cutoff, transformed_uv.x); // Left
rays *= smoothstep(0.0 + cutoff, edge_fade + cutoff, 1.0 - transformed_uv.x); // Right rays *= smoothstep(0.0 + cutoff, edge_fade + cutoff, 1.0 - transformed_uv.x); // Right

View File

@ -10,11 +10,11 @@ shader_type canvas_item;
uniform vec4 tint_color : source_color; uniform vec4 tint_color : source_color;
uniform float alpha : hint_range(0.0, 1.0) = 0.75; uniform float alpha : hint_range(0.0, 1.0) = 0.75;
uniform sampler2D noise_texture : repeat_enable; uniform sampler2D noise_texture : repeat_enable;
uniform float speed : hint_range(0.0, 1.0) = 0.25; uniform float speed : hint_range(0.0, 32.0) = 0.25;
uniform float spread = 1; uniform float spread : hint_range(0.0, 1.0) = 1.0;
uniform float opposite_ray_mult = 1.0; uniform float opposite_ray_mult = 1.0;
uniform float negative_intensity = 1.0; uniform float negative_intensity = 1.0;
uniform float negative_ray_speed : hint_range(0.0, 1.0) = 0; uniform float negative_ray_speed : hint_range(0.0, 32.0) = 0;
uniform float cutoff : hint_range(0.0, 1.0) = 0; uniform float cutoff : hint_range(0.0, 1.0) = 0;
uniform float smooth_cutoff : hint_range(0.0, 1.0) = 0; uniform float smooth_cutoff : hint_range(0.0, 1.0) = 0;
uniform float y_cutoff : hint_range(0.0, 1.0) = 0; uniform float y_cutoff : hint_range(0.0, 1.0) = 0;

View File

@ -42,7 +42,6 @@ public partial class RangedChargeState : WeaponState
} }
Weapon.UseDirection = Weapon.Character.Target; Weapon.UseDirection = Weapon.Character.Target;
GD.Print(Weapon.UseDirection);
return null; return null;
} }
@ -54,11 +53,9 @@ public partial class RangedChargeState : WeaponState
if (progress > 0.5) if (progress > 0.5)
{ {
GD.Print("not enough");
return IdleState; return IdleState;
} }
GD.Print("firing");
FireState.VelocityModifier = (float)(1 - progress); FireState.VelocityModifier = (float)(1 - progress);
return FireState; return FireState;
} }