cancellationtoken register

CancellationToken.Register(): The Observer Pattern You Already Know

Checking IsCancellationRequested works, but it only works if something is actively looking. A loop mid-await will notice eventually. But what about code that isn’t looping at all — a resource that just needs to clean itself up the moment cancellation happens, with nobody polling it? That’s what Register() is for. Instead of asking “has this […]

Read More
cancellationtoken

CancellationTokenSource in Unity: Why “Stop” Doesn’t Always Stop

Have you ever clicked Stop and watched your code keep running anyway? That’s not a bug. It’s a loop that was never given a way to check. It doesn’t ignore you on purpose — it simply never asked, so it never looks. Fixing this doesn’t require a redesign. It takes one object, threaded through the […]

Read More

Shaping functions in GLSL (A quick visual reference)

I’ve been going through The Book of Shaders, and chapter 5 on shaping functions stood out enough that I wanted to summarize it. These functions show up constantly in real shader work — masks, transitions, procedural patterns, sensor thresholding — so I built two small interactive graphs to actually see what each one does instead of […]

Read More
ObserverPattern

When Should the View Just… React? Wiring Observer Pattern to a Health Bar

I almost didn’t need Observer pattern for this. A health bar is small — one int, one slider, one button. It would have been faster to just call view.SetSliderValue() directly from wherever health changes. That’s exactly the problem. “Wherever health changes” turns out to be more than one place the moment you add a second damage source, […]

Read More
RetainerBoxInvalidationBox

Retainer Box vs Invalidation Box: What 10,000 Updating Widgets Taught Me About UMG Performance

After looking at draw calls on the GPU side with Static Mesh vs Instanced Static Mesh, I wanted to look at the other half of the picture: UMG. “Wrap your static UI in a Retainer Box or Invalidation Box” is common advice, but I’d never actually measured what either one buys you, or how they […]

Read More
RenderPipelineOptimizationISM

Static Mesh vs Instanced Static Mesh: What 10,000 Cubes Taught Me About Draw Calls

When people talk about render pipeline optimization, “use instancing” comes up as standard advice almost immediately. I wanted to actually test it myself rather than just repeat it. I ran a direct comparison in Unreal Engine and learned a few things along the way that the advice alone doesn’t tell you! The setup The test […]

Read More