Esempio n. 1
0
    public void RenderAllPases(DeviceContext context, Action <RenderingPass> render)
    {
        context.Rasterizer.SetViewport(viewport);

        //One-sided Opaque pass
        standardTarget.SetAsTarget(context);
        oneSidedOpaquePassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.OneSidedOpaque, OutputMode.Standard));

        //One-sided Back-to-Front-Transparency Pass
        backToFrontTransparencyAllFacesPassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.OneSidedBackToFrontTransparent, OutputMode.Standard));

        //One-sided False-Depth Pass
        standardTarget.ClearDepth(context);
        standardTarget.SetAsDepthOnlyTarget(context);
        oneSidedOpaquePassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.OneSidedOpaque, OutputMode.FalseDepth));

        //Two-sided Opaque Pass
        standardTarget.SetAsTarget(context);
        twoSidedOpaquePassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.TwoSidedOpaque, OutputMode.Standard));

        //Two-sided Back-to-Front-Transparency Pass
        backToFrontTransparencyBackFacesPassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.TwoSidedBackToFrontTransparent, OutputMode.Standard));
        backToFrontTransparencyFrontFacesPassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.TwoSidedBackToFrontTransparent, OutputMode.Standard));

        //Switch to oit-blend target
        oitBlendTarget.CopyStandardDepthToBlendDepth(context, standardTarget.DepthResourceView);
        oitBlendTarget.SetAsTarget(context);

        //Unordered Transparency Blend Pass
        unorderedTransparencyPassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.UnorderedTransparent, OutputMode.WeightedBlendedOrderIndependent));

        //Resolve and composite
        standardTarget.SetResolveAsTarget(context);
        oitBlendTarget.Composite(context, standardTarget.RenderSourceView, standardTarget.DepthResourceView);

        postProcessor.PostProcess(context, standardTarget.ResolveSourceView);

        //Render UI
        backToFrontTransparencyAllFacesPassStates.Apply(context);
        render(new RenderingPass(RenderingLayer.UiElements, OutputMode.Standard));
    }
Esempio n. 2
0
        public void Document(_GithubMarkdown_Memo _memo, int _index, _GithubMarkdown_Args _args)
        {
            _GithubMarkdown_Item block = null;

            // AND 1
            int _start_i1 = _index;

            // STAR 3
            int _start_i3 = _index;
            var _res3     = Enumerable.Empty <MarkdownElementBase>();

label3:

            // CALLORVAR Block
            _GithubMarkdown_Item _r4;

            _r4 = _MemoCall(_memo, "Block", _index, Block, null);

            if (_r4 != null)
            {
                _index = _r4.NextIndex;
            }

            // STAR 3
            var _r3 = _memo.Results.Pop();

            if (_r3 != null)
            {
                _res3 = _res3.Concat(_r3.Results);
                goto label3;
            }
            else
            {
                _memo.Results.Push(new _GithubMarkdown_Item(_start_i3, _index, _memo.InputEnumerable, _res3.Where(_NON_NULL), true));
            }

            // BIND block
            block = _memo.Results.Peek();

            // AND shortcut
            if (_memo.Results.Peek() == null)
            {
                _memo.Results.Push(null); goto label1;
            }

            // CALLORVAR EOF
            _GithubMarkdown_Item _r5;

            _r5 = _MemoCall(_memo, "EOF", _index, EOF, null);

            if (_r5 != null)
            {
                _index = _r5.NextIndex;
            }

label1:     // AND
            var _r1_2 = _memo.Results.Pop();
            var _r1_1 = _memo.Results.Pop();

            if (_r1_1 != null && _r1_2 != null)
            {
                _memo.Results.Push(new _GithubMarkdown_Item(_start_i1, _index, _memo.InputEnumerable, _r1_1.Results.Concat(_r1_2.Results).Where(_NON_NULL), true));
            }
            else
            {
                _memo.Results.Push(null);
                _index = _start_i1;
            }

            // ACT
            var _r0 = _memo.Results.Peek();

            if (_r0 != null)
            {
                _memo.Results.Pop();
                _memo.Results.Push(new _GithubMarkdown_Item(_r0.StartIndex, _r0.NextIndex, _memo.InputEnumerable, _Thunk(_IM_Result => { MarkdownDocument root = new MarkdownDocument();
                                                                                                                                         //merge blockquote sequence
                                                                                                                                         MarkdownElementBase[] innerBlocks = block.Results.ToArray <MarkdownElementBase>();
                                                                                                                                         PostProcessor.PostProcess(innerBlocks, root);
                                                                                                                                         return(root); }, _r0), true));
            }
        }