Ejemplo n.º 1
0
        public async System.Threading.Tasks.Task <bool> Init(CRenderContext rc, CSwapChain SwapChain,
                                                             View.CGfxScreenViewDesc ViewInfo, CGfxShadingEnv ShadingEnv, RName MtlInst, string debugName)
        {
            mCmdList = new CCommandList[2];

            EngineNS.CCommandListDesc CmdListDesc = new EngineNS.CCommandListDesc();
            mCmdList[0]           = rc.CreateCommandList(CmdListDesc);
            mCmdList[1]           = rc.CreateCommandList(CmdListDesc);
            mCmdList[0].DebugName = debugName;
            mCmdList[1].DebugName = debugName;

            var ScreenAlignedTriangle = CEngine.Instance.MeshPrimitivesManager.GetMeshPrimitives(rc, CEngineDesc.ScreenAlignedTriangleName, true);

            mScreenAlignedTriangle = CEngine.Instance.MeshManager.CreateMesh(rc, ScreenAlignedTriangle);
            var mtl = await CEngine.Instance.MaterialInstanceManager.GetMaterialInstanceAsync(rc, MtlInst);

            mScreenAlignedTriangle.SetMaterialInstance(rc, 0,
                                                       mtl,
                                                       CEngine.Instance.PrebuildPassData.DefaultShadingEnvs);
            //await mScreenAlignedTriangle.AwaitEffects();

            mShadingEnv = ShadingEnv;
            mScreenView = new View.CGfxScreenView();
            return(await mScreenView.Init(rc, SwapChain, ViewInfo, ShadingEnv, mtl, mScreenAlignedTriangle));
        }
Ejemplo n.º 2
0
        public async System.Threading.Tasks.Task <bool> Init2(CRenderContext rc, CGfxShadingEnv ShadingEnv, RName MtlInst, View.CGfxScreenView view)
        {
            mCmdList = new CCommandList[2];

            EngineNS.CCommandListDesc CmdListDesc = new EngineNS.CCommandListDesc();
            mCmdList[0] = rc.CreateCommandList(CmdListDesc);
            mCmdList[1] = rc.CreateCommandList(CmdListDesc);

            var ScreenAlignedTriangle = CEngine.Instance.MeshPrimitivesManager.GetMeshPrimitives(rc, CEngineDesc.ScreenAlignedTriangleName, true);

            mScreenAlignedTriangle = CEngine.Instance.MeshManager.CreateMesh(rc, ScreenAlignedTriangle);
            var mtl = await CEngine.Instance.MaterialInstanceManager.GetMaterialInstanceAsync(rc, MtlInst);

            mScreenAlignedTriangle.SetMaterialInstance(rc, 0,
                                                       mtl,
                                                       CEngine.Instance.PrebuildPassData.DefaultShadingEnvs);

            mShadingEnv = ShadingEnv;
            mScreenView = view;
            return(true);
        }