Put shader code in macro. Calculate color opacity like Qt.