Ejemplo n.º 1
0
        public override void TickLogic(CGfxSceneView view, CRenderContext RHICtx)
        {
            if (BaseSceneView == null)
            {
                return;
            }
            ScopeTickLogic.Begin();

            int    drawCall     = 0;
            int    drawTriangle = 0;
            UInt32 cmdCount     = 0;

            Camera.PushVisibleSceneMesh2RenderLayer();
            Vector3 DirLightDir = new Vector3(BaseSceneView.mDirLightDirection_Leak.X, BaseSceneView.mDirLightDirection_Leak.Y, BaseSceneView.mDirLightDirection_Leak.Z);

            mSSM.TickLogic(RHICtx, Camera, DirLightDir);

            BaseSceneView.mFadeParam             = mSSM.mFadeParam;
            BaseSceneView.mShadowTransitionScale = mSSM.mShadowTransitionScale;
            BaseSceneView.mShadowMapSizeAndRcp   = mSSM.mShadowMapSizeAndRcp;
            BaseSceneView.mViewer2ShadowMtx      = mSSM.mViewer2ShadowMtx;
            BaseSceneView.mShadowDistance        = mSSM.mShadowDistance;
            mForwardBasePass.TickLogic(Camera, view, RHICtx, DPLimitter, GraphicsDebug);

            drawCall     += mForwardBasePass.CommitingCMDs.DrawCall;
            drawTriangle += mForwardBasePass.CommitingCMDs.DrawTriangle;
            cmdCount     += mForwardBasePass.CommitingCMDs.CmdCount;

            //post effect;
            mMobileAO.TickLogic(RHICtx, Camera, BaseSceneView);
            mBloomMobile.TickLogic(RHICtx, Camera);

            mSunShaftMobile.TickLogic(RHICtx, Camera, DirLightDir, BaseSceneView);

            {
                mCopyPostprocessPass.mScreenView.SunPosNDC = mSunShaftMobile.mSunPosNdc;
                mCopyPostprocessPass.mScreenView.DirLightColor_Intensity = BaseSceneView.DirLightColor_Intensity;
                mCopyPostprocessPass.TickLogic(Camera, view, RHICtx);

                RiseOnDrawUI(mCopyPostprocessPass.CommitingCMDs, mCopyPostprocessPass.mScreenView);
            }

            //CmdList.BeginCommand();
            //CmdList.BeginRenderPass(mRenderPassDesc_Final, mFinalView.FrameBuffer);
            //LatestPass = CmdList.BuildRenderPass(ref DPLimitter, GraphicsDebug);
            //CmdList.EndRenderPass();
            //CmdList.EndCommand();

            drawCall     += mCopyPostprocessPass.CommitingCMDs.DrawCall;
            drawTriangle += mCopyPostprocessPass.CommitingCMDs.DrawTriangle;
            cmdCount     += mCopyPostprocessPass.CommitingCMDs.CmdCount;

            DrawCall     = drawCall;
            DrawTriangle = drawTriangle;
            CmdCount     = cmdCount;

            ScopeTickLogic.End();
        }
Ejemplo n.º 2
0
        public override void TickLogic(CGfxSceneView view, CRenderContext RHICtx)
        {
            if (BaseSceneView == null)
            {
                return;
            }

            Camera.PushVisibleSceneMesh2RenderLayer();

            Vector3 DirLightDir = new Vector3(BaseSceneView.mDirLightDirection_Leak.X, BaseSceneView.mDirLightDirection_Leak.Y, BaseSceneView.mDirLightDirection_Leak.Z);

            mSSM.TickLogic(RHICtx, Camera, DirLightDir);

            BaseSceneView.mFadeParam             = mSSM.mFadeParam;
            BaseSceneView.mShadowTransitionScale = mSSM.mShadowTransitionScale;
            BaseSceneView.mShadowMapSizeAndRcp   = mSSM.mShadowMapSizeAndRcp;
            BaseSceneView.mViewer2ShadowMtx      = mSSM.mViewer2ShadowMtx;
            BaseSceneView.mShadowDistance        = mSSM.mShadowDistance;


            mForwardBasePass.TickLogic(Camera, view, RHICtx, DPLimitter, GraphicsDebug);

            //post effect;
            mMobileAO.TickLogic(RHICtx, Camera, BaseSceneView);
            if (CEngine.EnableBloom == true)
            {
                mBloomMobile.TickLogic(RHICtx, Camera);
            }
            mSunShaftMobile.TickLogic(RHICtx, Camera, DirLightDir, BaseSceneView);

            {
                mSunShaftMobile.mSunPosNdc.Z = 0.25f * mSunShaftMobile.mSunShaftAtten;
                if (mSunShaftMobile.mStopSunShaftUpdate == true)
                {
                    //disable sun shaft;
                    mSunShaftMobile.mSunPosNdc.W = 0.0f;
                }
                else
                {
                    mSunShaftMobile.mSunPosNdc.W = 1.0f;
                }
                mCopyPostprocessPass.mScreenView.SunPosNDC = mSunShaftMobile.mSunPosNdc;
                mCopyPostprocessPass.mScreenView.DirLightColor_Intensity = BaseSceneView.DirLightColor_Intensity;

                mCopyPostprocessPass.TickLogic(Camera, view, RHICtx);

                this.RiseOnDrawUI(mCopyPostprocessPass.CommitingCMDs, mCopyPostprocessPass.mScreenView);
            }
        }
Ejemplo n.º 3
0
        public override void TickLogic(CGfxSceneView view, CRenderContext RHICtx)
        {
            if (BaseSceneView == null)
            {
                return;
            }
            ScopeTickLogic.Begin();

            int    drawCall     = 0;
            int    drawTriangle = 0;
            UInt32 cmdCount     = 0;

            Camera.PushVisibleSceneMesh2RenderLayer();
            Vector3 DirLightDirection = new Vector3(BaseSceneView.mDirLightDirection_Leak.X, BaseSceneView.mDirLightDirection_Leak.Y, BaseSceneView.mDirLightDirection_Leak.Z);

            mCSM.TickLogic(RHICtx, Camera, DirLightDirection);

            //hitproxy;
            mHitProxy.TickLogic();

            //Picked Effect;
            mPickedEffect.TickLogic();

            BaseSceneView.mFadeParam = mCSM.mFadeParam;
            BaseSceneView.ShadowTransitionScaleArrayEditor = mCSM.mShadowTransitionScaleVec;
            BaseSceneView.mShadowMapSizeAndRcp             = mCSM.mShadowMapSizeAndRcp;
            BaseSceneView.Viewer2ShadowMtxArrayEditor0     = mCSM.mViewer2ShadowMtxArray[0];
            BaseSceneView.Viewer2ShadowMtxArrayEditor1     = mCSM.mViewer2ShadowMtxArray[1];
            BaseSceneView.Viewer2ShadowMtxArrayEditor2     = mCSM.mViewer2ShadowMtxArray[2];
            BaseSceneView.Viewer2ShadowMtxArrayEditor3     = mCSM.mViewer2ShadowMtxArray[3];
            BaseSceneView.CsmDistanceArray = mCSM.mSumDistanceFarVec;
            BaseSceneView.CsmNum           = (int)mCSM.mCsmNum;

            mForwardBasePass.TickLogic(Camera, view, RHICtx, DPLimitter, GraphicsDebug);

            drawCall     += mForwardBasePass.CommitingCMDs.DrawCall;
            drawTriangle += mForwardBasePass.CommitingCMDs.DrawTriangle;
            cmdCount     += mForwardBasePass.CommitingCMDs.CmdCount;

            //post effect;
            mMobileAO.TickLogic(RHICtx, Camera, BaseSceneView);
            mBloomMobile.TickLogic(RHICtx, Camera);
            mSunShaftMobile.TickLogic(RHICtx, Camera, DirLightDirection, BaseSceneView);

            ////UInt32 ID = mHitProxy.GetHitProxyID(0, 0);

            {
                mCopyPostprocessPass.mScreenView.SunPosNDC = mSunShaftMobile.mSunPosNdc;
                mCopyPostprocessPass.mScreenView.DirLightColor_Intensity = BaseSceneView.DirLightColor_Intensity;
                mCopyPostprocessPass.TickLogic(Camera, view, RHICtx);

                ScopeDrawUI.Begin();
                RiseOnDrawUI(mCopyPostprocessPass.CommitingCMDs, mCopyPostprocessPass.mScreenView);
                ScopeDrawUI.End();
            }

            //CmdList.BeginCommand();
            //CmdList.BeginRenderPass(mRenderPassDesc_Final, mFinalView.FrameBuffer);
            //LatestPass = CmdList.BuildRenderPass(ref DPLimitter, GraphicsDebug);
            //CmdList.EndRenderPass();
            //CmdList.EndCommand();


            drawCall     += mCopyPostprocessPass.CommitingCMDs.DrawCall;
            drawTriangle += mCopyPostprocessPass.CommitingCMDs.DrawTriangle;
            cmdCount     += mCopyPostprocessPass.CommitingCMDs.CmdCount;

            DrawCall     = drawCall;
            DrawTriangle = drawTriangle;
            CmdCount     = cmdCount;

            ScopeTickLogic.End();
        }