Vyxal, 2524 bytes
:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2v+∷+2(ømÞTṘømÞT
-3 bytes thanks to lyxal
-1 byte thanks to Unrelated String
:±+ʁ:±†vǔd$ʁ:v+∷+ṘR2v+∷+2(ømÞTṘømÞT Full Program; take in order b, a
: duplicate b
± sign
+ add (0 if b is 0, otherwise b+1)
ʁ range (0..x-1)
: duplicate
± sign ([0, 1, 1, ..., 1] of length 0 / b+1)
† logical NOT - [1, 0, 0, ..., 0]
vǔ vectorized rotate; identity matrix of size 0 / b+1
d double; [2, 0, 0], [0, 2, 0], [0, 0, 2]
$ swap a to TOS
ʁ range; 0..a-1
: duplicate
v+ add each; addition table; [2, 3, 4], [3, 4, 5], [4, 5, 6]
∷ parity; checkerboard of size a with 0 in top-left
+ add the two matrices together
Ṙ 2(....) reverse (fliprepeat vertical)twice
R Ṙ reverse (flip horizontal)
2(....vertical) repeat twice
øm palindromize (reflect vertical; do not copy middle)
ÞT transpose