public override void OnResize(CRenderContext RHICtx, CSwapChain SwapChain, UInt32 width, UInt32 height) { Camera.PerspectiveFovLH(Camera.mDefaultFoV, (float)width, (float)height); mCopyPostprocessPass.mScreenView.OnResize(RHICtx, SwapChain, width, height); BaseSceneView.OnResize(RHICtx, null, width, height); //post effect; mMobileAO.OnResize(RHICtx, width, height, BaseSceneView); mBloomMobile.OnResize(RHICtx, width, height, BaseSceneView); mSunShaftMobile.OnResize(RHICtx, width, height); mCopySE.mBaseSceneView = BaseSceneView.FrameBuffer.GetSRV_RenderTarget(0); if (CEngine.EnableBloom == true) { mCopySE.mBloomTex = mBloomMobile.mUSView8.FrameBuffer.GetSRV_RenderTarget(0); } else { mCopySE.mBloomTex = BaseSceneView.FrameBuffer.GetSRV_RenderTarget(0); } mCopySE.mSunShaftTex = mSunShaftMobile.mView_Blur.FrameBuffer.GetSRV_RenderTarget(0); mCopySE.mSRV_MobileAo = mMobileAO.mView_AoMask.FrameBuffer.GetSRV_RenderTarget(0); var ViewportSizeAndRcp = new Vector4(width, height, 1.0f / width, 1.0f / height); mCopyPostprocessPass.mScreenView.ViewportSizeAndRcp = ViewportSizeAndRcp; }
public override void Cleanup() { mForwardBasePass.Cleanup(); mCopyPostprocessPass.Cleanup(); BaseSceneView.Cleanup(); BaseSceneView = null; SwapChain.Cleanup(); SwapChain = null; //shadow ssm mCSM.Cleanup(); //hitproxy mHitProxy.Cleanup(); //picked effect; mPickedEffect.Cleanup(); //post effect mBloomMobile.Cleanup(); mSunShaftMobile.Cleanup(); mMobileAO.Cleanup(); base.Cleanup(); }
public override void TickLogic(CGfxSceneView view, CRenderContext rc) { if (BaseSceneView == null) { return; } Camera.PushVisibleSceneMesh2RenderLayer(); //int CurrDPNumber = 0; //opaque render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_Opaque, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); //custom opaque render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_CustomOpaque, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); //sky render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_Sky, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); //custom translucent render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_CustomTranslucent, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); //translucent render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_Translucent, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); //gizmos render pass; BaseSceneView.CookSpecRenderLayerDataToPass(rc, ERenderLayer.RL_Gizmos, Camera, mSnapshotSE, PrebuildPassIndex.PPI_Snapshot); var CmdList = mCLDB_Snapshot[0]; BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_Opaque); BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_CustomOpaque); BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_Sky); BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_CustomTranslucent); BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_Translucent); BaseSceneView.PushSpecRenderLayerDataToRHI(CmdList, ERenderLayer.RL_Gizmos); CmdList.BeginCommand(); CmdList.BeginRenderPass(mRenderPassDesc_Snapshot, BaseSceneView.FrameBuffer); CmdList.BuildRenderPass(); CmdList.EndRenderPass(); if (OnAfterTickLogic != null) { OnAfterTickLogic(view, rc, CmdList, OnAfterTickLogicArgument); } CmdList.EndCommand(); CmdList = mCLDB_Copy[0]; if (mScreenAlignedTriangle != null) { mFinalView.CookViewportMeshToPass(rc, mCopySE, Camera, mScreenAlignedTriangle); mFinalView.PushPassToRHI(CmdList); this.RiseOnDrawUI(CmdList, mFinalView); } //CmdList.BeginCommand(); //CmdList.BeginRenderPass(mRenderPassDesc_Final, mFinalView.FrameBuffer); //LatestPass = CmdList.BuildRenderPass(int.MaxValue, GraphicsDebug); //CmdList.EndRenderPass(); //CmdList.EndCommand(); }
public override void Cleanup() { mForwardBasePass.Cleanup(); mCopyPostprocessPass.Cleanup(); BaseSceneView.Cleanup(); BaseSceneView = null; //shadow ssm mSSM.Cleanup(); //post effect mBloomMobile.Cleanup(); mSunShaftMobile.Cleanup(); mMobileAO.Cleanup(); base.Cleanup(); }
public override void Cleanup() { mCLDB_Snapshot[0].Cleanup(); mCLDB_Snapshot[0] = null; mCLDB_Snapshot[1].Cleanup(); mCLDB_Snapshot[1] = null; mCLDB_Copy[0].Cleanup(); mCLDB_Copy[0] = null; mCLDB_Copy[1].Cleanup(); mCLDB_Copy[1] = null; BaseSceneView.Cleanup(); BaseSceneView = null; mFinalView = null; base.Cleanup(); }
public override void OnResize(CRenderContext RHICtx, CSwapChain SwapChain, UInt32 width, UInt32 height) { if (Camera == null || mBloomMobile.mUSView8 == null || BaseSceneView == null) { return; } SwapChain.OnResize(width, height); //RHICtx.BindCurrentSwapChain(mSwapChain); Camera.PerspectiveFovLH(Camera.mDefaultFoV, (float)width, (float)height); mCopyPostprocessPass.mScreenView.OnResize(RHICtx, SwapChain, width, height); BaseSceneView.OnResize(RHICtx, null, width, height); //hitproxy; mHitProxy.OnResize(width, height); //picked effect; mPickedEffect.OnResize(width, height); //post effect; mMobileAO.OnResize(RHICtx, width, height, BaseSceneView); mBloomMobile.OnResize(RHICtx, width, height, BaseSceneView); mSunShaftMobile.OnResize(RHICtx, width, height); mCopyEditorSE.mBaseSceneView = BaseSceneView.FrameBuffer.GetSRV_RenderTarget(0); mCopyEditorSE.mBloomTex = mBloomMobile.mUSView8.FrameBuffer.GetSRV_RenderTarget(0); mCopyEditorSE.mPickedTex = mPickedEffect.mSV_PickedBlurH.FrameBuffer.GetSRV_RenderTarget(0); mCopyEditorSE.mSunShaftTex = mSunShaftMobile.mView_Blur.FrameBuffer.GetSRV_RenderTarget(0); //mCopyEditorSE.mSRV_MobileAo = mMobileAO.mView_BlurV.FrameBuffer.GetSRV_RenderTarget(0); mCopyEditorSE.mSRV_MobileAo = mMobileAO.mView_AoMask.FrameBuffer.GetSRV_RenderTarget(0); var ViewportSizeAndRcp = new Vector4(width, height, 1.0f / width, 1.0f / height); BaseSceneView.mViewportSizeAndRcp = ViewportSizeAndRcp; mCopyPostprocessPass.mScreenView.ViewportSizeAndRcp = ViewportSizeAndRcp; }
public override void OnResize(CRenderContext RHICtx, CSwapChain SwapChain, UInt32 width, UInt32 height) { Camera.PerspectiveFovLH(Camera.mDefaultFoV, (float)width, (float)height); BaseSceneView.OnResize(RHICtx, null, width, height); }