示例#1
0
        /// <summary>
        /// This should be called only from LoadContent
        /// </summary>
        public static void SwitchRenderQuality(MyRenderQualityEnum renderQuality)
        {
            RenderQualityProfile = m_renderQualityProfiles[(int)renderQuality];

            if (OnRenderQualityChange != null)
            {
                OnRenderQualityChange(renderQuality, null);
            }
        }
示例#2
0
        static MyRenderConstants()
        {
            m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.NORMAL,

                //LODs
                LodTransitionDistanceNear            = 150,
                LodTransitionDistanceFar             = 200,
                LodTransitionDistanceBackgroundStart = 1000,
                LodTransitionDistanceBackgroundEnd   = 1100,
                LodClipmapRanges = new float[][]
                { // base was 32f * 4f
                    new float[] { 100f, 300f, 800f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, },
                },

                // No need to set, env maps enabled only on high and extreme
                EnvironmentLodTransitionDistance           = 200,
                EnvironmentLodTransitionDistanceBackground = 300,

                //Textures
                TextureQuality = TextureQuality.Half,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,


                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 1,
                ShadowSlopeBiasMultiplier     = 2.5f,
                EnableCascadeBlending         = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,


                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 1.0f,

                // Low res particles
                LowResParticles = true,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.5f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.LOW] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.LOW,

                //LODs
                LodTransitionDistanceNear            = 60,
                LodTransitionDistanceFar             = 80,
                LodTransitionDistanceBackgroundStart = 300,
                LodTransitionDistanceBackgroundEnd   = 350,
                LodClipmapRanges = new float[][]
                { // base was 32f * 2f
                    new float[] { 80f, 240f, 600f, 1600f, 4800f, 14000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, },
                },

                // No need to set, env maps enabled only on high and extreme
                EnvironmentLodTransitionDistance           = 10,
                EnvironmentLodTransitionDistanceBackground = 20,

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.StencilLow,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier          = 1,
                ShadowSlopeBiasMultiplier     = 1,
                EnableCascadeBlending         = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,

                //Geometry quality
                UseNormals = false,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 0.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.HIGH] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.HIGH,

                //LODs
                LodTransitionDistanceNear            = 200,
                LodTransitionDistanceFar             = 250,
                LodTransitionDistanceBackgroundStart = 1800,
                LodTransitionDistanceBackgroundEnd   = 2000,
                LodClipmapRanges = new float[][]
                { // base was 32f * 6f
                    new float[] { 120f, 360f, 900f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, }
                },

                EnvironmentLodTransitionDistance           = 40,
                EnvironmentLodTransitionDistanceBackground = 80,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 0.5f,
                ShadowSlopeBiasMultiplier     = 2.5f,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 2.5f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.8f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.EXTREME] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.EXTREME,

                //LODs
                LodTransitionDistanceNear            = 1000,
                LodTransitionDistanceFar             = 1100,
                LodTransitionDistanceBackgroundStart = 4200,
                LodTransitionDistanceBackgroundEnd   = 5000,
                LodClipmapRanges = new float[][]
                { // base was 32f * 8f
                    new float[] { 140f, 400f, 1000f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, },
                },

                EnvironmentLodTransitionDistance           = 50,
                EnvironmentLodTransitionDistanceBackground = 100,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 4,
                ShadowMapCascadeSize          = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier          = 0.5f,
                ShadowSlopeBiasMultiplier     = 1,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 3.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 3.0f,
            };

            //Default value
            RenderQualityProfile = m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL];
        }
        /// <summary>
        /// This should be called only from LoadContent
        /// </summary>
        public static void SwitchRenderQuality(MyRenderQualityEnum renderQuality)
        {
            RenderQualityProfile = m_renderQualityProfiles[(int)renderQuality];

            if (OnRenderQualityChange != null)
                OnRenderQualityChange(renderQuality, null);
        }
        static MyRenderConstants()
        {
            var massiveClipmapLodRangesHigh = new float[]   { 66f, 200f, 550f, 1000f, 1700, 3000, 6000, 15000, 40000, 100000, 250000 };
            var massiveClipmapLodRangesNormal = new float[] { 60f, 180f, 500f, 900f, 1600, 2800, 5500, 14000, 35000, 90000, 220000 };
            var massiveClipmapLodRangesLow = new float[]    { 55f, 150f, 450f, 800f, 1500, 2600, 4000, 13000, 30000, 80000, 200000 };
            
            

            m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.NORMAL,

                //LODs
                LodClipmapRanges = new float[][]
                { 
                    new float[] { 100f, 300f, 800f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesNormal
                },

                //Textures
                TextureQuality = TextureQuality.Half,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,
                

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 1,
                ShadowSlopeBiasMultiplier = 2.5f,
                EnableCascadeBlending = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,


                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 1.0f,

                // Low res particles
                LowResParticles = true,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.5f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.LOW] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.LOW,

                //LODs
                LodClipmapRanges = new float[][]
                { 
                    new float[] { 80f, 240f, 600f, 1600f, 4800f, 14000f, 35000f, 100000f, },
                    massiveClipmapLodRangesLow, 
                },

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.StencilLow,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier = 1,
                ShadowSlopeBiasMultiplier = 1,
                EnableCascadeBlending = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,

                //Geometry quality
                UseNormals = false,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 0.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.HIGH] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.HIGH,

                //LODs
                LodClipmapRanges = new float[][]
                { // base was 32f * 6f
                    new float[] { 120f, 360f, 900f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesHigh,
                },

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 0.5f,
                ShadowSlopeBiasMultiplier = 2.5f,
                EnableCascadeBlending = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 2.5f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.8f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.EXTREME] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.EXTREME,

                //LODs
                LodClipmapRanges = new float[][]
                { // base was 32f * 8f
                    new float[] { 140f, 400f, 1000f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesHigh,
                },

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 4,
                ShadowMapCascadeSize = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier = 0.5f,
                ShadowSlopeBiasMultiplier = 1,
                EnableCascadeBlending = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 3.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 3.0f,
            };

            //Default value
            RenderQualityProfile = m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL];
        }
示例#5
0
        static MyRenderConstants()
        {
            m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.NORMAL,

                //LODs
                LodTransitionDistanceNear = 150,
                LodTransitionDistanceFar = 200,
                LodTransitionDistanceBackgroundStart = 1000,
                LodTransitionDistanceBackgroundEnd = 1100,
                LodClipmapRanges = new float[][]
                { // base was 32f * 4f
                    new float[] { 100f, 300f, 800f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, },
                },

                // No need to set, env maps enabled only on high and extreme
                EnvironmentLodTransitionDistance = 200,
                EnvironmentLodTransitionDistanceBackground = 300,

                //Textures
                TextureQuality = TextureQuality.Half,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,
                

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 1,
                ShadowSlopeBiasMultiplier = 2.5f,
                EnableCascadeBlending = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,


                //Geometry quality
                UseNormals = true,
                NeedReloadContent = true, //because normal->high and vertex channels
                UseChannels = false,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 1.0f,

                // Low res particles
                LowResParticles = true,

                // Distant impostors
                EnableDistantImpostors = false,

                // Flying debris
                EnableFlyingDebris = false,

                // Decals
                EnableDecals = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.5f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.LOW] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.LOW,

                //LODs
                LodTransitionDistanceNear = 60,
                LodTransitionDistanceFar = 80,
                LodTransitionDistanceBackgroundStart = 300,
                LodTransitionDistanceBackgroundEnd = 350,
                LodClipmapRanges = new float[][]
                { // base was 32f * 2f
                    new float[] { 80f, 240f, 600f, 1600f, 4800f, 14000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, }, 
                },

                // No need to set, env maps enabled only on high and extreme
                EnvironmentLodTransitionDistance = 10,
                EnvironmentLodTransitionDistanceBackground = 20,

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.StencilLow,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier = 1,
                ShadowSlopeBiasMultiplier = 1,
                EnableCascadeBlending = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,

                //Geometry quality
                UseNormals = false,
                NeedReloadContent = true,
                UseChannels = false,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 0.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = false,

                // Flying debris
                EnableFlyingDebris = false,

                // Decals
                EnableDecals = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.HIGH] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.HIGH,

                //LODs
                LodTransitionDistanceNear = 200,
                LodTransitionDistanceFar = 250,
                LodTransitionDistanceBackgroundStart = 1800,
                LodTransitionDistanceBackgroundEnd = 2000,
                LodClipmapRanges = new float[][]
                { // base was 32f * 6f
                    new float[] { 120f, 360f, 900f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, }
                },

                EnvironmentLodTransitionDistance = 40,
                EnvironmentLodTransitionDistanceBackground = 80,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 3,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 0.5f,
                ShadowSlopeBiasMultiplier = 2.5f,
                EnableCascadeBlending = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,
                NeedReloadContent = false,
                UseChannels = true,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 2.5f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                // Flying debris
                EnableFlyingDebris = true,

                // Decals
                EnableDecals = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.8f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.EXTREME] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.EXTREME,

                //LODs
                LodTransitionDistanceNear = 1000,
                LodTransitionDistanceFar = 1100,
                LodTransitionDistanceBackgroundStart = 4200,
                LodTransitionDistanceBackgroundEnd = 5000,
                LodClipmapRanges = new float[][]
                { // base was 32f * 8f
                    new float[] { 140f, 400f, 1000f, 2000f, 6000f, 18000f, 35000f, 100000f, },
                    new float[] { 40f, 120f, 300f, 800f, 2400f, 5000f, },
                },

                EnvironmentLodTransitionDistance = 50,
                EnvironmentLodTransitionDistanceBackground = 100,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeSkinned,
                ModelsInstancedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,
                ModelsInstancedSkinnedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstancedSkinned,
                ModelsInstancedGenericTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold = 4,
                ShadowMapCascadeSize = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier = 0.5f,
                ShadowSlopeBiasMultiplier = 1,
                EnableCascadeBlending = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,
                NeedReloadContent = false,
                UseChannels = true,

                // Spot shadow max distance multiplier 
                SpotShadowsMaxDistanceMultiplier = 3.0f,

                // Low res particles
                LowResParticles = false,

                // Distant impostors
                EnableDistantImpostors = true,

                // Flying debris
                EnableFlyingDebris = true,

                // Decals
                EnableDecals = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 3.0f,
            };

            //Default value
            RenderQualityProfile = m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL];
        }
示例#6
0
        static MyRenderConstants()
        {
            var massiveClipmapLodRangesHigh   = new float[]   { 66f, 200f, 550f, 1000f, 1700, 3000, 6000, 15000, 40000, 100000, 250000 };
            var massiveClipmapLodRangesNormal = new float[] { 60f, 180f, 500f, 900f, 1600, 2800, 5500, 14000, 35000, 90000, 220000 };
            var massiveClipmapLodRangesLow    = new float[]    { 55f, 150f, 450f, 800f, 1500, 2600, 4000, 13000, 30000, 80000, 200000 };



            m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.NORMAL,

                //LODs
                LodClipmapRanges = new float[][]
                {
                    new float[] { 100f, 300f, 800f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesNormal
                },

                //Textures
                TextureQuality = TextureQuality.Half,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.NormalInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,


                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 1,
                ShadowSlopeBiasMultiplier     = 2.5f,
                EnableCascadeBlending         = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,


                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 1.0f,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.5f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.LOW] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.LOW,

                //LODs
                LodClipmapRanges = new float[][]
                {
                    new float[] { 80f, 240f, 600f, 1600f, 4800f, 14000f, 35000f, 100000f, },
                    massiveClipmapLodRangesLow,
                },

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.StencilLow,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier          = 1,
                ShadowSlopeBiasMultiplier     = 1,
                EnableCascadeBlending         = false,

                //HDR
                EnableHDR = false,

                //SSAO
                EnableSSAO = false,

                //FXAA
                EnableFXAA = false,

                //Environmentals
                EnableEnvironmentals = false,

                //GodRays
                EnableGodRays = false,

                //Geometry quality
                UseNormals = false,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 0.0f,

                // Distant impostors
                EnableDistantImpostors = false,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.HIGH] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.HIGH,

                //LODs
                LodClipmapRanges = new float[][]
                { // base was 32f * 6f
                    new float[] { 120f, 360f, 900f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesHigh,
                },

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.HighSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.HighInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.HighInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 3,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 0.5f,
                ShadowSlopeBiasMultiplier     = 2.5f,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 2.5f,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 0.8f,
            };

            m_renderQualityProfiles[(int)MyRenderQualityEnum.EXTREME] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.EXTREME,

                //LODs
                LodClipmapRanges = new float[][]
                { // base was 32f * 8f
                    new float[] { 140f, 400f, 1000f, 2000f, 4500f, 13500f, 30000f, 100000f, },
                    massiveClipmapLodRangesHigh,
                },

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = Effects.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique                 = Effects.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique          = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique           = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique             = Effects.MyEffectModelsDNSTechniqueEnum.Holo,
                ModelsStencilTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.Stencil,
                ModelsSkinnedTechnique                = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeSkinned,
                ModelsInstancedTechnique              = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,
                ModelsInstancedSkinnedTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.ExtremeInstancedSkinned,
                ModelsInstancedGenericTechnique       = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGeneric,
                ModelsInstancedGenericMaskedTechnique = Effects.MyEffectModelsDNSTechniqueEnum.InstancedGenericMasked,

                //Shadows
                ShadowCascadeLODTreshold      = 4,
                ShadowMapCascadeSize          = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier          = 0.5f,
                ShadowSlopeBiasMultiplier     = 1,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

                //Geometry quality
                UseNormals = true,

                // Spot shadow max distance multiplier
                SpotShadowsMaxDistanceMultiplier = 3.0f,

                // Distant impostors
                EnableDistantImpostors = true,

                //Explosion voxel debris
                ExplosionDebrisCountMultiplier = 3.0f,
            };

            //Default value
            RenderQualityProfile = m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL];
        }