Post
by LameGuy64 » March 21st, 2016, 6:18 pm
The way how the PlayStation handles semi-transparency is a bit tricky but it can be figured out. All graphical primitives that use textures have a flag that tells the GPU to do semi-transparent blending or not and another flag that tells which blending method should be used.
Each pixel (in a 16-bit texture) or CLUT color (in a 4-bit/8-bit texture) has a semi-transparency bit which is placed at the very end of a 16-bit color value because the RGB color values only take up the first 15 bits. This bit is used as a special flag for both non-blended and blended drawing of the texture image.
The logic as to how the semi-transparency bit affects the pixel is as follows (full-black means all RGB components are 0):
-- If Semi-Transparent mode is off --
Full-black without STP bit = Transparent (alpha = 0)
Full-black with STP bit = Opaque black (alpha = 255)
Non full-black without STP bit = Solid color (alpha = 255)
Non full-black with STP bit = Solid color (alpha = 255)
-- If Semi-Transparent is on --
Full-black without STP bit = Transparent (alpha = 0)
Full-black with STP bit = Semi-transparent black (alpha = 127)
Non full-black without STP bit = Solid color (alpha = 255)
Non full-black with STP bit = Semi-transparent color (alpha = 127)
I'm not sure how you can convert the colors to other blending modes (blend modes 1-3) as the only way to achieve that is to use a different blending algorithm used when your TGA image is drawn.
Please don't forget to include my name if you share my work around. Credit where it is due.
Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.
DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.