コード例 #1
0
            public List <MyRenderElement> TransparentRenderElementsToDraw; // if null, MyEntities.Draw() will be used

            public void Clear()
            {
                CallerID = null;

                RenderTargets    = null;
                CameraPosition   = null;
                ViewMatrix       = null;
                ProjectionMatrix = null;
                AspectRatio      = null;
                Fov      = null;
                Viewport = null;

                EnableHDR                = null;
                EnableLights             = null;
                EnableSun                = null;
                ShadowRenderer           = null;
                EnableShadowInterleaving = null;
                EnableSmallLights        = null;
                EnableSmallLightShadows  = null;
                EnableDebugHelpers       = null;
                EnableEnvironmentMapping = null;
                EnableNear               = null;

                BackgroundColor = null;

                EnableOcclusionQueries = true;
                FogMultiplierMult      = 1.0f;
                DepthToAlpha           = false;
                DepthCopy = false;

                EnabledModules       = null;
                EnabledPostprocesses = null;
                EnabledRenderStages  = null;
            }
コード例 #2
0
        private static void LoadContent()
        {
            MyRender.Log.WriteLine("MyRender.LoadContent() - START");

            MyRender.GetRenderProfiler().StartProfilingBlock("MyRender::LoadContent");

            m_screenshot = null;

            DumpSettingsToLog();

            UpdateScreenSize();

            CreateRenderTargets();
            CreateEnvironmentMapsRT(MyRenderConstants.ENVIRONMENT_MAP_SIZE);

            DefaultSurface           = GraphicsDevice.GetRenderTarget(0);
            DefaultSurface.DebugName = "DefaultSurface";
            DefaultDepth             = GraphicsDevice.DepthStencilSurface;
            DefaultDepth.DebugName   = "DefaultDepth";

            m_randomTexture = CreateRandomTexture();

            LoadEffects();

            if (m_shadowRenderer == null)
            {
                m_shadowRenderer = new MyShadowRenderer(GetShadowCascadeSize(), MyRenderTargets.ShadowMap, MyRenderTargets.ShadowMapZBuffer, true);
            }

            if (m_spotShadowRenderer == null)
            {
                m_spotShadowRenderer = new MySpotShadowRenderer();
            }


            foreach (var renderComponent in m_renderComponents)
            {
                renderComponent.Value.LoadContent(GraphicsDevice);
            }

            m_spriteBatch    = new Graphics.SpriteBatch(GraphicsDevice, "SpriteBatch");
            m_fullscreenQuad = new MyFullScreenQuad();

            BlankTexture = MyTextureManager.GetTexture <MyTexture2D>("Textures\\GUI\\Blank.dds", flags: TextureFlags.IgnoreQuality);

            MyEnvironmentMap.Reset();

            foreach (var ro in m_renderObjects)
            {
                ro.Value.LoadContent();
            }

            LoadContent_Video();

            MyRender.GetRenderProfiler().EndProfilingBlock();

            MyRender.Log.WriteLine("MyRender.LoadContent() - END");
        }