SNES programming tutorial. Example 12.
https://github.com/nesdoug/SNES_12
This page is under construction.
Links.
http://www.romhacking.net/documents/428/
https://wiki.superfamicom.org/transparency
No effect. Main screen.
Just the Sub screen. (seen by setting the “clipping always to black” bits in the color math logic, and adding the sub screen).
Note, the top left is black (non-zero index). The bottom left is zero index (transparent). The bottom right is nearly black (non-zero index). The sub screen will show the “fixed color” (register 2132) where there is transparent. Right now it is black. Note, color halving will not work for a transparent pixel. If you notice, the bottom left square will not change at all for these examples (except the fixed color one)… even when halving is indicated.
BG1 main, BG2 sub, adding.
BG1 main, BG2 sub, adding and halving.
BG1 main, BG2 sub, subtracting.
BG1 main, BG2 sub, subtracting and halving.
Fixed color only (red at 50%), adding.
Other examples
Color math only affects some sprites. Only sprites that use palettes 4-7 are affected by color math. That is why Mario (and the little ghosts) are solid.
Windowing can affect where the color math applies. With HDMA adjusting the window, you can make some cool effects.
Tint the whole screen (adding a fixed color)
Smooth Transparencies (add and halving). This is the most common transparency effect on the SNES.
Sparkster, the water.
And creating shadows (subtracting) Mortal Kombat II. It’s hard to tell, but their shadows are created by color math subtraction. You could also give the appearance of clouds moving overhead by subtracting a cloud shape and having it scroll.
Subscreen.
Transparency.
Code.
(Links)