Beispiel #1
0
        public void TickLogic(CGfxCamera Camera, View.CGfxSceneView view, CRenderContext RHICtx)
        {
            var CmdList = CommitingCMDs;

            if (mScreenAlignedTriangle != null)
            {
                mScreenView.CookViewportMeshToPass(RHICtx, mShadingEnv, Camera, mScreenAlignedTriangle);
                mScreenView.PushPassToRHI(CmdList);
            }
        }
Beispiel #2
0
        public override void Cleanup()
        {
            mCommandList_Final.Cleanup();
            mCommandList_Final = null;

            mCaptureSV.Cleanup();
            mCaptureSV = null;

            base.Cleanup();
        }
Beispiel #3
0
        public CPass TickLogic(CGfxCamera Camera, View.CGfxSceneView view, CRenderContext rc, int DPLimitter, bool GraphicsDebug)
        {
            var CmdList = CommitingCMDs;

            if (CmdList == null)
            {
                return(null);
            }
            using (var i = mLayerParameter.GetEnumerator())
            {
                while (i.MoveNext())
                {
                    var parameter = i.Current.Value;
                    mBaseSceneView.CookSpecRenderLayerDataToPass(rc, parameter.Layer, Camera, parameter.ShadingEnv, parameter.PassIndex);
                    mBaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, parameter.Layer);
                }
            }

            CmdList.BeginCommand();
            CmdList.BeginRenderPass(mRenderPassDesc, mBaseSceneView.FrameBuffer);

            if (BeforeBuildRenderPass != null)
            {
                BeforeBuildRenderPass(Camera, view, rc, CmdList, DPLimitter, GraphicsDebug);
            }

            var LatestPass = CmdList.BuildRenderPass(DPLimitter, GraphicsDebug);

            if (AfterBuildRenderPass != null)
            {
                AfterBuildRenderPass(Camera, view, rc, CmdList, DPLimitter, GraphicsDebug);
            }

            CmdList.EndRenderPass();
            CmdList.EndCommand();

            return(LatestPass);
        }
Beispiel #4
0
        public override async Task <bool> Init(CRenderContext RHICtx, uint width, uint height, CGfxCamera camera, IntPtr WinHandle)
        {
            await Thread.AsyncDummyClass.DummyFunc();

            mViewWidth  = width;
            mViewHeight = height;

            var viewInfo = new View.CGfxSceneViewInfo();

            viewInfo.mUseDSV = true;
            viewInfo.Width   = width;
            viewInfo.Height  = height;
            viewInfo.mDSVDesc.Init();
            viewInfo.mDSVDesc.Format = EPixelFormat.PXF_D24_UNORM_S8_UINT;
            viewInfo.mDSVDesc.Width  = width;
            viewInfo.mDSVDesc.Height = height;

            var rtDesc = new CRenderTargetViewDesc();

            rtDesc.Init();
            rtDesc.Format = EPixelFormat.PXF_R8G8B8A8_UNORM;// .PXF_R32_UINT;
            rtDesc.Width  = width;
            rtDesc.Height = height;
            viewInfo.mRTVDescArray.Add(rtDesc);
            viewInfo.mRTVDescArray.Add(rtDesc);

            mCaptureSV = new View.CGfxSceneView();
            if (false == mCaptureSV.Init(RHICtx, null, viewInfo))
            {
                return(false);
            }

            mRenderPassDesc_SceneCapture = new CRenderPassDesc();
            FrameBufferClearColor TempClearColor0 = new FrameBufferClearColor();

            TempClearColor0.r = 1.0f;
            TempClearColor0.g = 1.0f;
            TempClearColor0.b = 1.0f;
            TempClearColor0.a = 1.0f;
            FrameBufferClearColor TempClearColor1 = new FrameBufferClearColor();

            TempClearColor1.r = 0.0f;
            TempClearColor1.g = 0.0f;
            TempClearColor1.b = 0.0f;
            TempClearColor1.a = 0.0f;

            mRenderPassDesc_SceneCapture.mFBLoadAction_Color    = FrameBufferLoadAction.LoadActionClear;
            mRenderPassDesc_SceneCapture.mFBStoreAction_Color   = FrameBufferStoreAction.StoreActionStore;
            mRenderPassDesc_SceneCapture.mFBClearColorRT0       = TempClearColor0;
            mRenderPassDesc_SceneCapture.mFBClearColorRT1       = TempClearColor1;
            mRenderPassDesc_SceneCapture.mFBLoadAction_Depth    = FrameBufferLoadAction.LoadActionClear;
            mRenderPassDesc_SceneCapture.mFBStoreAction_Depth   = FrameBufferStoreAction.StoreActionStore;
            mRenderPassDesc_SceneCapture.mDepthClearValue       = 1.0f;
            mRenderPassDesc_SceneCapture.mFBLoadAction_Stencil  = FrameBufferLoadAction.LoadActionClear;
            mRenderPassDesc_SceneCapture.mFBStoreAction_Stencil = FrameBufferStoreAction.StoreActionStore;
            mRenderPassDesc_SceneCapture.mStencilClearValue     = 0u;

            Camera = camera;
            if (mCaptureSE == null)
            {
                mCaptureSE = CEngine.Instance.ShadingEnvManager.GetGfxShadingEnv <EnvShader.CGfxSceneCaptureSE>();
            }

            mTexData0 = new Support.CBlobObject();
            mTexData1 = new Support.CBlobObject();

            return(true);
        }