nmlgc / ssg

秋霜玉 / Shuusou Gyoku
MIT License
20 stars 5 forks source link

Staff member sprites should be alpha-blended individually #18

Open nmlgc opened 1 year ago

nmlgc commented 1 year ago

In the original game, they are rendered to a separate, larger rectangle that is then faded out as a whole. This cuts into the ending image on the left:

Blended staff members Notice how the staff member rectangle partly covers the gray shape in the left image with VIVIT.

Unblended staff members With fully opaque staff member sprites, it looks correct.

nmlgc commented 11 months ago

This one is caused by the extra font renderer unconditionally blitting pixels to the DirectDraw back buffer without taking the color key into account.

The easiest fix here involves removing the entire extra font system and using the game's regular blitting functions for these sprites. The system is only needed for the double-spiral moiré animation that didn't get used in the final build. It would also be hard to port to non-DirectDraw renderers since the effect directly writes pixels into the back buffer. It would need to be rendered using either:

We will already have to deal with the same problem for the 西方Project lens ball animation, and it's not worth doing that a second time for an unused effect. By moving the code to the unused/ directory and pointing to the blog post with the video, we can still "preserve" the effect without having to actively compile it into the game.

nmlgc commented 11 months ago

Whoops, turns out that this bug is exclusive to the non-palettized 16-bit and 32-bit modes, and generally does not appear in 8-bit mode. With that out of the way, we can find the cause quite easily. It's this set of draw calls that alpha-blend a large black rectangle over the staff roll sprites: https://github.com/nmlgc/ssg/blob/17894644715b372468f73b52eea1078e93b03344/GIAN07/ENDING.CPP#L402-L424