def __setattr__(self, name, value):
        """
        Reload shader if required
        Args:
            name:
            value:

        Returns:

        """
        if hasattr(self, name):
            prev_value = getattr(self, name)
        else:
            prev_value = None
        super().__setattr__(name, value)
        if not self._shader_ready:
            return

        pbr_vars = [
            'max_lights',
            'use_normal_maps',
            'use_emission_maps',
            'enable_fog',
            'use_occlusion_maps',
        ]

        def resetup_tonemap():
            # Destroy previous buffers so we can re-create
            self.manager.cleanup()

            # Create a new FilterManager instance
            self.manager = FilterManager(self.window, self.camera_node)
            self._setup_tonemapping()

        if name in pbr_vars and prev_value != value:
            self._recompile_pbr()
        elif name == 'exposure':
            self.tonemap_quad.set_shader_input('exposure', self.exposure)
        elif name == 'msaa_samples':
            self._setup_tonemapping()
        elif name == 'render_node' and prev_value != value:
            self._recompile_pbr()
        elif name in ('camera_node', 'window') and prev_value != value:
            resetup_tonemap()
        elif name == 'use_330' and prev_value != value:
            self._set_use_330(value)
            self._recompile_pbr()
            resetup_tonemap()

        Reload shader if required
        Args:
            name:
            value:

        Returns:

        
metadrive/third_party/simplepbr/__init__.py