예제 #1
0
        public static void SwitchRenderQuality(MyRenderQualityEnum renderQuality)
        {
            RenderQualityProfile = m_renderQualityProfiles[(int)renderQuality];

            if (OnRenderQualityChange != null)
            {
                OnRenderQualityChange(renderQuality, null);
            }
        }
예제 #2
0
        public static void SwitchRenderQuality(MyRenderQualityEnum renderQuality)
        {
            RenderQualityProfile = m_renderQualityProfiles[(int)renderQuality];

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

                //LODs
                LodTransitionDistanceNear = 1500,
                LodTransitionDistanceFar = 2000,
                LodTransitionDistanceBackgroundStart = 10000,
                LodTransitionDistanceBackgroundEnd = 11000,

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

                //Textures
                TextureQuality = TextureQuality.Half,
            
                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normal, // Do not use channels on normal
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normalnstanced,

                //Shadows
                ShadowCascadeLODTreshold = 2,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 5,
                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,

                // Forward render
                ForwardRender = false,

                // 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 = 600,
                LodTransitionDistanceFar = 800,
                LodTransitionDistanceBackgroundStart = 3000,
                LodTransitionDistanceBackgroundEnd = 3500,

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

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HoloForward,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Low, // Do not use channels on low
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilLow,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilLowInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowInstanced,

                //Shadows
                ShadowCascadeLODTreshold = 2,
                ShadowMapCascadeSize = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier = 10,
                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,

                // Forward render
                ForwardRender = true,

                // 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 = 2000,
                LodTransitionDistanceFar = 2500,
                LodTransitionDistanceBackgroundStart = 18000,
                LodTransitionDistanceBackgroundEnd = 20000,

                EnvironmentLodTransitionDistance = 400,
                EnvironmentLodTransitionDistanceBackground = 800,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighChannels,
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighInstanced,

                //Shadows
                ShadowCascadeLODTreshold = 2,
                ShadowMapCascadeSize = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier = 2,
                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,

                // Forward render
                ForwardRender = false,

                // 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 = 10000,
                LodTransitionDistanceFar = 11000,
                LodTransitionDistanceBackgroundStart = 42000,
                LodTransitionDistanceBackgroundEnd = 50000,

                EnvironmentLodTransitionDistance = 500,
                EnvironmentLodTransitionDistanceBackground = 1000,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeChannels,
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,

                //Shadows
                ShadowCascadeLODTreshold = 4,
                ShadowMapCascadeSize = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier = 2,
                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,

                // Forward render
                ForwardRender = false,

                // 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];
        }
예제 #4
0
        static MyRenderConstants()
        {
            m_renderQualityProfiles[(int)MyRenderQualityEnum.NORMAL] = new MyRenderQualityProfile()
            {
                RenderQuality = MyRenderQualityEnum.NORMAL,

                //LODs
                LodTransitionDistanceNear            = 1500,
                LodTransitionDistanceFar             = 2000,
                LodTransitionDistanceBackgroundStart = 10000,
                LodTransitionDistanceBackgroundEnd   = 11000,

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

                //Textures
                TextureQuality = TextureQuality.Half,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Normal,

                //Models
                ModelsRenderTechnique        = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normal,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.NormalBlended,
                ModelsMaskedRenderTechnique  = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.NormalMasked,
                ModelsHoloRenderTechnique    = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normal, // Do not use channels on normal
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Normalnstanced,

                //Shadows
                ShadowCascadeLODTreshold      = 2,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 5,
                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,

                // Forward render
                ForwardRender = false,

                // 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            = 600,
                LodTransitionDistanceFar             = 800,
                LodTransitionDistanceBackgroundStart = 3000,
                LodTransitionDistanceBackgroundEnd   = 3500,

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

                //Textures
                TextureQuality = TextureQuality.OneFourth,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Low,

                //Models
                ModelsRenderTechnique        = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Low,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowBlended,
                ModelsMaskedRenderTechnique  = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowMasked,
                ModelsHoloRenderTechnique    = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HoloForward,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Low, // Do not use channels on low
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilLow,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilLowInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.LowInstanced,

                //Shadows
                ShadowCascadeLODTreshold      = 2,
                ShadowMapCascadeSize          = 512,
                SecondaryShadowMapCascadeSize = 32,
                ShadowBiasMultiplier          = 10,
                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,

                // Forward render
                ForwardRender = true,

                // 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            = 2000,
                LodTransitionDistanceFar             = 2500,
                LodTransitionDistanceBackgroundStart = 18000,
                LodTransitionDistanceBackgroundEnd   = 20000,

                EnvironmentLodTransitionDistance           = 400,
                EnvironmentLodTransitionDistanceBackground = 800,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.High,

                //Models
                ModelsRenderTechnique        = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.High,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighBlended,
                ModelsMaskedRenderTechnique  = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighMasked,
                ModelsHoloRenderTechnique    = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighChannels,
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.HighInstanced,

                //Shadows
                ShadowCascadeLODTreshold      = 2,
                ShadowMapCascadeSize          = 1024,
                SecondaryShadowMapCascadeSize = 64,
                ShadowBiasMultiplier          = 2,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

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

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

                // Forward render
                ForwardRender = false,

                // 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            = 10000,
                LodTransitionDistanceFar             = 11000,
                LodTransitionDistanceBackgroundStart = 42000,
                LodTransitionDistanceBackgroundEnd   = 50000,

                EnvironmentLodTransitionDistance           = 500,
                EnvironmentLodTransitionDistanceBackground = 1000,

                //Textures
                TextureQuality = TextureQuality.Full,

                //Voxels
                VoxelsRenderTechnique = MyEffectVoxelsBase.MyEffectVoxelsTechniqueEnum.Extreme,

                //Models
                ModelsRenderTechnique        = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Extreme,
                ModelsBlendedRenderTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeBlended,
                ModelsMaskedRenderTechnique  = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeMasked,
                ModelsHoloRenderTechnique    = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Holo,
                //ModelsChannelsTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeChannels,
                ModelsStencilTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.Stencil,
                //ModelsStencilTechniqueInstanced = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.StencilInstanced,
                //ModelsInstancedTechnique = MyEffectModelsDNS.MyEffectModelsDNSTechniqueEnum.ExtremeInstanced,

                //Shadows
                ShadowCascadeLODTreshold      = 4,
                ShadowMapCascadeSize          = 2048,
                SecondaryShadowMapCascadeSize = 128,
                ShadowBiasMultiplier          = 2,
                EnableCascadeBlending         = true,

                //HDR
                EnableHDR = true,

                //SSAO
                EnableSSAO = true,

                //FXAA
                EnableFXAA = true,

                //Environmentals
                EnableEnvironmentals = true,

                //GodRays
                EnableGodRays = true,

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

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

                // Forward render
                ForwardRender = false,

                // 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];
        }