Esempio n. 1
0
        internal static unsafe void InitSubsystems()
        {
            MyRwTextures.Init();
            MyHwBuffers.Init();
            MyPipelineStates.Init();
            ResetShadows(MyRenderProxy.Settings.ShadowCascadeCount, RenderSettings.ShadowQuality.ShadowCascadeResolution());
            MyRender11.Init();
            MyCommon.Init();
            SamplerStates.Init();
            MyDepthStencilState.Init();
            MyTextures.Init();
            MyVertexLayouts.Init();
            MyShaders.Init();
            MyMeshes.Init();
            MyMeshTableSRV.Init();
            MyLightRendering.Init();
            MyLinesRenderer.Init();
            MySpritesRenderer.Init();
            MyPrimitivesRenderer.Init();
            MyOutline.Init();
            MyBlur.Init();
            MyTransparentRendering.Init();

            MyFoliageComponents.Init();

            MyBillboardRenderer.Init(); // hardcoded limits
            MyDebugRenderer.Init();

            MyScreenDecals.Init();
            MyEnvProbeProcessing.Init();
            MyAtmosphereRenderer.Init();
            MyCloudRenderer.Init();
            MyAAEdgeMarking.Init();
            MyScreenPass.Init();
            MyCopyToRT.Init();
            MyBlendTargets.Init();
            MyFXAA.Init();
            MyDepthResolve.Init();
            MyBloom.Init();
            MyLuminanceAverage.Init();
            MyToneMapping.Init();
            MySSAO.Init();
            MyPlanetBlur.Init();
            MyHdrDebugTools.Init();

            MySceneMaterials.Init();
            MyMaterials1.Init();
            MyVoxelMaterials1.Init();
            MyMeshMaterials1.Init();
        }
        internal static void Draw()
        {
            RC.BindGBufferForWrite(MyGBuffer.Main, DepthStencilAccess.ReadWrite);
            RC.SetupScreenViewport();
            RC.DeviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
            RC.SetVB(0, m_VB.Buffer, m_VB.Stride);
            RC.SetIL(m_il);

            RC.SetRS(MyRender11.m_nocullRasterizerState);
            RC.SetDS(MyDepthStencilState.StereoStereoStencilMask, MyDepthStencilState.GetStereoMask());

            RC.SetVS(m_vs);
            RC.SetPS(m_ps);

            RC.DeviceContext.Draw(m_VBdata.Length, 0);
        }
Esempio n. 3
0
        private void SetNumberOfCascades(int newCount)
        {
            Array.Resize(ref ShadowCascadeSplitDepths, newCount + 1);
            Array.Resize(ref ShadowCascadeScales, newCount);
            Array.Resize(ref m_shadowCascadeUpdatePositions, newCount);
            Array.Resize(ref m_shadowCascadeLightDirections, newCount);
            Array.Resize(ref m_shadowCascadeFramesSinceLightUpdate, newCount);
            Array.Resize(ref ShadowCascadeObjectsCounter, newCount);
            Array.Resize(ref ShadowCascadeTriangleCounter, newCount);
            Array.Resize(ref m_shadowCascadeUpdateIntervals, newCount);

            for (int cascadeIndex = m_initializedShadowCascadesCount; cascadeIndex < newCount; ++cascadeIndex)
            {
                SetCascadeUpdateInterval(cascadeIndex, 1, 0);
            }

            MyRenderProxy.Settings.CheckArrays();
            MyDepthStencilState.ResizeMarkIfInsideCascade();
        }
        internal static unsafe void InitSubsystems()
        {
            MyRwTextures.Init();
            MyHwBuffers.Init();
            MyPipelineStates.Init();
            ResetShadows(MyRenderProxy.Settings.ShadowCascadeCount, RenderSettings.ShadowQuality.ShadowCascadeResolution());
            MyRender11.Init();
            MyCommon.Init();
            SamplerStates.Init();
            MyDepthStencilState.Init();
            MyTextures.Init();
            MyVertexLayouts.Init();
            MyShaders.Init();
            MyMeshes.Init();
            MyMeshTableSRV.Init();
            MyLightRendering.Init();
            MyLinesRenderer.Init();
            MySpritesRenderer.Init();
            MyPrimitivesRenderer.Init();
            MyOutline.Init();
            MyBlur.Init();
            MyTransparentRendering.Init();

            MyFoliageComponents.Init();

            MyBillboardRenderer.Init(); // hardcoded limits
            MyDebugRenderer.Init();

            MyScreenDecals.Init();
            MyEnvProbeProcessing.Init();
            MyAtmosphereRenderer.Init();
            MyCloudRenderer.Init();
            MyAAEdgeMarking.Init();
            MyScreenPass.Init();
            MyCopyToRT.Init();
            MyBlendTargets.Init();
            MyFXAA.Init();
            MyDepthResolve.Init();
            MyBloom.Init();
            MyLuminanceAverage.Init();
            MyToneMapping.Init();
            MySSAO.Init();
            MyPlanetBlur.Init();
            MyHdrDebugTools.Init();

            MySceneMaterials.Init();
            MyMaterials1.Init();
            MyVoxelMaterials1.Init();
            MyMeshMaterials1.Init();

            try
            {
                if (m_settings.UseStereoRendering)
                {
                    var openVR = new MyOpenVR();
                    MyStereoStencilMask.InitUsingOpenVR();
                }
            }
            catch (System.Exception e)
            {
                if (!VRage.MyCompilationSymbols.DX11ForceStereo)
                {
                    throw;
                }
                MyStereoStencilMask.InitUsingUndefinedMask();
            }
        }