Using comparison (If statement, switch blocks) in materials

how are you supposed to use an If (or Switch) block that does not seems to function as such. Ie, input condition or comparison. tldr. keep the same login in the materials as in the main blueprints.

why do masked paper-2D sprites have an 1-pixel in-accuracy edge around if when masking by background color from the sprinte.

You could use a Custom node with hlsl-code: