Skip to content

Commit a2b347e

Browse files
MaybeMaruAbnormalPoof
authored andcommitted
Improve note batching
1 parent 4317f12 commit a2b347e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

source/funkin/play/notes/NoteSprite.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ class NoteSprite extends FunkinSprite
185185
{
186186
noteStyle.buildNoteSprite(this);
187187

188-
this.shader = hsvShader;
189-
190188
// `false` disables the update() function for performance.
191189
this.active = noteStyle.isNoteAnimated();
192190
}
@@ -239,11 +237,13 @@ class NoteSprite extends FunkinSprite
239237
public function desaturate():Void
240238
{
241239
this.hsvShader.saturation = 0.2;
240+
this.shader = this.hsvShader;
242241
}
243242

244243
public function setHue(hue:Float):Void
245244
{
246245
this.hsvShader.hue = hue;
246+
if (hue != 1.0) this.shader = this.hsvShader;
247247
}
248248

249249
public override function revive():Void
@@ -259,6 +259,9 @@ class NoteSprite extends FunkinSprite
259259
this.handledMiss = false;
260260
this.holdNoteSprite = null;
261261

262+
// The hsvShader should only be applied when it's necessary.
263+
// Otherwise, it should be turned off to keep note batching.
264+
this.shader = null;
262265
this.hsvShader.hue = 1.0;
263266
this.hsvShader.saturation = 1.0;
264267
this.hsvShader.value = 1.0;

0 commit comments

Comments
 (0)