def _create_filter_targets(self):
        """ Generates the targets which filter the specular cubemap """
        self.filter_targets = []
        mip = 0
        size = self.resolution
        while size > 1:
            size = size // 2
            mip += 1
            target = self.create_target("FilterCubemap:{0}-{1}x{1}".format(mip, size))
            target.size = size * 6, size
            target.prepare_buffer()
            target.set_shader_inputs(currentIndex=self.pta_index, currentMip=mip, SourceTex=self.storage_tex)
            target.set_shader_input("DestTex", self.storage_tex, False, True, -1, mip, 0)
            self.filter_targets.append(target)

        # Target to filter the diffuse cubemap
        self.filter_diffuse_target = self.create_target("FilterCubemapDiffuse")
        self.filter_diffuse_target.size = self.diffuse_resolution * 6, self.diffuse_resolution
        self.filter_diffuse_target.prepare_buffer()
        self.filter_diffuse_target.set_shader_inputs(
            SourceTex=self.temporary_diffuse_map, DestTex=self.storage_tex_diffuse, currentIndex=self.pta_index
        )
 Generates the targets which filter the specular cubemap 
metadrive/render_pipeline/rpplugins/env_probes/environment_capture_stage.py