当前位置: 首页>>代码示例>>C#>>正文


C# MyLodTypeEnum.ToString方法代码示例

本文整理汇总了C#中MyLodTypeEnum.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MyLodTypeEnum.ToString方法的具体用法?C# MyLodTypeEnum.ToString怎么用?C# MyLodTypeEnum.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyLodTypeEnum的用法示例。


在下文中一共展示了MyLodTypeEnum.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawScene_OneLodLevel_Forward

        internal static void DrawScene_OneLodLevel_Forward(MyLodTypeEnum currentLodDrawPass)
        {
            m_renderProfiler.StartProfilingBlock(currentLodDrawPass.ToString());

            m_currentLodDrawPass = currentLodDrawPass;

            MyMinerGame.Static.SetDeviceViewport(MyCamera.Viewport);

            BlendState.Opaque.Apply();
            DepthStencilState.Default.Apply();

            if (currentLodDrawPass == MyLodTypeEnum.LOD0)
            {
                //                 //  Clear depth buffer + stencil because that should be faster than just clearing depth buffer (HW thing...)
                //                 m_device.Clear(ClearOptions.DepthBuffer | ClearOptions.Stencil, new Color(0, 0, 0, 0), 1, 0);
                m_renderElementIndex = 0;
            }

            if (!Wireframe)
                RasterizerState.CullCounterClockwise.Apply();
            else
                MyStateObjects.WireframeRasterizerState.Apply();

            // Render registered modules for this stage
            m_renderProfiler.StartProfilingBlock("MyRenderStage.LODDrawStart");
            DrawRenderModules(MyRenderStage.LODDrawStart);
            m_renderProfiler.EndProfilingBlock();

            if (currentLodDrawPass == MyLodTypeEnum.LOD0) // LOD0
            {
                m_renderProfiler.StartProfilingBlock("DrawNearObjects");
                if (!SkipLOD_NEAR && m_currentSetup.EnableNear.HasValue && m_currentSetup.EnableNear.Value)
                {
                    DrawScene_OneLodLevel_DrawNearObjects(ShowStencilOptimization, true);
                }
                m_renderProfiler.EndProfilingBlock();

                m_renderProfiler.StartProfilingBlock("Draw(false);");
                m_currentLodDrawPass = MyLodTypeEnum.LOD0;
                if (!SkipLOD_0)
                {
                    DrawScene_OneLodLevel_Draw(false, true);
                }
                m_renderProfiler.EndProfilingBlock();
            }
            else // LOD1
            {
                m_currentLodDrawPass = MyLodTypeEnum.LOD1;
                if (!SkipLOD_1)
                {
                    DrawScene_OneLodLevel_Draw(false, true);
                }
            }

            RasterizerState.CullCounterClockwise.Apply();

            // Render registered modules for this stage
            m_renderProfiler.StartProfilingBlock("MyRenderStage.LODDrawEnd");
            DrawRenderModules(MyRenderStage.LODDrawEnd);
            m_renderProfiler.EndProfilingBlock();

            m_renderProfiler.EndProfilingBlock();
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:63,代码来源:MyRender-Draw.cs

示例2: DrawScene_OneLodLevel

        /// <summary>
        /// Draw one LOD level of the scene
        /// </summary>
        /// <param name="currentLodDrawPass"></param>
        /// <param name="drawCockpitInterior"></param>
        internal static void DrawScene_OneLodLevel(MyLodTypeEnum currentLodDrawPass)
        {
            m_renderProfiler.StartProfilingBlock(currentLodDrawPass.ToString());

            m_currentLodDrawPass = currentLodDrawPass;

            switch (currentLodDrawPass)
            {
                case MyLodTypeEnum.LOD0:
                    MyMinerGame.SetRenderTargets(m_GBufferDefaultBinding, null);
                    break;
            }

            MyMinerGame.Static.SetDeviceViewport(MyCamera.Viewport);

            //  We don't need depth buffer for clearing Gbuffer
            DepthStencilState.None.Apply();
            BlendState.Opaque.Apply();
            RasterizerState.CullCounterClockwise.Apply();


            if (currentLodDrawPass == MyLodTypeEnum.LOD0)
            {
                //  Clear depth buffer + stencil because that should be faster than just clearing depth buffer (HW thing...)
                m_device.Clear(ClearFlags.Target | ClearFlags.ZBuffer | ClearFlags.Stencil, new ColorBGRA(1.0f,0,0,1), 1, 0);
                //  Clear Gbuffer
                MyGuiManager.GetFullscreenQuad().Draw(MyRender.GetEffect(MyEffects.ClearGBuffer));
            }

            //  This compare function "less" is better when drawing normal and LOD1 cells, then z-fighting isn't so visible.
            DepthStencilState.Default.Apply();

            if (!Wireframe)
                RasterizerState.CullCounterClockwise.Apply();
            else
                MyStateObjects.WireframeRasterizerState.Apply();

            m_renderProfiler.StartProfilingBlock("MyRenderStage.LODDrawStart");
            // Render registered modules for this stage
            m_renderProfiler.EndProfilingBlock();

            bool drawNear = !SkipLOD_NEAR && m_currentSetup.EnableNear.HasValue && m_currentSetup.EnableNear.Value;

            if (currentLodDrawPass == MyLodTypeEnum.LOD0) // LOD0
            {
                m_renderProfiler.StartProfilingBlock("DrawNearObjects");
                if (drawNear/* && MyRender.EnableLODBlending*/)
                {
                    DrawScene_OneLodLevel_DrawNearObjects(ShowStencilOptimization, true);
                }
                m_renderProfiler.EndProfilingBlock();

                m_renderProfiler.StartProfilingBlock("Draw(false);");
                m_currentLodDrawPass = MyLodTypeEnum.LOD0;
                if (!SkipLOD_0)
                {
                    DrawScene_OneLodLevel_Draw(false, true);
                }
                m_renderProfiler.EndProfilingBlock();
            }
            else // LOD1
            {
                /*
                if (EnableStencilOptimizationLOD1 && drawNear)
                {
                    DrawScene_OneLodLevel_DrawNearObjects(true, false);
                }
                 */
                         /*
                if (drawNear && !MyRender.EnableLODBlending)
                {
                    DrawScene_OneLodLevel_DrawNearObjects(ShowStencilOptimization, true);
                }          */

                //if (!MyRender.EnableLODBlending)
                {
                    //m_device.DepthStencilState = MyStateObjects.DepthStencil_TestFarObject;
                    MyStateObjects.DepthStencil_TestFarObject.Apply();
                }

                m_currentLodDrawPass = MyLodTypeEnum.LOD1;
                if (!SkipLOD_1)
                {
                    DrawScene_OneLodLevel_Draw(false, true);
                }

                m_renderProfiler.StartProfilingBlock("DrawNearObjects 2");
                /*if (drawNear && !MyRender.EnableLODBlending)
                {
                    DrawScene_OneLodLevel_DrawNearObjects(ShowStencilOptimization, true);
                } */
                m_renderProfiler.EndProfilingBlock();
            }

            //m_device.RasterizerState = RasterizerState.CullCounterClockwise;
//.........这里部分代码省略.........
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:101,代码来源:MyRender-Draw.cs


注:本文中的MyLodTypeEnum.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。