Brightness is now correct - I have no idea why this factor of 1/0.85 is needed - something must reduce the brightness of the entire scene but I have no idea what.
* the palette shader was not bound.
* the palette textures were not bound.
* palette mode still used regular lighting on top of the palette emulation
This works a lot better than before but is still not complete.