def _set_render_mode(self, mode_id, special, value):
        """ Callback which gets called when a render mode got selected """
        if not value:
            return

        to_remove = []
        for define in self._pipeline.stage_mgr.defines:
            if define.startswith("_RM_"):
                to_remove.append(define)
        for define in to_remove:
            del self._pipeline.stage_mgr.defines[define]

        if mode_id == "":
            self._pipeline.stage_mgr.defines["ANY_DEBUG_MODE"] = 0
        else:
            # Don't activate the generic debugging mode for special modes. This
            # is for modes like luminance which expect the scene to be rendered
            # unaltered.
            self._pipeline.stage_mgr.defines["ANY_DEBUG_MODE"] = 0 if special else 1
            self._pipeline.stage_mgr.defines["_RM_" + mode_id] = 1

        self._selected_mode = mode_id
        self._pipeline.reload_shaders()
 Callback which gets called when a render mode got selected 
metadrive/render_pipeline/rpcore/gui/render_mode_selector.py