reworked for multiple rendering engines