Esempio n. 1
0
        private void DrawOpaqueObjects(Camera camera)
        {
            List <Mesh.SubMesh> meshes = _visibleMeshes[(int)MeshMetadata.ERenderQueue.SkipGbuffer];

            for (int index = 0; index < meshes.Count; index++)
            {
                Mesh.SubMesh visibleMesh = meshes[index];
                visibleMesh.GenericRender(camera, GraphicsDevice);
            }
        }
Esempio n. 2
0
        private void DrawBlendObjects(Camera camera)
        {
            _graphicsDevice.DepthStencilState = DepthStencilState.DepthRead;
            _graphicsDevice.BlendState        = BlendState.Additive;

            List <Mesh.SubMesh> meshes = _visibleMeshes[(int)MeshMetadata.ERenderQueue.Blend];

            for (int index = 0; index < meshes.Count; index++)
            {
                Mesh.SubMesh visibleMesh = meshes[index];
                visibleMesh.GenericRender(camera, GraphicsDevice);
            }

            //reset states, since the custom shaders could have overriden them
            _graphicsDevice.DepthStencilState = DepthStencilState.DepthRead;
            _graphicsDevice.BlendState        = BlendState.Additive;
            _graphicsDevice.BlendFactor       = Color.White;
            _graphicsDevice.RasterizerState   = RasterizerState.CullCounterClockwise;

            Matrix projectionTransform = camera.ProjectionTransform;
            Matrix eyeTransform        = camera.EyeTransform;
        }