ThinkBoxly is the personal developer blog of Lucas Chasteen, author, programmer, artist, and always learning. Read more

Friday, April 20, 2018

Update 32 - Shader Business Revisited

I've spoken before about the importance of standardization in VNgen. It's so important, in fact, that multiple times I've discarded working solutions purely because they didn't conform well enough to established guidelines. A while back, one of these solutions involved using a shader to dim characters while they're not speaking—a method that was quickly replaced by blending in a transparent black rectangle instead. And yet, at the time, I said the effort to incorporate shaders into VNgen wasn't wasted, but that it served as a proof of concept for shaders possibly finding their way back into VNgen in the future.

Well, my friends, the future is now. That's right: as of version 0.9.8, shaders are now implemented into VNgen as first-class citizens alongside transitions, animations, deformations—the whole lot.


If you're familiar with shaders, I don't need to tell you what a big deal this is. If you're not, this might sound either completely insignificant or like total black magic. There's a lot of mystery surrounding shaders in popular game culture. See an unbelievably cool effect in your favorite game? Chock it up to shader wizardry.

Right? Well, not quite.

For one thing, there's usually a lot more going on than just shader tricks. For another, shaders are actually quite simple, in principle. You ready for it?

A shader modifies the position and/or color of vertices (3D) and/or pixels (2D).

That's really it. But don't let that explanation lower your opinion of shaders. It's the most fundamental abstractions in computing that often prove the most powerful. A similar example in this context would be the Quantum framework VNgen is built upon: Quantum generates numeric IDs for blocks of code and runs them in sequence—that's it. On its own, it doesn't sound that remarkable, but it's this very framework that makes VNgen possible, and VNgen is just one of many applications of the technology. The same is true for shaders.

The addition of shaders as a standard function of VNgen is, ironically, quite unlike anything that has come before. I have no idea how developers will use shaders to change the look and feel of VNgen. All I know is the sky's the limit.

Example shader effects included with VNgen. Click for full size.

Shadier and Shinier

And believe it or not, that's not all. VNgen has received numerous smaller updates as well which really add a lot of polish to the overall presentation and experience.

While the backlog may have been last devblog's theme, I didn't stop working on it after the article went up. One issue that has bothered me for a while now is that the backlog sources speaker names from text itself, not labels. That's all well and good, but it came with an unfortunate side effect: backlog name stylization completely ignored any labels active when the text was logged. It might sound like a simple fix, but depending on a VNgen developer's preferences, labels might not even exist. Or maybe more than one exists, and then how's the log supposed to know which label(s) to record? Coordinating text, labels, and backlog style data with any semblance of standardization was tricky, but in the end, I came across a solution that didn't require changing the way things work at all.

To replicate the same text font and colors in the backlog as were originally displayed, VNgen pulls data from two different sources: the engine's internal style database, and any inline markup the user has written into their text strings. To preserve label styles (if any), I added a new function which retrieves label style data and converts it to inline markup which is then injected into the speaker name string. The speaker name and text string are then concatenated and submitted as one into the backlog—everything nice and unified. And at last, backlog styles fully reflect events as they were originally recorded.

And these two features are just the tip of the iceberg. At version 0.9.8, VNgen is at long last getting very close to completion! In the meantime, you can still find it available in Early Access on both and the GameMaker Marketplace at a 33% discount, good until the v1.0 release—which is coming up soon, so act now!

And with that, I leave you with your weekly Yugure no Kagami status report. Expect big things to develop in this space in 2018!

Yugure no Kagami Status Report

What is Yugure no Kagami? Click here to learn more!
Script: 100%
Artwork: 1%
Music: 100%
Programming: 75%
Voice: 0%