Skip to content

Game.Settings.TextureQualitySettings

Assembly:
Game (Assembly-CSharp)

Namespace:
Game.Settings

Type:
class

Base:
QualitySetting

Summary:
Represents texture-quality related options exposed to the settings UI (mip bias and texture filter mode). This class is annotated with UI attributes ([SettingsUIAdvanced], [SettingsUISection("TextureQualitySettings")], [SettingsUIDisableByCondition(typeof(TextureQualitySettings), "IsOptionsDisabled")]) so it integrates with the game's settings UI. It provides preset configurations for VeryLow / Low / Medium / High quality levels and applies changes to the runtime rendering system by calling ManagedBatchSystem.ResetVT(mipbias, filterMode) through the ECS World when Apply() is invoked.


Fields

  • private static TextureQualitySettings highQuality
    Preconfigured preset for the High quality level. Values:
  • mipbias = 0
  • filterMode = FilterMode.Trilinear

  • private static TextureQualitySettings mediumQuality
    Preconfigured preset for the Medium quality level. Values:

  • mipbias = 1
  • filterMode = FilterMode.Trilinear

  • private static TextureQualitySettings lowQuality
    Preconfigured preset for the Low quality level. Values:

  • mipbias = 2
  • filterMode = FilterMode.Bilinear

  • private static TextureQualitySettings veryLowQuality
    Preconfigured preset for the Very Low quality level. Values:

  • mipbias = 3
  • filterMode = FilterMode.Bilinear

  • static TextureQualitySettings()
    Type initializer (static constructor) that registers the above presets with the QualitySetting.RegisterSetting API for the corresponding Level enum values (VeryLow, Low, Medium, High).

Properties

  • public int mipbias { get; set; }
    Controls the global texture mip bias. Exposed to the settings UI with a slider: min = 0, max = 3, step = 1, unit = "integer". Lower values favor higher-resolution mipmaps; higher values increase bias toward lower-resolution mips (reducing texture detail and memory bandwidth).

  • public FilterMode filterMode { get; set; }
    Texture filtering mode (UnityEngine.FilterMode). Common values used in presets are FilterMode.Trilinear for higher quality and FilterMode.Bilinear for lower quality.

Constructors

  • public TextureQualitySettings()
    Default constructor. Leaves properties at their CLR defaults (mipbias = 0, filterMode = default(FilterMode) unless set afterwards or a preset applied).

  • public TextureQualitySettings(Level quality)
    Constructs the settings and calls SetLevel(quality, apply: false) to load the preset values for the specified quality level without immediately applying them to the runtime systems.

  • static TextureQualitySettings()
    Static constructor used to register the preset instances (veryLowQuality, lowQuality, mediumQuality, highQuality) with the QualitySetting infrastructure at type initialization time.

Methods

  • public override void Apply()
    Applies the settings. This method calls base.Apply() (inherited behavior) and then attempts to update the runtime rendering/virtual-texturing state by locating the ManagedBatchSystem from the ECS world and calling ResetVT(mipbias, filterMode). The call path is: World.DefaultGameObjectInjectionWorld?.GetExistingSystemManaged()?.ResetVT(mipbias, filterMode) This updates the virtual texturing parameters (mip bias and filter) in the rendering system. If the ManagedBatchSystem or the default world is not available, no runtime change is performed.

Usage Example

// Example: create and apply the high-quality preset at runtime
var settings = new TextureQualitySettings(Level.High);
settings.Apply();

// Or modify values manually and apply
var custom = new TextureQualitySettings();
custom.mipbias = 1; // moderate detail
custom.filterMode = UnityEngine.FilterMode.Trilinear;
custom.Apply();