def _compute_weighting(self):
        """ Precomputes the weights & indices, and stores them in a texture """
        indices_a = [[0 for i in range(self.size)] for k in range(self.log2_size)]
        indices_b = [[0 for i in range(self.size)] for k in range(self.log2_size)]
        weights = [[Vec2(0.0) for i in range(self.size)] for k in range(self.log2_size)]

        # Pre-Generating indices ..
        self._generate_indices(indices_a, indices_b)
        self._reverse_row(indices_a[0])
        self._reverse_row(indices_b[0])

        # Pre-Generating weights .."
        self._generate_weights(weights)

        # Create storage for the weights & indices
        self.weights_lookup = PNMImage(self.size, self.log2_size, 4)
        self.weights_lookup.setMaxval((2**16) - 1)
        self.weights_lookup.fill(0.0)

        # Populate storage
        for x in range(self.size):
            for y in range(self.log2_size):
                index_a = indices_a[y][x]
                index_b = indices_b[y][x]
                weight = weights[y][x]

                self.weights_lookup.set_red(x, y, index_a / float(self.size))
                self.weights_lookup.set_green(x, y, index_b / float(self.size))
                self.weights_lookup.set_blue(x, y, weight.x * 0.5 + 0.5)
                self.weights_lookup.set_alpha(x, y, weight.y * 0.5 + 0.5)

        # Convert storage to texture so we can use it in a shader
        self.weights_lookup_tex = Texture("Weights Lookup")
        self.weights_lookup_tex.load(self.weights_lookup)
        self.weights_lookup_tex.set_format(Texture.FRgba16)
        self.weights_lookup_tex.set_minfilter(Texture.FTNearest)
        self.weights_lookup_tex.set_magfilter(Texture.FTNearest)
        self.weights_lookup_tex.set_wrap_u(Texture.WMClamp)
        self.weights_lookup_tex.set_wrap_v(Texture.WMClamp)
 Precomputes the weights & indices, and stores them in a texture 
metadrive/render_pipeline/rpcore/water/gpu_fft.py