diff --git a/Audio/midi/Song2.mid b/Audio/midi/Song2.mid index 41bf314c..8464b138 100644 Binary files a/Audio/midi/Song2.mid and b/Audio/midi/Song2.mid differ diff --git a/Classes/MidiMaestro/MidiMaestro.cs b/Classes/MidiMaestro/MidiMaestro.cs index 180117d6..dfc0b6e1 100644 --- a/Classes/MidiMaestro/MidiMaestro.cs +++ b/Classes/MidiMaestro/MidiMaestro.cs @@ -10,6 +10,9 @@ public partial class MidiMaestro : Resource { private MidiFile _midiFile; + public static TempoMap TempoMap; + public static TimeSignature TimeSignature; + //The four note rows that we care about private midiNoteInfo[] _upNotes; private midiNoteInfo[] _downNotes; @@ -28,10 +31,12 @@ public MidiMaestro(string filePath) if (!FileAccess.FileExists(filePath)) { - GD.PrintErr("ERROR: Unable to load level Midi file: " + filePath); + GD.PushError("ERROR: Unable to load level Midi file: " + filePath); } _midiFile = MidiFile.Read(filePath); + TempoMap = _midiFile.GetTempoMap(); + TimeSignature = TempoMap.GetTimeSignatureAtTime(new MidiTimeSpan()); //Strip out the notes from the midi file foreach (var track in _midiFile.GetTrackChunks()) @@ -39,7 +44,7 @@ public MidiMaestro(string filePath) string trackName = track.Events.OfType().FirstOrDefault()?.Text; midiNoteInfo[] noteEvents = track .GetNotes() - .Select(note => new midiNoteInfo(note, _midiFile.GetTempoMap())) + .Select(note => new midiNoteInfo(note)) .ToArray(); switch (trackName) @@ -77,19 +82,23 @@ public midiNoteInfo[] GetNotes(ArrowType arrowType) public class midiNoteInfo { private readonly Melanchall.DryWetMidi.Interaction.Note _note; - private readonly TempoMap _tempoMap; - public midiNoteInfo(Melanchall.DryWetMidi.Interaction.Note note, TempoMap tempoMap) + public midiNoteInfo(Melanchall.DryWetMidi.Interaction.Note note) { _note = note; - _tempoMap = tempoMap; + } + + public long GetStartTimeBeat() + { + var beatsBar = _note.TimeAs(MidiMaestro.TempoMap); + return beatsBar.Bars * MidiMaestro.TimeSignature.Numerator + beatsBar.Beats; } public long GetStartTimeTicks() => _note.Time; public float GetStartTimeSeconds() => - _note.TimeAs(_tempoMap).Milliseconds / 1000f - + _note.TimeAs(_tempoMap).Seconds; + _note.TimeAs(MidiMaestro.TempoMap).Milliseconds / 1000f + + _note.TimeAs(MidiMaestro.TempoMap).Seconds; public long GetEndTime() => _note.EndTime; diff --git a/Globals/BGAudioPlayer.tscn b/Globals/BgAudioPlayer/BGAudioPlayer.tscn similarity index 60% rename from Globals/BGAudioPlayer.tscn rename to Globals/BgAudioPlayer/BGAudioPlayer.tscn index 932b5464..bd56bf4f 100644 --- a/Globals/BGAudioPlayer.tscn +++ b/Globals/BgAudioPlayer/BGAudioPlayer.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://csx04jwaoo20u"] -[ext_resource type="Script" path="res://Globals/BgAudioPlayer.cs" id="1_w7def"] +[ext_resource type="Script" path="res://Globals/BgAudioPlayer/BgAudioPlayer.cs" id="1_w7def"] [node name="BgAudioPlayer" type="AudioStreamPlayer"] script = ExtResource("1_w7def") diff --git a/Globals/BgAudioPlayer.cs b/Globals/BgAudioPlayer/BgAudioPlayer.cs similarity index 100% rename from Globals/BgAudioPlayer.cs rename to Globals/BgAudioPlayer/BgAudioPlayer.cs diff --git a/Globals/translations.csv b/Globals/Translations/translations.csv similarity index 100% rename from Globals/translations.csv rename to Globals/Translations/translations.csv diff --git a/Globals/Translations/translations.csv.import b/Globals/Translations/translations.csv.import new file mode 100644 index 00000000..eeffcdc3 --- /dev/null +++ b/Globals/Translations/translations.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://drjnsd6mqpxqh" + +[deps] + +files=["res://Globals/Translations/translations.en.translation", "res://Globals/Translations/translations.cn.translation"] + +source_file="res://Globals/Translations/translations.csv" +dest_files=["res://Globals/Translations/translations.en.translation", "res://Globals/Translations/translations.cn.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/Globals/translations.csv.import b/Globals/translations.csv.import deleted file mode 100644 index c1c79034..00000000 --- a/Globals/translations.csv.import +++ /dev/null @@ -1,17 +0,0 @@ -[remap] - -importer="csv_translation" -type="Translation" -uid="uid://drjnsd6mqpxqh" - -[deps] - -files=["res://Globals/translations.en.translation", "res://Globals/translations.cn.translation"] - -source_file="res://Globals/translations.csv" -dest_files=["res://Globals/translations.en.translation", "res://Globals/translations.cn.translation"] - -[params] - -compress=true -delimiter=0 diff --git a/project.godot b/project.godot index ebf3de32..bad04179 100644 --- a/project.godot +++ b/project.godot @@ -24,13 +24,13 @@ buses/default_bus_layout="" StageProducer="*res://Globals/StageProducer.cs" TimeKeeper="*res://Globals/TimeKeeper.cs" Scribe="*res://Globals/Scribe.cs" -BgAudioPlayer="*res://Globals/BGAudioPlayer.tscn" +BgAudioPlayer="*res://Globals/BgAudioPlayer/BGAudioPlayer.tscn" [display] window/size/viewport_width=640 window/size/viewport_height=360 -window/stretch/mode="viewport" +window/stretch/mode="canvas_items" window/stretch/scale_mode="integer" [dotnet] @@ -191,7 +191,7 @@ QWERT_arrowRight={ [internationalization] -locale/translations=PackedStringArray("res://Globals/translations.cn.translation", "res://Globals/translations.en.translation") +locale/translations=PackedStringArray("res://Globals/Translations/translations.cn.translation", "res://Globals/Translations/translations.en.translation") [rendering] diff --git a/scenes/BattleDirector/NotePlacementBar.tscn b/scenes/BattleDirector/NotePlacementBar.tscn index b0935a83..7404aebc 100644 --- a/scenes/BattleDirector/NotePlacementBar.tscn +++ b/scenes/BattleDirector/NotePlacementBar.tscn @@ -60,8 +60,8 @@ script = ExtResource("1_456es") notePlacementBar = NodePath("ProgressBar") currentComboMultText = NodePath("TextEdit") _particles = NodePath("ProgressBar/Rock") -_currentNote = NodePath("NoteQueueSprite/NextNote") -_nextNote = NodePath("NoteQueueSprite/CurrentNote") +_currentNote = NodePath("NoteQueueSprite/CurrentNote") +_nextNote = NodePath("NoteQueueSprite/NextNote") fullBarParticles = NodePath("ProgressBar/CPUParticles2D") [node name="ProgressBar" type="TextureProgressBar" parent="."] diff --git a/scenes/BattleDirector/assets/bgupdate.png b/scenes/BattleDirector/assets/bgupdate.png index 68b7ee08..e82dc57c 100644 Binary files a/scenes/BattleDirector/assets/bgupdate.png and b/scenes/BattleDirector/assets/bgupdate.png differ diff --git a/scenes/BattleDirector/notePoofParticles.tscn b/scenes/BattleDirector/notePoofParticles.tscn new file mode 100644 index 00000000..12ee818e --- /dev/null +++ b/scenes/BattleDirector/notePoofParticles.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=5 format=3 uid="uid://k21psn7b5sxf"] + +[ext_resource type="Texture2D" uid="uid://cdf3g3174du4r" path="res://Classes/Notes/assets/heal_note.png" id="1_hjrch"] + +[sub_resource type="Curve" id="Curve_xix4e"] +_data = [Vector2(0, 1), 0.0, 1.4, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_h7u0t"] +curve = SubResource("Curve_xix4e") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_k0qar"] +lifetime_randomness = 0.25 +particle_flag_disable_z = true +emission_shape = 2 +emission_sphere_radius = 3.0 +spread = 180.0 +initial_velocity_min = 30.77 +initial_velocity_max = 61.55 +gravity = Vector3(0, 0, 0) +tangential_accel_min = -100.0 +tangential_accel_max = 85.12 +scale_curve = SubResource("CurveTexture_h7u0t") + +[node name="NotePoof" type="GPUParticles2D"] +emitting = false +amount = 10 +process_material = SubResource("ParticleProcessMaterial_k0qar") +texture = ExtResource("1_hjrch") +lifetime = 0.75 +one_shot = true +preprocess = 0.1 +explosiveness = 1.0 diff --git a/scenes/BattleDirector/scripts/Conductor.cs b/scenes/BattleDirector/scripts/Conductor.cs index 2a5e010f..118b7eca 100644 --- a/scenes/BattleDirector/scripts/Conductor.cs +++ b/scenes/BattleDirector/scripts/Conductor.cs @@ -56,6 +56,7 @@ public bool AddNoteToLane(ArrowType type, int beat, Note note, bool isActive = t else { arrow = CM.AddArrowToLane(type, beat, newNote, new Color(1, 0.43f, 0.26f)); + NoteQueueParticlesFactory.NoteParticles(arrow, note.Texture, .5f); } if (!isActive) @@ -87,11 +88,7 @@ private void AddExampleNotes() { foreach (midiNoteInfo mNote in MM.GetNotes(type)) { - AddNoteToLane( - type, - (int)(mNote.GetStartTimeSeconds() / (60 / (double)TimeKeeper.Bpm)), - Scribe.NoteDictionary[0] - ); + AddNoteToLane(type, (int)mNote.GetStartTimeBeat(), Scribe.NoteDictionary[0]); } } } diff --git a/scenes/BattleDirector/scripts/NotePlacementBar.cs b/scenes/BattleDirector/scripts/NotePlacementBar.cs index e05d64dc..8adec792 100644 --- a/scenes/BattleDirector/scripts/NotePlacementBar.cs +++ b/scenes/BattleDirector/scripts/NotePlacementBar.cs @@ -38,7 +38,7 @@ public partial class NotePlacementBar : Node //Juice - https://www.youtube.com/watch?v=LGt-jjVf-ZU private int _limiter; private Vector2 _barInitPosition; - private float _randomStrength = 1f; + private float _baseShake = 1f; private float _shakeFade = 10f; private RandomNumberGenerator _rng = new(); private float _shakeStrength; @@ -50,7 +50,7 @@ private void ProcessShake(double delta) return; if (_currentBarValue >= MaxValue) { - _shakeStrength = _randomStrength; + _shakeStrength = _baseShake; } if (_shakeStrength > 0) { @@ -136,15 +136,19 @@ private void UpdateNoteQueue() private Note GetNote(bool getNextNote = false) { Note result; + Sprite2D selectedNote; if (!getNextNote) { + selectedNote = _currentNote; result = _currentNoteInstance; _currentNoteInstance = null; } else { + selectedNote = _nextNote; result = _noteQueue.Dequeue(); } + NoteQueueParticlesFactory.NoteParticles(selectedNote, selectedNote.Texture); ProgressQueue(); return result; } @@ -157,7 +161,6 @@ public void HitNote() _currentBarValue = Math.Min(_currentBarValue + comboMult, MaxValue); UpdateNotePlacementBar(_currentBarValue); UpdateComboMultText(); - //fullBarParticles.Emitting = CanPlaceNote(); } // Missing a note resets combo diff --git a/scenes/BattleDirector/scripts/NoteQueueParticlesFactory.cs b/scenes/BattleDirector/scripts/NoteQueueParticlesFactory.cs new file mode 100644 index 00000000..dfe3af60 --- /dev/null +++ b/scenes/BattleDirector/scripts/NoteQueueParticlesFactory.cs @@ -0,0 +1,28 @@ +using System; +using Godot; + +public static class NoteQueueParticlesFactory +{ + private static PackedScene particlesScene = null; + + public static GpuParticles2D NoteParticles( + Node parent, + Texture2D texture, + float amountModifier = 1 + ) + { + particlesScene ??= GD.Load( + "res://scenes/BattleDirector/notePoofParticles.tscn" + ); + + GpuParticles2D particles = particlesScene.Instantiate(); + + parent.AddChild(particles); + particles.Amount = (int)(particles.Amount * amountModifier); + particles.Texture = texture; + particles.Emitting = true; + particles.Finished += () => particles.QueueFree(); + + return particles; + } +} diff --git a/scenes/BattleDirector/scripts/TextParticle.cs b/scenes/BattleDirector/scripts/TextParticle.cs index b582f353..a2a1b402 100644 --- a/scenes/BattleDirector/scripts/TextParticle.cs +++ b/scenes/BattleDirector/scripts/TextParticle.cs @@ -6,7 +6,7 @@ public partial class TextParticle : Label // Called when the node enters the scene tree for the first time. public override void _Ready() { - Tween tween = GetTree().CreateTween(); + Tween tween = CreateTween(); ZIndex = 2; Position += Vector2.Left * (GD.Randf() * 40 - 20); tween.SetTrans(Tween.TransitionType.Elastic); diff --git a/scenes/ChartViewport/scripts/ChartManager.cs b/scenes/ChartViewport/scripts/ChartManager.cs index b2ab47f0..dfe177c1 100644 --- a/scenes/ChartViewport/scripts/ChartManager.cs +++ b/scenes/ChartViewport/scripts/ChartManager.cs @@ -60,7 +60,7 @@ public void PrepChart(SongData songData) public void BeginTweens() { //This could be good as a function to call on something, to have many things animated to the beat. - var tween = GetTree().CreateTween(); + var tween = CreateTween(); tween .TweenMethod( Callable.From((Vector2 scale) => TweenArrows(scale)), @@ -110,14 +110,13 @@ private NoteArrow CreateNote(ArrowType arrow, Note note, int beat = 0, int loopO { var noteScene = ResourceLoader.Load("res://scenes/NoteManager/note.tscn"); NoteArrow newArrow = noteScene.Instantiate(); + newArrow.Bounds = (float)( + beat / TrueBeatsPerLoop * (ChartLength / 2) + loopOffset * (ChartLength / 2) + ); newArrow.Init(IH.Arrows[(int)arrow], beat, note); newArrow.OutlineSprite.Modulate = IH.Arrows[(int)arrow].Color; _arrowGroup.AddChild(newArrow); - newArrow.Bounds = (float)( - beat / TrueBeatsPerLoop * (ChartLength / 2) + loopOffset * (ChartLength / 2) - ); - newArrow.Position += Vector2.Right * newArrow.Bounds * 10; //temporary fix for notes spawning and instantly calling loop from originating at 0,0 return newArrow; } @@ -129,12 +128,4 @@ public void ComboText(string text, ArrowType arrow, int currentCombo) IH.FeedbackEffect(arrow, text); newText.Text = text + $" {currentCombo}"; } - - public override void _ExitTree() - { - foreach (var tween in GetTree().GetProcessedTweens()) - { - tween.Stop(); - } - } } diff --git a/scenes/ChestScene/ChestScene.tscn b/scenes/ChestScene/ChestScene.tscn index 8ca2051e..2d5b32f1 100644 --- a/scenes/ChestScene/ChestScene.tscn +++ b/scenes/ChestScene/ChestScene.tscn @@ -8,11 +8,11 @@ [ext_resource type="Texture2D" uid="uid://d0ywqw1j1k71v" path="res://scenes/ChestScene/assets/Chest.png" id="6_58hf4"] [ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://scenes/BattleDirector/assets/BattleFrame1.png" id="7_kkck7"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_4lvcv"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_8x17a"] shader = ExtResource("5_whthd") shader_parameter/bg_top_color = Vector4(0.18, 0.08, 0.12, 0) shader_parameter/bg_bottom_color = Vector4(0.028, 0.008, 0.184, 0) -shader_parameter/gradient_ratio = 1.22 +shader_parameter/gradient_ratio = 1.0 shader_parameter/time_scale = 1.0 [node name="ChestScene" type="Node2D" node_paths=PackedStringArray("ChestButton")] @@ -33,15 +33,6 @@ offset_right = 640.0 offset_bottom = 178.0 texture = ExtResource("6_37nar") -[node name="StarShader" type="ColorRect" parent="."] -z_index = -1 -material = SubResource("ShaderMaterial_4lvcv") -offset_top = 180.0 -offset_right = 255.0 -offset_bottom = 262.0 -scale = Vector2(2.18, 2.18) -color = Color(0, 0, 0, 1) - [node name="BattleFrame" type="TextureRect" parent="."] z_index = 1 offset_top = 178.0 @@ -55,3 +46,23 @@ offset_top = 126.0 offset_right = 431.0 offset_bottom = 166.0 icon = ExtResource("6_58hf4") + +[node name="SubViewportContainer" type="SubViewportContainer" parent="."] +z_index = -2 +offset_top = 178.0 +offset_right = 560.0 +offset_bottom = 358.0 + +[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"] +handle_input_locally = false +size = Vector2i(560, 180) +render_target_update_mode = 4 + +[node name="StarShader" type="ColorRect" parent="SubViewportContainer/SubViewport"] +z_index = -1 +material = SubResource("ShaderMaterial_8x17a") +offset_left = -60.0 +offset_right = 415.0 +offset_bottom = 177.0 +scale = Vector2(2.18, 2.18) +color = Color(0, 0, 0, 1) diff --git a/scenes/NoteManager/scripts/NoteArrow.cs b/scenes/NoteManager/scripts/NoteArrow.cs index cfaa638c..dc7a827d 100644 --- a/scenes/NoteManager/scripts/NoteArrow.cs +++ b/scenes/NoteManager/scripts/NoteArrow.cs @@ -26,7 +26,7 @@ public void Init(ArrowData parentArrowData, int beat, Note note) Type = parentArrowData.Type; Beat = beat; - Position += Vector2.Down * (parentArrowData.Node.GlobalPosition.Y); + Position = new Vector2(GetNewPos(), parentArrowData.Node.GlobalPosition.Y); RotationDegrees = parentArrowData.Node.RotationDegrees; IconSprite.Texture = note.Texture; IconSprite.Rotation = -Rotation; @@ -35,12 +35,7 @@ public void Init(ArrowData parentArrowData, int beat, Note note) public override void _Process(double delta) { Vector2 newPos = Position; - newPos.X = - (float)( - (-TimeKeeper.CurrentTime / TimeKeeper.LoopLength * TimeKeeper.ChartLength) - % TimeKeeper.ChartLength - / 2 - ) + Bounds; + newPos.X = GetNewPos(); if (newPos.X > Position.X) { OnLoop(); @@ -48,6 +43,15 @@ public override void _Process(double delta) Position = newPos; } + private float GetNewPos() + { + return (float)( + (-TimeKeeper.CurrentTime / TimeKeeper.LoopLength * TimeKeeper.ChartLength) + % TimeKeeper.ChartLength + / 2 + ) + Bounds; + } + private void OnLoop() { if (!IsActive) diff --git a/scenes/Puppets/scripts/PuppetTemplate.cs b/scenes/Puppets/scripts/PuppetTemplate.cs index 4ea7ba96..441f80c7 100644 --- a/scenes/Puppets/scripts/PuppetTemplate.cs +++ b/scenes/Puppets/scripts/PuppetTemplate.cs @@ -43,25 +43,83 @@ public override void _Ready() } } + public override void _Process(double delta) + { + ProcessShake(delta); + } + public void Init(Texture2D texture, string name) { Sprite.Texture = texture; UniqName = name; } + //Juice - https://www.youtube.com/watch?v=LGt-jjVf-ZU + private int _limiter; + private const float BaseShake = 100f; + private float _shakeFade = 10f; + private float _shakeStrength; + private float _baseAnimDuration = 0.1f; + + private void ProcessShake(double delta) + { + _limiter = (_limiter + 1) % 3; + if (_limiter != 1) + return; + + if (_shakeStrength > 0) + { + _shakeStrength = (float)Mathf.Lerp(_shakeStrength, 0, _shakeFade * delta); + } + Position = + StartPos + + new Vector2( + (float)GD.RandRange(-_shakeStrength, _shakeStrength), + (float)GD.RandRange(-_shakeStrength, _shakeStrength) + ); + } + + protected virtual void DamageAnimate(int amount) + { //TODO: Make animate in time with bpm + float damageAnimDir = (GetViewportRect().Size / 2 - Position).Normalized().X; + float scalar = (float)amount / _maxHealth; + _shakeStrength = (scalar * BaseShake); + + Color flashColor = Colors.White * 99; //White = neutral modulate, very white is higher contrast white + if (amount < 0) //If healing + { + flashColor = Colors.Green; + damageAnimDir = 0; + _shakeStrength = 0; + } + + var tween = CreateTween(); + tween.SetTrans(Tween.TransitionType.Spring); + tween.TweenProperty(this, "modulate", flashColor, _baseAnimDuration); + tween.Chain().TweenProperty(this, "modulate", Colors.White, _baseAnimDuration); + tween.Parallel(); + tween + .TweenProperty( + this, + "position:x", + -(damageAnimDir * 2) * (2 + scalar), + _baseAnimDuration + ) + .AsRelative(); + tween.Chain().TweenProperty(this, "position", StartPos, 2 * _baseAnimDuration); + } + public virtual void TakeDamage(int amount) { - if (_currentHealth <= 0) - return; //TEMP Only fire once. amount = Math.Max(0, amount); //Should not be able to heal from damage. + if (_currentHealth <= 0 || amount == 0) + return; //TEMP Only fire once. _currentHealth = _healthBar.ChangeHP(-amount); + DamageAnimate(amount); if (_currentHealth <= 0) { Defeated?.Invoke(this); } - - if (amount == 0) - return; TextParticle newText = new TextParticle(); newText.Modulate = Colors.Red; Sprite.AddChild(newText); @@ -71,9 +129,10 @@ public virtual void TakeDamage(int amount) public virtual void Heal(int amount) { _currentHealth = _healthBar.ChangeHP(amount); - + amount = Math.Max(0, amount); //Should not be able to damage from heal. if (amount == 0) return; + DamageAnimate(-amount); TextParticle newText = new TextParticle(); newText.Modulate = Colors.Green; Sprite.AddChild(newText); diff --git a/scenes/SceneTransitions/TitleScreen.tscn b/scenes/SceneTransitions/TitleScreen.tscn index c1bdf192..ac913199 100644 --- a/scenes/SceneTransitions/TitleScreen.tscn +++ b/scenes/SceneTransitions/TitleScreen.tscn @@ -28,10 +28,6 @@ shader = ExtResource("11_ht0dv") shader_parameter/height = 10.0 shader_parameter/speed = 2.0 shader_parameter/freq = 10.0 -shader_parameter/bg_top_color = null -shader_parameter/bg_bottom_color = null -shader_parameter/gradient_ratio = 0.0 -shader_parameter/time_scale = null [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4croe"] particle_flag_disable_z = true @@ -110,11 +106,9 @@ texture = ExtResource("2_cf582") z_index = -1 material = SubResource("ShaderMaterial_cbpjr") layout_mode = 0 -offset_left = -223.0 -offset_top = -200.0 -offset_right = 252.0 -offset_bottom = -23.0 -scale = Vector2(3.78, 3.82) +offset_right = 475.0 +offset_bottom = 177.0 +scale = Vector2(2, 2) color = Color(0, 0, 0, 1) [node name="SecretLabel" type="Label" parent="."] diff --git a/scenes/SceneTransitions/assets/TitleFont.gdshader b/scenes/SceneTransitions/assets/TitleFont.gdshader index 338546fb..bf474d7e 100644 --- a/scenes/SceneTransitions/assets/TitleFont.gdshader +++ b/scenes/SceneTransitions/assets/TitleFont.gdshader @@ -4,48 +4,6 @@ uniform float height = 5.0; uniform float speed = 5.0f; uniform float freq = 10.0f; -uniform vec3 bg_top_color; -uniform vec3 bg_bottom_color; -uniform float gradient_ratio; -uniform float time_scale; - -float rand(vec2 st) { - return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123); -} - void vertex() { - // Called for every vertex the material is visible on. VERTEX.y -= height * sin((TIME * speed) + (freq * UV.x)); -} - -void fragment() { - - float color = 0.0f; - - if (COLOR.rgb == vec3(1)){ - if (rand(SCREEN_UV.xy / 20.0) > 0.996){ - COLOR.rbg = vec3(1); - }else { - vec3 gradient = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio); - COLOR.rgb = gradient; - } - /* - if (rand(SCREEN_UV.xy / 20.0) > 0.996) - { - float r = rand(SCREEN_UV.xy); - color = r * (0.85 * sin((TIME * time_scale) * (r * 5.0) + 720.0 * r) + 0.95); - } - - vec4 gradient_color = mix(bg_top_color, bg_bottom_color, SCREEN_UV.y / gradient_ratio); - COLOR = vec4(vec3(color),1.0) + gradient_color; - */ - - - } - // Called for every pixel the material is visible on. -} - -//void light() { - // Called for every pixel for every light affecting the CanvasItem. - // Uncomment to replace the default light processing function with this one. -//} +} \ No newline at end of file diff --git a/scenes/SceneTransitions/assets/font.TTF.import b/scenes/SceneTransitions/assets/font.TTF.import index bb476e0a..0990f323 100644 --- a/scenes/SceneTransitions/assets/font.TTF.import +++ b/scenes/SceneTransitions/assets/font.TTF.import @@ -16,12 +16,12 @@ Rendering=null antialiasing=0 generate_mipmaps=false disable_embedded_bitmaps=true -multichannel_signed_distance_field=false +multichannel_signed_distance_field=true msdf_pixel_range=8 msdf_size=48 allow_system_fallback=true force_autohinter=false -hinting=1 +hinting=0 subpixel_positioning=0 oversampling=0.0 Fallbacks=null diff --git a/scenes/SceneTransitions/assets/transparentStars.gdshader b/scenes/SceneTransitions/assets/transparentStars.gdshader index d3ad0aff..2e94695e 100644 --- a/scenes/SceneTransitions/assets/transparentStars.gdshader +++ b/scenes/SceneTransitions/assets/transparentStars.gdshader @@ -13,8 +13,8 @@ void fragment() { if (rand(SCREEN_UV.xy / 20.0) > 0.996) { float r = rand(SCREEN_UV.xy); star_intensity = r * (0.85 * sin((TIME * time_scale) * (r * 5.0) + 720.0 * r) + 0.95); - alpha = star_intensity; + alpha = star_intensity; } - + COLOR = vec4(vec3(star_intensity), alpha); }