示例#1
0
        public RenderPipeline(Game game)
        {
            _renderList = new RenderList();

            var graphicsDevice = game.GraphicsDevice;

            _globalShaderResources    = game.ContentManager.ShaderResources.Global;
            _globalShaderResourceData = AddDisposable(new GlobalShaderResourceData(game.GraphicsDevice, _globalShaderResources));

            _renderItemConstantsBufferVS = AddDisposable(new ConstantBuffer <MeshShaderResources.RenderItemConstantsVS>(graphicsDevice, "RenderItemConstantsVS"));
            _renderItemConstantsBufferPS = AddDisposable(new ConstantBuffer <MeshShaderResources.RenderItemConstantsPS>(graphicsDevice, "RenderItemConstantsPS"));

            _renderItemConstantsResourceSet = AddDisposable(graphicsDevice.ResourceFactory.CreateResourceSet(
                                                                new ResourceSetDescription(
                                                                    game.ContentManager.ShaderResources.Mesh.RenderItemConstantsResourceLayout,
                                                                    _renderItemConstantsBufferVS.Buffer,
                                                                    _renderItemConstantsBufferPS.Buffer)));

            _commandList = AddDisposable(graphicsDevice.ResourceFactory.CreateCommandList());

            _drawingContext = AddDisposable(new DrawingContext2D(
                                                game.ContentManager,
                                                BlendStateDescription.SingleAlphaBlend,
                                                GameOutputDescription));

            _shadowMapRenderer = AddDisposable(new ShadowMapRenderer(game.GraphicsDevice, game.ContentManager.ShaderResources.Global));

            _textureCopier = AddDisposable(new TextureCopier(
                                               game,
                                               game.Panel.OutputDescription));
        }
示例#2
0
        public RenderPipeline(Game game)
        {
            _renderList = new RenderList();

            var graphicsDevice = game.GraphicsDevice;

            _loadContext = game.GraphicsLoadContext;

            _globalShaderResources    = game.GraphicsLoadContext.ShaderResources.Global;
            _globalShaderResourceData = AddDisposable(new GlobalShaderResourceData(game.GraphicsDevice, _globalShaderResources, game.GraphicsLoadContext.StandardGraphicsResources));

            _commandList = AddDisposable(graphicsDevice.ResourceFactory.CreateCommandList());

            _drawingContext = AddDisposable(new DrawingContext2D(
                                                game.ContentManager,
                                                game.GraphicsLoadContext,
                                                BlendStateDescription.SingleAlphaBlend,
                                                GameOutputDescription));

            _shadowMapRenderer = AddDisposable(new ShadowMapRenderer(game.GraphicsDevice));
            _waterMapRenderer  = AddDisposable(new WaterMapRenderer(game.AssetStore, _loadContext, game.GraphicsDevice, game.GraphicsLoadContext.ShaderResources.Global));

            _textureCopier = AddDisposable(new TextureCopier(
                                               game,
                                               game.Panel.OutputDescription));
        }
示例#3
0
        public RenderPipeline(GraphicsDevice graphicsDevice)
        {
            _renderList = new RenderList();

            _depthStencilBufferCache = AddDisposable(new DepthStencilBufferCache(graphicsDevice));

            _globalConstantBufferShared  = AddDisposable(new ConstantBuffer <GlobalConstantsShared>(graphicsDevice));
            _globalConstantBufferVS      = AddDisposable(new ConstantBuffer <GlobalConstantsVS>(graphicsDevice));
            _renderItemConstantsBufferVS = AddDisposable(new ConstantBuffer <RenderItemConstantsVS>(graphicsDevice));
            _globalConstantBufferPS      = AddDisposable(new ConstantBuffer <GlobalConstantsPS>(graphicsDevice));
            _globalLightingTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstants>(graphicsDevice));
            _globalLightingObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstants>(graphicsDevice));
        }
示例#4
0
        public RenderPipeline(Game game)
        {
            _renderList = new RenderList();

            var graphicsDevice = game.GraphicsDevice;

            _globalConstantBufferShared    = AddDisposable(new ConstantBuffer <GlobalConstantsShared>(graphicsDevice));
            _globalConstantBufferVS        = AddDisposable(new ConstantBuffer <GlobalConstantsVS>(graphicsDevice));
            _renderItemConstantsBufferVS   = AddDisposable(new ConstantBuffer <RenderItemConstantsVS>(graphicsDevice));
            _globalConstantBufferPS        = AddDisposable(new ConstantBuffer <GlobalConstantsPS>(graphicsDevice));
            _globalLightingVSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice));
            _globalLightingPSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice));
            _globalLightingVSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice));
            _globalLightingPSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice));

            _spriteBatch = AddDisposable(new SpriteBatch(game.ContentManager, graphicsDevice.SwapchainFramebuffer.OutputDescription));

            _commandList = AddDisposable(graphicsDevice.ResourceFactory.CreateCommandList());
        }
示例#5
0
        public RenderPipeline(Game game)
        {
            _renderList = new RenderList();

            var graphicsDevice = game.GraphicsDevice;

            _globalConstantBufferShared    = AddDisposable(new ConstantBuffer <GlobalConstantsShared>(graphicsDevice, "GlobalConstantsShared"));
            _globalConstantBufferVS        = AddDisposable(new ConstantBuffer <GlobalConstantsVS>(graphicsDevice, "GlobalConstantsVS"));
            _renderItemConstantsBufferVS   = AddDisposable(new ConstantBuffer <RenderItemConstantsVS>(graphicsDevice, "RenderItemConstantsVS"));
            _renderItemConstantsBufferPS   = AddDisposable(new ConstantBuffer <RenderItemConstantsPS>(graphicsDevice, "RenderItemConstantsPS"));
            _globalConstantBufferPS        = AddDisposable(new ConstantBuffer <GlobalConstantsPS>(graphicsDevice, "GlobalConstantsPS"));
            _globalLightingVSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice, "GlobalLightingConstantsVS (terrain)"));
            _globalLightingPSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice, "GlobalLightingConstantsPS (terrain)"));
            _globalLightingVSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice, "GlobalLightingConstantsVS (objects)"));
            _globalLightingPSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice, "GlobalLightingConstantsPS (objects)"));
            _shadowConstantsPSBuffer       = AddDisposable(new ConstantBuffer <ShadowConstantsPS>(graphicsDevice, "ShadowConstantsPS"));

            _commandList = AddDisposable(graphicsDevice.ResourceFactory.CreateCommandList());

            _drawingContext = AddDisposable(new DrawingContext2D(
                                                game.ContentManager,
                                                BlendStateDescription.SingleAlphaBlend,
                                                GameOutputDescription));

            _shadowSampler = AddDisposable(graphicsDevice.ResourceFactory.CreateSampler(
                                               new SamplerDescription(
                                                   SamplerAddressMode.Clamp,
                                                   SamplerAddressMode.Clamp,
                                                   SamplerAddressMode.Clamp,
                                                   SamplerFilter.MinLinear_MagLinear_MipLinear,
                                                   ComparisonKind.LessEqual,
                                                   0,
                                                   0,
                                                   0,
                                                   0,
                                                   SamplerBorderColor.OpaqueBlack)));

            _shadowMapRenderer = AddDisposable(new ShadowMapRenderer());

            _intermediateSpriteBatch = AddDisposable(new SpriteBatch(game.ContentManager, BlendStateDescription.SingleDisabled, game.GraphicsDevice.MainSwapchain.Framebuffer.OutputDescription));
        }
示例#6
0
        public RenderPipeline(Game game)
        {
            _renderList = new RenderList();

            var graphicsDevice = game.GraphicsDevice;

            _globalConstantBufferShared    = AddDisposable(new ConstantBuffer <GlobalConstantsShared>(graphicsDevice, "GlobalConstantsShared"));
            _globalConstantBufferVS        = AddDisposable(new ConstantBuffer <GlobalConstantsVS>(graphicsDevice, "GlobalConstantsVS"));
            _renderItemConstantsBufferVS   = AddDisposable(new ConstantBuffer <RenderItemConstantsVS>(graphicsDevice, "RenderItemConstantsVS"));
            _globalConstantBufferPS        = AddDisposable(new ConstantBuffer <GlobalConstantsPS>(graphicsDevice, "GlobalConstantsPS"));
            _globalLightingVSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice, "Global_LightingConstantsVS (terrain)"));
            _globalLightingPSTerrainBuffer = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice, "Global_LightingConstantsPS (terrain)"));
            _globalLightingVSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsVS>(graphicsDevice, "Global_LightingConstantsVS (objects)"));
            _globalLightingPSObjectBuffer  = AddDisposable(new ConstantBuffer <LightingConstantsPS>(graphicsDevice, "Global_LightingConstantsPS (objects)"));

            _commandList = AddDisposable(graphicsDevice.ResourceFactory.CreateCommandList());

            _drawingContext = AddDisposable(new DrawingContext2D(
                                                game.ContentManager,
                                                BlendStateDescription.SingleAlphaBlend,
                                                GameOutputDescription));
        }
示例#7
0
 public BuildingRenderListEventArgs(RenderList renderList, CameraComponent camera)
 {
     RenderList = renderList;
     Camera     = camera;
 }
示例#8
0
 internal BuildingRenderListEventArgs(RenderList renderList, Camera camera, in TimeInterval gameTime)