Ejemplo n.º 1
0
    def setup(self, create_fbos=True):
        super().setup(False)
        self.spot_id_t = TextureArray(
            (self.spot_resolution, self.spot_resolution), self.max_spots,
            GL_R32F)
        self.sun_id_t = TextureArray(
            (self.sun_resolution, self.sun_resolution),
            self.max_suns * self.sun_cascades, GL_R32F)
        self.point_id_t = CubeMapArray(
            (self.point_resolution, self.point_resolution), self.max_points,
            GL_R32F)

        if create_fbos:
            self.spot_fbos = []
            for i in range(self.spot_depth_t.length):
                self.spot_fbos.append(
                    RenderTarget([ArrayLayerTarget(self.spot_id_t, i)],
                                 ArrayLayerTarget(self.spot_depth_t, i)))

            self.sun_fbos = []
            for i in range(self.sun_depth_t.length):
                self.sun_fbos.append(
                    RenderTarget([ArrayLayerTarget(self.sun_id_t, i)],
                                 ArrayLayerTarget(self.sun_depth_t, i)))

            self.point_fbos = []
            for i in range(self.point_depth_t.length * 6):
                self.point_fbos.append(
                    RenderTarget([ArrayLayerTarget(self.point_id_t, i)],
                                 ArrayLayerTarget(self.point_depth_t, i)))
Ejemplo n.º 2
0
    def setup(self, create_fbos=True):
        self.spot_depth_t = TextureArray(
            (self.spot_resolution, self.spot_resolution), self.max_spots,
            GL_DEPTH_COMPONENT32F)
        self.sun_depth_t = TextureArray(
            (self.sun_resolution, self.sun_resolution), self.max_suns,
            GL_DEPTH_COMPONENT32F)
        self.point_depth_t = CubeMapArray(
            (self.point_resolution, self.point_resolution), self.max_points,
            GL_DEPTH_COMPONENT32F)

        if create_fbos:
            self.spot_fbos = []
            for i in range(self.spot_depth_t.length):
                self.spot_fbos.append(
                    RenderTarget([], ArrayLayerTarget(self.spot_depth_t, i)))

            self.sun_fbos = []
            for i in range(self.sun_depth_t.length):
                self.sun_fbos.append(
                    RenderTarget([], ArrayLayerTarget(self.sun_depth_t, i)))

            self.point_fbos = []
            for i in range(self.point_depth_t.length * 6):
                self.point_fbos.append(
                    RenderTarget([], ArrayLayerTarget(self.point_depth_t, i)))