Exemple #1
0
        private void CreateRenderTargets(int width, int height)
        {
            Colors?.Dispose();
            Albedo?.Dispose();
            Normals?.Dispose();
            Depth?.Dispose();

#if OPENGL
            Colors  = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.HalfVector4, DepthFormat.Depth24Stencil8);
            Albedo  = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.HalfVector4, DepthFormat.Depth24Stencil8);
            Normals = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.HalfVector4, DepthFormat.Depth24Stencil8);
            Depth   = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Vector2, DepthFormat.Depth24Stencil8);
#else
            Colors  = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Rgba64, DepthFormat.Depth24Stencil8);
            Albedo  = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Rgba64, DepthFormat.Depth24Stencil8);
            Normals = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Rgba64, DepthFormat.Depth24Stencil8);
            Depth   = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Vector2, DepthFormat.Depth24Stencil8);
#endif
            _bufferTextureSize = new Vector2(width, height);
            _gBufferTargets    = new[] {
                new RenderTargetBinding(Colors),
                new RenderTargetBinding(Normals),
                new RenderTargetBinding(Depth),
                new RenderTargetBinding(Albedo)
            };

            _lightMap?.Dispose();
            _lightMap = new RenderTarget2D(GraphicsDevice, width, height, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
        }
Exemple #2
0
 public void Dispose()
 {
     Vertexes.Dispose();
     FaceIndexes.Dispose();
     TriangleOrder.Dispose();
     Normals.Dispose();
     Tangents.Dispose();
     Uvs.Dispose();
 }
Exemple #3
0
        public void Dispose()
        {
            MapWithNeighbours.Dispose();
            LightMapWithNeighbours.Dispose();
            LightLevelMap.Dispose();
            LitVoxels.Dispose();

            Vertices.Dispose();
            Normals.Dispose();
            Triangles.Dispose();
            Uvs.Dispose();
            Colors.Dispose();
        }
Exemple #4
0
        private void Dispose(bool disposing)
        {
            if (mDisposed)
            {
                return;
            }

            mDisposed = true;

            if (disposing)
            {
                Positions?.Dispose();
                Normals?.Dispose();
                Tangents?.Dispose();
                TexCoords0?.Dispose();
                TexCoords1?.Dispose();
                TexCoords2?.Dispose();
                TexCoords3?.Dispose();
                Colors0?.Dispose();
                Colors1?.Dispose();
            }

            GL.DeleteVertexArray(Id);
        }