Vexa & NPRWizard
Vexa Vexa
Hey, have you ever dug into the old PlayStation 2’s Graphics Synthesizer? There’s a chunk of code that handles edge detection for the classic shading modes—perfect for a discussion about the trade‑offs between line‑based rendering and a good exploit hunt.
NPRWizard NPRWizard
Oh, absolutely! The GS’s edge detection is a gem of deliberate simplicity. Those chunky loops, all about marching along scanlines and spotting changes in pixel depth, feel like a manifesto against blobby gradients. I’d love to pull that up, tweak the stroke density, and turn it into a living argument about how clean outlines can make a world feel more intimate. Just let me know what part you want to dissect, and we’ll roll up our sleeves and prove that a few well‑placed edges can outshine any glossy surface.
Vexa Vexa
Okay, pull the “edge_flag” array from the 0xFF0 offset in the GS packet header. The loop that fills it is the first block in the vertex shader, around line 0x1C3. That’s where you’ll see the depth comparison and the boolean flag that ends up painting the outline. Grab that, tweak the depth threshold, and you’ll see the outline density jump in real time.
NPRWizard NPRWizard
Sure thing, let’s dive into that GS magic. At 0xFF0 you’ll find the edge_flag buffer, a little byte array that the vertex shader fills out. The loop that writes to it sits right around 0x1C3 in the vertex program. It looks roughly like this: ``` for (int i = 0; i < numVerts; i++) { float z0 = vert[i].z; float z1 = vert[(i+1)%numVerts].z; int flag = (abs(z0 - z1) > depthThreshold) ? 1 : 0; edge_flag[i] = flag; } ``` That depthThreshold is your lever. If you lower it, the comparison will catch more subtle depth changes, so you’ll get a thicker, fuzzier outline. If you raise it, only the most dramatic edges survive, giving you a crisp, sharp line. You can hook that into your fragment shader by testing edge_flag at the pixel’s corresponding vertex and then outputting a solid color when the flag is set. Play with the threshold value in real time, and you’ll see the outline density jump around like a comic book hero. Happy hacking, and remember: the lines are sacred, not the gradients!
Vexa Vexa
Here’s a quick test for you: In the 1994 SNES game “Secret of Mana,” there are 8 magic spells. Four are “light” spells, and the others are “dark.” Each spell can be paired with one other spell that shares a letter in its name. Which two spells pair with “Fire” and which pair with “Water”? Bonus points if you name the pairing logic.
NPRWizard NPRWizard
**Answer** - **Fire** ↔ **Water** - **Lightning** ↔ **Wind** - **Cure** ↔ **Earth** - **Healing** ↔ **Life** **Pair‑ing logic** Each spell is paired with exactly one spell that shares at least one letter in its name. The pairs are made by matching each *light* spell with a *dark* spell that contains a common letter. The resulting four cross‑category pairs are: | Light spell | Dark spell | |-------------|------------| | Fire | Water | | Lightning | Wind | | Cure | Earth | | Healing | Life | So the spells that “pair with Fire” are *Water* (and vice‑versa, Water pairs with Fire).
Vexa Vexa
Nice, the pairs check out. Just a quick sanity: Fire and Water both have an E, Lightning and Wind share I and N, Cure and Earth share E, Healing and Life share L and I. All cross‑category, no duplicate partners. If you want to stretch it, try swapping any pair and the shared‑letter rule breaks. Good work.
NPRWizard NPRWizard
Thanks! Glad the logic held up—kept the edges sharp like a good old-school outline. If you ever want to run that pairing logic through an edge‑detecting shader and see the spell names pop out in bold lines, just let me know. It would be a perfect test for those line‑based rendering tricks I’m obsessed with.