public void SetShadowResolution() { shadowResValue = shadowResDD.value; switch (shadowResValue) { case 0: shadowResolution = ShadowResolution.Low; break; case 1: shadowResolution = ShadowResolution.Medium; break; case 2: shadowResolution = ShadowResolution.High; break; case 3: shadowResolution = ShadowResolution.VeryHigh; break; } QualitySettings.shadowResolution = shadowResolution; }
/// <summary> /// Load values found inside PlayerPrefs. /// </summary> private void LoadValues() { ResolutionIndex = PlayerPrefs.GetInt("SETTINGSMANAGER_RESOLUTIONINDEX", ResolutionIndex); if (ResolutionIndex <= -1) { Vector2Int currentResolution = new Vector2Int(Screen.currentResolution.width, Screen.currentResolution.height); bool exit = false; foreach (KeyValuePair <AspectRatioTypes, Vector2Int[]> aspectRatio in m_ResolutionList) { for (int i = 0; i < aspectRatio.Value.Length; i++) { if (currentResolution == aspectRatio.Value[i]) { ResolutionIndex = i; AspectRatio = aspectRatio.Key; exit = true; break; } } if (exit) { break; } } if (ResolutionIndex == -1) { // Standard 1080p ResolutionIndex = 2; AspectRatio = AspectRatioTypes.Ratio16by9; } } else { AspectRatio = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_ASPECTRATIO", AspectRatio); } Fullscreen = PlayerPrefsUtil.GetBool("SETTINGSMANAGER_FULLSCREEN", Fullscreen); RefreshRate = PlayerPrefs.GetInt("SETTINGSMANAGER_REFRESHRATE", RefreshRate); PixelLightCount = PlayerPrefs.GetInt("SETTINGSMANAGER_PIXELLIGHTCOUNT", PixelLightCount); TextureQuality = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_TEXTUREQUALITYTYPE", TextureQuality); AnisotropicFiltering = PlayerPrefsUtil.GetBool("SETTINGSMANAGER_ANISOTROPICFILTERING", AnisotropicFiltering); AntiAliasing = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_ANTIALIASING", AntiAliasing); SoftParticles = PlayerPrefsUtil.GetBool("SETTINGSMANAGER_SOFTPARTICLES", SoftParticles); RealtimeReflectionProbe = PlayerPrefsUtil.GetBool("SETTINGSMANAGER_REALTIMEREFLECTIONPROBE", RealtimeReflectionProbe); VSyncCount = PlayerPrefs.GetInt("SETTINGSMANAGER_VSYNCCOUNT", VSyncCount); ShadowQualityType = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWQUALITYTYPE", ShadowQualityType); ShadowResolutionType = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWRESOLUTIONTYPE", ShadowResolutionType); ShadowProjectionType = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWPROJECTIONTYPE", ShadowProjectionType); ShadowDistance = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWDISTANCETYPE", ShadowDistance); ShadowmaskModeType = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWMASKMODE", ShadowmaskModeType); ShadowNearPlaneOffset = PlayerPrefs.GetInt("SETTINGSMANAGER_SHADOWNEARPLANEOFFSET", ShadowNearPlaneOffset); ShadowCascadeType = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_SHADOWCASCADETYPE", ShadowCascadeType); }
public Config(Config _config) { screenSize = _config.screenSize; screenMode = _config.screenMode; FPSLimit = _config.FPSLimit; antiAliasing = _config.antiAliasing; shadowResolution = _config.shadowResolution; ambientOcclusion = _config.ambientOcclusion; }
public Config(Vector2Int _screenSize, FullScreenMode _screenMode, int _fps, int _aa, ShadowResolution _sr, bool _ao) { screenSize = _screenSize; screenMode = _screenMode; FPSLimit = _fps; antiAliasing = _aa; shadowResolution = _sr; ambientOcclusion = _ao; }
public void ConfrimSettings() { var resol = resolutions.Find(t => t.index == dropDownResol.value); Screen.SetResolution(resol.value_1, resol.value_2, true); var antialias = antialaisings.Find(t => t.index == dropDownAntialaisings.value); QualitySettings.antiAliasing = antialias.value_1; var texture = textures.Find(t => t.index == dropDownTextures.value); QualitySettings.masterTextureLimit = texture.value_1; QualitySettings.vSyncCount = v_sync.isOn ? 1 : 0; var shadow = shadows.Find(t => t.index == dropDownShadow.value); ShadowQuality sh_q = new ShadowQuality(); ShadowResolution sh_resol = new ShadowResolution(); if (shadow.value_1 == 0) { sh_q = ShadowQuality.Disable; } else if (shadow.value_1 == 1) { sh_q = ShadowQuality.All; switch (shadow.value_2) { case 0: sh_resol = ShadowResolution.Low; break; case 1: sh_resol = ShadowResolution.Medium; break; case 2: sh_resol = ShadowResolution.High; break; case 3: sh_resol = ShadowResolution.VeryHigh; break; default: sh_resol = ShadowResolution.Medium; break; } } QualitySettings.shadows = sh_q; QualitySettings.shadowResolution = sh_resol; SaveSettings(resol.index, antialias.index, texture.index, QualitySettings.vSyncCount, shadow.index); }
public Config() { screenSize = new Vector2Int(1920, 1080); screenMode = FullScreenMode.FullScreenWindow; FPSLimit = 144; antiAliasing = 8; shadowResolution = ShadowResolution.VeryHigh; ambientOcclusion = true; //Debug.Log("new config(): " + FPSLimit); }
private void changeShadowResolution(ShadowResolution resolution) { QualitySettings.shadowResolution = resolution; shadowResolutionsDico[settings.shadowResolution].GetComponent <Image>().color = new Color(255, 255, 255); shadowResolutionsDico[resolution].GetComponent <Image>().color = new Color(62, 255, 0); settings.shadowResolution = resolution; Save(); }
void CloneGlobalShadowSettings() { shadows = QualitySettings.shadows; ShadowResolution = QualitySettings.shadowResolution; shadowNearPlaneOffset = QualitySettings.shadowNearPlaneOffset; shadowCascades = QualitySettings.shadowCascades; ShadowProjection = QualitySettings.shadowProjection; shadowDistance = QualitySettings.shadowDistance; shadowCascade2Split = QualitySettings.shadowCascade2Split; shadowCascade4Split = QualitySettings.shadowCascade4Split; }
private LODAdjustment FindMatchingShadowQualityIndex(ShadowResolution Quality) { for (index = 0; index < ShadowQualityLods.Count; index++) { if (ShadowQualityLods[index].ShadowResolution.Equals(Quality)) { return(ShadowQualityLods[index]); } } return(null); }
public LWDpipeline(LWDAsset asset) { Shader.globalRenderPipeline = "LWD"; SupportDynamicBatching = asset.SupportDynamicBatching; ShadowAltasResolution = asset.ShadowAltasResolution; ShadowDistance = asset.ShadowDistance; ShadowCascades = asset.ShadowCascades; useSoftShadow = asset.useSoftShadow; softShadowType = asset.softShadowType; m_Renderer = new ScriptableRenderer(asset); }
// Start is called before the first frame update private void Start() { // Set Shadow level and shadow quality _shadowLevel = QualitySettings.shadows; _shadowQuality = QualitySettings.shadowResolution; // OPTIONAL // Force set dropdown component ForceSetModule(); // Check if the module is available ModuleAvailable(); // Init shadow module InitModule(); }
public void OnAfterDeserialize() { if (k_AssetVersion < 3) { k_AssetVersion = 3; m_SoftShadowsSupported = (m_ShadowType == ShadowQuality.SoftShadows); } if (k_AssetVersion < 4) { k_AssetVersion = 4; m_AdditionalLightShadowsSupported = m_LocalShadowsSupported; m_AdditionalLightsShadowmapResolution = m_LocalShadowsAtlasResolution; m_AdditionalLightsPerObjectLimit = m_MaxPixelLights; m_MainLightShadowmapResolution = m_ShadowAtlasResolution; } }
public void ResetSettingOption() { //Graphics resolution = 3; SetResolution(); fullScreenToggle.isOn = true; Screen.fullScreen = fullScreenToggle.isOn; QualitySettings.vSyncCount = 0; vSyncToggle.isOn = false; QualityLevel = 2; QualitySettings.SetQualityLevel(QualityLevel); QualityLevelDD.value = QualityLevel; shadowResolution = ShadowResolution.High; shadowResDD.value = shadowResValue; antiAliasing = 2; QualitySettings.antiAliasing = antiAliasing; antiAliasingDD.value = antiAliasing; activeShadows = true; QualitySettings.shadows = ShadowQuality.All; activeShadowsToggle.enabled = activeShadows; gammaLevel = 0.5f; gammaLevelSlider.value = gammaLevel; RenderSettings.ambientLight = new Color(gammaLevel, gammaLevel, 1); shadowResDD.value = 1; QualitySettings.shadowResolution = ShadowResolution.Medium; sliderMaterVolume.value = 1; sliderMusicVolume.value = 1; sliderAmbientVolume.value = 1; sliderFXVolume.value = 1; sliderMaterVolume.value = AudioManager.GetMasterVolume(); sliderMusicVolume.value = AudioManager.GetMusicVolume(); sliderAmbientVolume.value = AudioManager.GetAmbientVolume(); AudioManager.SetMasterVolume(sliderMaterVolume.value); AudioManager.SetSFXVolume(sliderFXVolume.value); AudioManager.SetMusicVolume(sliderMusicVolume.value); AudioManager.SetAmbientVolume(sliderAmbientVolume.value); }
/// <summary> /// /// </summary> /// <param name="isSet"></param> public QualitySettingsKun(bool isSet) : base() { isDirty = false; if (isSet) { activeColorSpace = QualitySettings.activeColorSpace; anisotropicFiltering = QualitySettings.anisotropicFiltering; antiAliasing = QualitySettings.antiAliasing; asyncUploadBufferSize = QualitySettings.asyncUploadBufferSize; asyncUploadPersistentBuffer = QualitySettings.asyncUploadPersistentBuffer; asyncUploadTimeSlice = QualitySettings.asyncUploadTimeSlice; billboardsFaceCameraPosition = QualitySettings.billboardsFaceCameraPosition; desiredColorSpace = QualitySettings.desiredColorSpace; lodBias = QualitySettings.lodBias; masterTextureLimit = QualitySettings.masterTextureLimit; maximumLODLevel = QualitySettings.maximumLODLevel; maxQueuedFrames = QualitySettings.maxQueuedFrames; names = QualitySettings.names; particleRaycastBudget = QualitySettings.particleRaycastBudget; pixelLightCount = QualitySettings.pixelLightCount; realtimeReflectionProbes = QualitySettings.realtimeReflectionProbes; resolutionScalingFixedDPIFactor = QualitySettings.resolutionScalingFixedDPIFactor; shadowCascade2Split = QualitySettings.shadowCascade2Split; mShadowCascade4Split = new Vector3Kun(QualitySettings.shadowCascade4Split); shadowCascades = QualitySettings.shadowCascades; shadowDistance = QualitySettings.shadowDistance; shadowmaskMode = QualitySettings.shadowmaskMode; shadowNearPlaneOffset = QualitySettings.shadowNearPlaneOffset; shadowProjection = QualitySettings.shadowProjection; shadowResolution = QualitySettings.shadowResolution; shadows = QualitySettings.shadows; #if UNITY_2019_1_OR_NEWER skinWeights = QualitySettings.skinWeights; #endif softParticles = QualitySettings.softParticles; softVegetation = QualitySettings.softVegetation; streamingMipmapsActive = QualitySettings.streamingMipmapsActive; streamingMipmapsAddAllCameras = QualitySettings.streamingMipmapsAddAllCameras; streamingMipmapsMaxFileIORequests = QualitySettings.streamingMipmapsMaxFileIORequests; streamingMipmapsMaxLevelReduction = QualitySettings.streamingMipmapsMaxLevelReduction; streamingMipmapsMemoryBudget = QualitySettings.streamingMipmapsMemoryBudget; streamingMipmapsRenderersPerFrame = QualitySettings.streamingMipmapsRenderersPerFrame; vSyncCount = QualitySettings.vSyncCount; } }
/// <summary> /// Load values from a SettingPreset object minus resolution. /// </summary> public void LoadValues(SettingsPreset preset) { PixelLightCount = preset.PixelLightCount; TextureQuality = preset.TextureQuality; AnisotropicFiltering = preset.AnisotropicFiltering; AntiAliasing = preset.AntiAliasing; SoftParticles = preset.SoftParticles; RealtimeReflectionProbe = preset.RealtimeReflectionProbe; VSyncCount = preset.VSyncCount; ShadowQualityType = preset.ShadowQualityType; ShadowResolutionType = preset.ShadowResolutionType; ShadowProjectionType = preset.ShadowProjectionType; ShadowDistance = preset.ShadowDistance; ShadowmaskModeType = preset.ShadowmaskModeType; ShadowNearPlaneOffset = preset.ShadowNearPlaneOffset; ShadowCascadeType = preset.ShadowCascadeType; }
/// <summary> /// /// </summary> /// <param name="binaryReader"></param> public virtual void Deserialize(BinaryReader binaryReader) { activeColorSpace = (ColorSpace)binaryReader.ReadInt32(); anisotropicFiltering = (AnisotropicFiltering)binaryReader.ReadInt32(); antiAliasing = binaryReader.ReadInt32(); asyncUploadBufferSize = binaryReader.ReadInt32(); asyncUploadPersistentBuffer = binaryReader.ReadBoolean(); asyncUploadTimeSlice = binaryReader.ReadInt32(); billboardsFaceCameraPosition = binaryReader.ReadBoolean(); desiredColorSpace = (ColorSpace)binaryReader.ReadInt32(); lodBias = binaryReader.ReadSingle(); masterTextureLimit = binaryReader.ReadInt32(); maximumLODLevel = binaryReader.ReadInt32(); maxQueuedFrames = binaryReader.ReadInt32(); names = SerializerKun.DesirializeStrings(binaryReader); particleRaycastBudget = binaryReader.ReadInt32(); pixelLightCount = binaryReader.ReadInt32(); realtimeReflectionProbes = binaryReader.ReadBoolean(); resolutionScalingFixedDPIFactor = binaryReader.ReadSingle(); shadowCascade2Split = binaryReader.ReadSingle(); mShadowCascade4Split = SerializerKun.DesirializeObject <Vector3Kun>(binaryReader); shadowCascades = binaryReader.ReadInt32(); shadowDistance = binaryReader.ReadSingle(); shadowmaskMode = (ShadowmaskMode)binaryReader.ReadInt32(); shadowNearPlaneOffset = binaryReader.ReadSingle(); shadowProjection = (ShadowProjection)binaryReader.ReadInt32(); shadowResolution = (ShadowResolution)binaryReader.ReadInt32(); shadows = (ShadowQuality)binaryReader.ReadInt32(); #if UNITY_2019_1_OR_NEWER skinWeights = (SkinWeights)binaryReader.ReadInt32(); #endif softParticles = binaryReader.ReadBoolean(); softVegetation = binaryReader.ReadBoolean(); streamingMipmapsActive = binaryReader.ReadBoolean(); streamingMipmapsAddAllCameras = binaryReader.ReadBoolean(); streamingMipmapsMaxFileIORequests = binaryReader.ReadInt32(); streamingMipmapsMaxLevelReduction = binaryReader.ReadInt32(); streamingMipmapsMemoryBudget = binaryReader.ReadSingle(); streamingMipmapsRenderersPerFrame = binaryReader.ReadInt32(); vSyncCount = binaryReader.ReadInt32(); isDirty = binaryReader.ReadBoolean(); }
private ShadowResolution getShadowResolution(string resolution) { ShadowResolution res = QualitySettings.shadowResolution; switch (resolution) { case "Low": res = ShadowResolution.Low; break; case "Medium": res = ShadowResolution.Medium; break; case "High": res = ShadowResolution.High; break; case "Very High": res = ShadowResolution.VeryHigh; break; } return(res); }
void SetShadowResolution(ShadowResolution resolution) { QualitySettings.shadowResolution = resolution; }
void Start() { inGame = GameObject.Find("Main") != null; settings = new Settings(); volumeSlider.value = settings.volume; changeVolume(); fullscreen_on.SetActive(settings.fullscreen); fullscreen_off.SetActive(!settings.fullscreen); //changeFullscreen(settings.fullscreen); //RESOLUTIONS List <Resolution> rs = new List <Resolution>(); rs.AddRange(Screen.resolutions); resolutionsDico = new Dictionary <string, GameObject>(); foreach (GameObject g in resolutions) { string width = g.name.Split('x')[0]; string height = g.name.Split('x')[1]; if (rs.TrueForAll(p => p.width + "" != width || p.height + "" != height)) { g.SetActive(false); } else { Resolution r = rs.Find(p => p.width + "" == width && p.height + "" == height); resolutionsDico.Add(r.width + "x" + r.height, g); if (settings.resolutionW + "" == width && settings.resolutionH + "" == height) { //g.GetComponent<Image>().color = new Color(62, 255, 0); //changeResolution(settings.resolutionW + "x" + settings.resolutionH); } } } //------- Vsync_on.SetActive(settings.vSync); Vsync_off.SetActive(!settings.vSync); changeVsync(settings.vSync); //SHADOW RESOLUTIONS shadowResolutionsDico = new Dictionary <ShadowResolution, GameObject>(); foreach (GameObject g in shadowResolutions) { ShadowResolution res = getShadowResolution(g.name); shadowResolutionsDico.Add(res, g); if (res == QualitySettings.shadowResolution) { //g.GetComponent<Image>().color = new Color(62, 255, 0); changeShadowResolution(res); } } //------ shadow_on.SetActive(settings.shadow); shadow_off.SetActive(!settings.shadow); changeShadow(settings.shadow); //ANTI ALIASING antiAliasingsDico = new Dictionary <int, GameObject>(); foreach (GameObject g in antiAliasings) { int aa = Int32.Parse(g.name.Replace("x", "")); antiAliasingsDico.Add(aa, g); if (aa == QualitySettings.antiAliasing) { changeAntiAliasing(aa); } } //------- particlesReduction_on.SetActive(settings.particlesReduction); particlesReduction_off.SetActive(!settings.particlesReduction); changeParticlesReduction(settings.particlesReduction); fovSlider.value = settings.fov; if (Camera.main != null) { changeFov(); } forwardText.text = settings.forward.ToString(); leftText.text = settings.left.ToString(); backwardText.text = settings.backward.ToString(); rightText.text = settings.right.ToString(); sprintText.text = settings.sprint.ToString(); jumpText.text = settings.jump.ToString(); pauseText.text = settings.pause.ToString(); hintText.text = settings.hint.ToString(); fireText.text = settings.fire.ToString(); lastWait = null; mousSensibilitySlider.value = settings.mouseSensibility; changeMouseSensibility(); frenchLang_off.SetActive(settings.lang != "french"); frenchLang_on.SetActive(settings.lang == "french"); englishLang_off.SetActive(settings.lang != "english"); englishLang_on.SetActive(settings.lang == "english"); changeLang(settings.lang); }
void Awake() { buffer = new CommandBuffer(); uniqueTextureID = Shader.PropertyToID(ReflectionSample); if (!normalTrans) { normalTrans = new GameObject("Normal Trans").transform; normalTrans.position = transform.position; normalTrans.rotation = transform.rotation; normalTrans.SetParent(transform); } render = GetComponent <Renderer>(); if (!render || !render.sharedMaterial) { Destroy(this); } for (int i = 0; i < allMirrors.Length; ++i) { allMirrors[i].manager = this; } for (int i = 0, length = render.sharedMaterials.Length; i < length; ++i) { Material m = render.sharedMaterials[i]; if (!allMats.Contains(m)) { allMats.Add(m); } } for (int i = 0; i < allMirrors.Length; ++i) { Renderer r = allMirrors[i].GetRenderer(); for (int a = 0, length = r.sharedMaterials.Length; a < length; ++a) { Material m = r.sharedMaterials[a]; if (!allMats.Contains(m)) { allMats.Add(m); } } } switch (renderQuality) { case RenderQuality.Default: postProcessAction = () => reflectionCamera.Render(); break; case RenderQuality.High: postProcessAction = () => { billboard = QualitySettings.billboardsFaceCameraPosition; QualitySettings.billboardsFaceCameraPosition = false; softParticle = QualitySettings.softParticles; softVeg = QualitySettings.softVegetation; QualitySettings.softParticles = false; QualitySettings.softVegetation = false; ani = QualitySettings.anisotropicFiltering; QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable; shaR = QualitySettings.shadowResolution; QualitySettings.shadowResolution = ShadowResolution.High; reflectionCamera.Render(); QualitySettings.softParticles = softParticle; QualitySettings.softVegetation = softVeg; QualitySettings.billboardsFaceCameraPosition = billboard; QualitySettings.anisotropicFiltering = ani; QualitySettings.shadowResolution = shaR; }; break; case RenderQuality.Medium: postProcessAction = () => { softParticle = QualitySettings.softParticles; softVeg = QualitySettings.softVegetation; QualitySettings.softParticles = false; QualitySettings.softVegetation = false; billboard = QualitySettings.billboardsFaceCameraPosition; QualitySettings.billboardsFaceCameraPosition = false; shadowQuality = QualitySettings.shadows; QualitySettings.shadows = ShadowQuality.HardOnly; ani = QualitySettings.anisotropicFiltering; QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable; shaR = QualitySettings.shadowResolution; QualitySettings.shadowResolution = ShadowResolution.Low; reflectionCamera.Render(); QualitySettings.softParticles = softParticle; QualitySettings.softVegetation = softVeg; QualitySettings.shadows = shadowQuality; QualitySettings.billboardsFaceCameraPosition = billboard; QualitySettings.anisotropicFiltering = ani; QualitySettings.shadowResolution = shaR; }; break; case RenderQuality.Low: postProcessAction = () => { softParticle = QualitySettings.softParticles; softVeg = QualitySettings.softVegetation; QualitySettings.softParticles = false; QualitySettings.softVegetation = false; shadowQuality = QualitySettings.shadows; QualitySettings.shadows = ShadowQuality.Disable; ani = QualitySettings.anisotropicFiltering; QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable; reflectionCamera.Render(); QualitySettings.softParticles = softParticle; QualitySettings.softVegetation = softVeg; QualitySettings.shadows = shadowQuality; QualitySettings.anisotropicFiltering = ani; }; break; case RenderQuality.VeryLow: postProcessAction = () => { ani = QualitySettings.anisotropicFiltering; QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable; reflectionCamera.Render(); QualitySettings.anisotropicFiltering = ani; }; break; } m_SqrMaxdistance = m_maxDistance * m_maxDistance; widthHeightRate = (float)Screen.height / (float)Screen.width; m_ReflectionTexture = new RenderTexture(m_TextureSize, (int)(m_TextureSize * widthHeightRate + 0.5), 24, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Default); m_ReflectionTexture.name = "ReflectionTex " + GetInstanceID(); m_ReflectionTexture.isPowerOfTwo = true; m_ReflectionTexture.filterMode = FilterMode.Trilinear; m_ReflectionTexture.antiAliasing = (int)antiAlias; GameObject go = new GameObject("MirrorCam", typeof(Camera), typeof(FlareLayer)); //go.hideFlags = HideFlags.HideAndDontSave; reflectionCamera = go.GetComponent <Camera>(); //mysky = go.AddComponent<Skybox> (); go.transform.SetParent(normalTrans); go.transform.localPosition = Vector3.zero; reflectionCamera.enabled = false; reflectionCamera.targetTexture = m_ReflectionTexture; reflectionCamera.cullingMask = ~(1 << 4) & m_ReflectLayers.value; reflectionCamera.layerCullSpherical = enableSelfCullingDistance; refT = reflectionCamera.transform; if (!enableSelfCullingDistance) { for (int i = 0, length = layerCullingDistances.Length; i < length; ++i) { layerCullingDistances[i] = 0; } } else { reflectionCamera.layerCullDistances = layerCullingDistances; } reflectionCamera.useOcclusionCulling = false; //Custom Projection Camera should not use occlusionCulling! SetTexture(m_ReflectionTexture); buffer.name = "Postprocessing Buffer"; if (addPostProcessingComponent) { buffer.GetTemporaryRT(ShaderIDs._TempTex, m_ReflectionTexture.descriptor); buffer.BlitSRT(BuiltinRenderTextureType.CameraTarget, ShaderIDs._TempTex, EdgeBlurAAMaterial, 0); buffer.BlitSRT(ShaderIDs._TempTex, BuiltinRenderTextureType.CameraTarget, FXAAMateiral, 0); buffer.ReleaseTemporaryRT(ShaderIDs._TempTex); reflectionCamera.AddCommandBuffer(CameraEvent.AfterForwardAlpha, buffer); } }
public static void SetShadowQuality(ShadowResolution sr) { QualitySettings.shadowResolution = sr; }
/// <summary> /// Load values from a SettingPreset object including resolution. /// </summary> public void LoadValues(SettingsPreset preset, bool loadResolution) { if (loadResolution) { ResolutionIndex = PlayerPrefs.GetInt("SETTINGSMANAGER_RESOLUTIONINDEX", ResolutionIndex); if (ResolutionIndex <= -1) { Vector2Int currentResolution = new Vector2Int(Screen.currentResolution.width, Screen.currentResolution.height); bool exit = false; foreach (KeyValuePair <AspectRatioTypes, Vector2Int[]> aspectRatio in m_ResolutionList) { for (int i = 0; i < aspectRatio.Value.Length; i++) { if (currentResolution == aspectRatio.Value[i]) { ResolutionIndex = i; AspectRatio = aspectRatio.Key; exit = true; break; } } if (exit) { break; } } if (ResolutionIndex == -1) { // Standard 1080p ResolutionIndex = 2; AspectRatio = AspectRatioTypes.Ratio16by9; } } else { AspectRatio = PlayerPrefsUtil.GetEnum("SETTINGSMANAGER_ASPECTRATIO", AspectRatio); } Fullscreen = PlayerPrefsUtil.GetBool("SETTINGSMANAGER_FULLSCREEN", Fullscreen); RefreshRate = PlayerPrefs.GetInt("SETTINGSMANAGER_REFRESHRATE", RefreshRate); } PixelLightCount = preset.PixelLightCount; TextureQuality = preset.TextureQuality; AnisotropicFiltering = preset.AnisotropicFiltering; AntiAliasing = preset.AntiAliasing; SoftParticles = preset.SoftParticles; RealtimeReflectionProbe = preset.RealtimeReflectionProbe; VSyncCount = preset.VSyncCount; ShadowQualityType = preset.ShadowQualityType; ShadowResolutionType = preset.ShadowResolutionType; ShadowProjectionType = preset.ShadowProjectionType; ShadowDistance = preset.ShadowDistance; ShadowmaskModeType = preset.ShadowmaskModeType; ShadowNearPlaneOffset = preset.ShadowNearPlaneOffset; ShadowCascadeType = preset.ShadowCascadeType; }
/// <summary> /// Apply changes done to the manager towards the actual game. If overwrite, it will force save all settings, not just the changed ones. /// </summary> public void ApplyChanges(bool overwrite = false) { // Screen if (overwrite || (m_CurrentResolutionIndex != ResolutionIndex || m_CurrentAspectRatio != AspectRatio || m_CurrentlyFullscreen != Fullscreen || m_CurrentRefreshRate != RefreshRate)) { m_CurrentAspectRatio = AspectRatio; m_CurrentResolutionIndex = ResolutionIndex; m_CurrentlyFullscreen = Fullscreen; m_CurrentRefreshRate = RefreshRate; Vector2Int resolution = m_ResolutionList[m_CurrentAspectRatio][m_CurrentResolutionIndex]; Screen.SetResolution(resolution.x, resolution.y, m_CurrentlyFullscreen, m_CurrentRefreshRate); PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_ASPECTRATIO", m_CurrentAspectRatio); PlayerPrefs.SetInt("SETTINGSMANAGER_RESOLUTIONINDEX", m_CurrentResolutionIndex); PlayerPrefsUtil.SetBool("SETTINGSMANAGER_FULLSCREEN", m_CurrentlyFullscreen); PlayerPrefs.GetInt("SETTINGSMANAGER_REFRESHRATE", m_CurrentRefreshRate); } // Graphics if (overwrite || (m_CurrentPixelLightCount != PixelLightCount)) { m_CurrentPixelLightCount = PixelLightCount; QualitySettings.pixelLightCount = m_CurrentPixelLightCount; PlayerPrefs.SetInt("SETTINGSMANAGER_PIXELLIGHTCOUNT", m_CurrentPixelLightCount); } if (overwrite || (m_CurrentTextureQualityType != TextureQuality)) { m_CurrentTextureQualityType = TextureQuality; QualitySettings.masterTextureLimit = (int)m_CurrentTextureQualityType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_TEXTUREQUALITYTYPE", m_CurrentTextureQualityType); } if (overwrite || (m_CurrentAnisotropicFiltering != AnisotropicFiltering)) { m_CurrentAnisotropicFiltering = AnisotropicFiltering; QualitySettings.anisotropicFiltering = m_CurrentAnisotropicFiltering ? UnityEngine.AnisotropicFiltering.Enable : UnityEngine.AnisotropicFiltering.Disable; PlayerPrefsUtil.SetBool("SETTINGSMANAGER_ANISOTROPICFILTERING", m_CurrentAnisotropicFiltering); } if (overwrite || (m_CurrentAntiAliasingType != AntiAliasing)) { m_CurrentAntiAliasingType = AntiAliasing; QualitySettings.antiAliasing = (int)m_CurrentAntiAliasingType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_ANTIALIASINGTYPE", m_CurrentAntiAliasingType); } if (overwrite || (m_CurrentSoftParticles != SoftParticles)) { m_CurrentSoftParticles = SoftParticles; QualitySettings.softParticles = m_CurrentSoftParticles; PlayerPrefsUtil.SetBool("SETTINGSMANAGER_SOFTPARTICLES", m_CurrentSoftParticles); } if (overwrite || (m_CurrentRealtimeReflectionProbe != RealtimeReflectionProbe)) { m_CurrentRealtimeReflectionProbe = RealtimeReflectionProbe; QualitySettings.realtimeReflectionProbes = m_CurrentRealtimeReflectionProbe; PlayerPrefsUtil.SetBool("SETTINGSMANAGER_REALTIMEREFLECTIONPROBE", m_CurrentRealtimeReflectionProbe); } if (overwrite || (m_CurrentVSyncCount != VSyncCount)) { m_CurrentVSyncCount = VSyncCount; QualitySettings.vSyncCount = VSyncCount; PlayerPrefs.SetInt("SETTINGSMANAGER_VSYNCCOUNT", m_CurrentVSyncCount); } // Shadows if (overwrite || (m_CurrentShadowQualityType != ShadowQualityType)) { m_CurrentShadowQualityType = ShadowQualityType; QualitySettings.shadows = m_CurrentShadowQualityType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWQUALITYTYPE", m_CurrentShadowQualityType); } if (overwrite || (m_CurrentShadowResolutionType != ShadowResolutionType)) { m_CurrentShadowResolutionType = ShadowResolutionType; QualitySettings.shadowResolution = m_CurrentShadowResolutionType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWRESOLUTIONTYPE", m_CurrentShadowQualityType); } if (overwrite || (m_CurrentShadowProjectionType != ShadowProjectionType)) { m_CurrentShadowProjectionType = ShadowProjectionType; QualitySettings.shadowProjection = m_CurrentShadowProjectionType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWPROJECTIONTYPE", m_CurrentShadowProjectionType); } if (overwrite || (m_CurrentShadowDistanceType != ShadowDistance)) { m_CurrentShadowDistanceType = ShadowDistance; QualitySettings.shadowDistance = (int)m_CurrentShadowDistanceType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWDISTANCETYPE", m_CurrentShadowProjectionType); } if (overwrite || (m_CurrentShadowmaskModeType != ShadowmaskModeType)) { m_CurrentShadowmaskModeType = ShadowmaskModeType; QualitySettings.shadowmaskMode = m_CurrentShadowmaskModeType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWMASKMODE", m_CurrentShadowmaskModeType); } if (overwrite || (m_CurrentShadowNearPlaneOffset != ShadowNearPlaneOffset)) { m_CurrentShadowNearPlaneOffset = ShadowNearPlaneOffset; QualitySettings.shadowNearPlaneOffset = m_CurrentShadowNearPlaneOffset; PlayerPrefs.SetInt("SETTINGSMANAGER_SHADOWNEARPLANEOFFSET", m_CurrentShadowNearPlaneOffset); } if (overwrite || (m_CurrentShadowCascadeType != ShadowCascadeType)) { m_CurrentShadowCascadeType = ShadowCascadeType; QualitySettings.shadowCascades = (int)m_CurrentShadowCascadeType; PlayerPrefsUtil.SetEnum("SETTINGSMANAGER_SHADOWCASCADETYPE", m_CurrentShadowCascadeType); } }
private LODAdjustment FindMatchingShadowQualityIndex(ShadowResolution Quality) { return(ShadowQualityLods.Find((lod) => lod.ShadowResolution.Equals(Quality))); }
/// <summary> /// Save current settings to default settings /// </summary> public void SaveCurrentToDefault() { defaultProceduralSunIntensity = proceduralSunIntensity; defaultProceduralLWRPSunIntensity = proceduralLWRPSunIntensity; defaultProceduralHDRPSunIntensity = proceduralHDRPSunIntensity; defaultProceduralSunColor = proceduralSunColor; defaultProceduralSunSize = proceduralSunSize; defaultHDRPProceduralSunSize = hdrpProceduralSunSize; defaultProceduralSunSizeConvergence = proceduralSunSizeConvergence; defaultHDRPProceduralSunSizeConvergence = hdrpProceduralSunSizeConvergence; defaultProceduralAtmosphereThickness = proceduralAtmosphereThickness; defaultProceduralGroundColor = proceduralGroundColor; defaultProceduralSkyTint = proceduralSkyTint; defaultProceduralSkyExposure = proceduralSkyExposure; defaultProceduralSkyboxRotation = proceduralSkyboxRotation; defaultProceduralSkyboxPitch = proceduralSkyboxPitch; defaultIncludeSunInBaking = includeSunInBaking; defaultUseSkies = useSkies; defaultSkyboxGroundIntensity = skyboxGroundIntensity; defaultSkyboxRotation = skyboxRotation; defaultSkyboxPitch = skyboxPitch; defaultShadowDistance = shadowDistance; defaultShadowType = shadowType; defaultShadowStrength = shadowStrength; defaultIndirectLightMultiplier = indirectLightMultiplier; defaultProceduralFogColor = proceduralFogColor; defaultProceduralFogDistance = proceduralFogDistance; defaultProceduralNearFogDistance = proceduralNearFogDistance; defaultProceduralFogDensity = proceduralFogDensity; defaultScaleHorizonObjectWithFog = scaleHorizonObjectWithFog; defaultHorizonSkyEnabled = horizonSkyEnabled; defaultHorizonBlend = horizonBlend; defaultHorizonFalloff = horizonFalloff; defaultHorizonFogDensity = horizonFogDensity; defaultHorizonScattering = horizonScattering; defaultHorizonSize = horizonSize; defaultFollowPlayer = followPlayer; defaultHorizonPosition = horizonPosition; defaultHorizonUpdateTime = horizonUpdateTime; defaultAmbientMode = ambientMode; defaultSkyColor = skyColor; defaultEquatorColor = equatorColor; defaultGroundColor = groundColor; defaultLWRPSkyColor = lwrpSkyColor; defaultLWRPEquatorColor = lwrpEquatorColor; defaultLWRPGroundColor = lwrpGroundColor; defaultShadowQuality = shadowQuality; defaultShadowmaskMode = shadowmaskMode; defaultShadowQuality = shadowQuality; defaultShadowResolution = shadowResolution; defaultShadowProjection = shadowProjection; defaultCascadeCount = cascadeCount; defaultEnableSunDisk = enableSunDisk; defaultProceduralSkyMultiplier = proceduralSkyMultiplier; defaultIsGlobal = isGlobal; defaultBlendDistance = blendDistance; defaultWeight = weight; defaultPriority = priority; defaultHDRIExposure = hDRIExposure; defaultHDRIMultiplier = hDRIMultiplier; defaultHDRIUpdateMode = hDRIUpdateMode; defaultHDRIRotation = hDRIRotation; defaultMaxShadowDistance = maxShadowDistance; defaultCascadeSplit1 = cascadeSplit1; defaultCascadeSplit2 = cascadeSplit2; defaultCascadeSplit3 = cascadeSplit3; defaultUseContactShadows = useContactShadows; defaultContactShadowsLength = contactShadowsLength; defaultContactShadowsDistanceScaleFactor = contactShadowsDistanceScaleFactor; defaultContactShadowsMaxDistance = contactShadowsMaxDistance; defaultContactShadowsFadeDistance = contactShadowsFadeDistance; defaultContactShadowsSampleCount = contactShadowsSampleCount; defaultContactShadowsOpacity = contactShadowsOpacity; defaultUseMicroShadowing = useMicroShadowing; defaultMicroShadowOpacity = microShadowOpacity; defaultVolumetricSingleScatteringAlbedo = volumetricSingleScatteringAlbedo; defaultVolumetricBaseFogDistance = volumetricBaseFogDistance; defaultVolumetricBaseFogHeight = volumetricBaseFogHeight; defaultVolumetricMeanHeight = volumetricMeanHeight; defaultVolumetricGlobalAnisotropy = volumetricGlobalAnisotropy; defaultVolumetricGlobalLightProbeDimmer = volumetricGlobalLightProbeDimmer; defaultVolumetricMaxFogDistance = volumetricMaxFogDistance; defaultVolumetricEnableDistanceFog = volumetricEnableDistanceFog; defaultVolumetricConstFogColor = volumetricConstFogColor; defaultVolumetricMipFogNear = volumetricMipFogNear; defaultVolumetricMipFogFar = volumetricMipFogFar; defaultVolumetricMipFogMaxMip = volumetricMipFogMaxMip; defaultExponentialFogDensity = exponentialFogDensity; defaultExponentialBaseHeight = exponentialBaseHeight; defaultExponentialHeightAttenuation = exponentialHeightAttenuation; defaultExponentialMaxFogDistance = exponentialMaxFogDistance; defaultExponentialMipFogNear = exponentialMipFogNear; defaultExponentialMipFogFar = exponentialMipFogFar; defaultExponentialMipFogMaxMip = exponentialMipFogMaxMip; defaultLinearFogDensity = linearFogDensity; defaultLinearHeightStart = linearHeightStart; defaultLinearHeightEnd = linearHeightEnd; defaultLinearMaxFogDistance = linearMaxFogDistance; defaultLinearMipFogNear = linearMipFogNear; defaultLinearMipFogFar = linearMipFogFar; defaultLinearMipFogMaxMip = linearMipFogMaxMip; defaultVolumetricDistanceRange = volumetricDistanceRange; defaultVolumetricSliceDistributionUniformity = volumetricSliceDistributionUniformity; defaultIndirectDiffuseIntensity = indirectDiffuseIntensity; defaultIndirectSpecularIntensity = indirectSpecularIntensity; defaultEnableScreenSpaceReflections = enableScreenSpaceReflections; defaultScreenEdgeFadeDistance = screenEdgeFadeDistance; defaultMaxNumberOfRaySteps = maxNumberOfRaySteps; defaultObjectThickness = objectThickness; defaultMinSmoothness = minSmoothness; defaultSmoothnessFadeStart = smoothnessFadeStart; defaultReflectSky = reflectSky; defaultEnableScreenSpaceRefractions = enableScreenSpaceRefractions; defaultScreenWeightDistance = screenWeightDistance; defaultUseBakingSky = useBakingSky; defaultUseFogDensityVolume = useFogDensityVolume; defaultSingleScatteringAlbedo = singleScatteringAlbedo; defaultDensityVolumeFogDistance = densityVolumeFogDistance; defaultFogDensityMaskTexture = fogDensityMaskTexture; defaultDensityMaskTiling = densityMaskTiling; defaultDensityScale = densityScale; defaultHDRPFogDistance = hDRPFogDistance; #if HDPipeline #if UNITY_2018_3_OR_NEWER defaultVolumeProfile = volumeProfile; defaultVolumetricFogColorMode = volumetricFogColorMode; defaultFogColorMode = fogColorMode; defaultHDRISkyIntensityMode = hDRISkyIntensityMode; #endif #endif }
/// <summary> /// Revert current settings back to default settings /// </summary> public void RevertToDefault() { proceduralSunSize = defaultProceduralSunSize; hdrpProceduralSunSize = defaultHDRPProceduralSunSize; proceduralSunSizeConvergence = defaultProceduralSunSizeConvergence; hdrpProceduralSunSizeConvergence = defaultHDRPProceduralSunSizeConvergence; proceduralAtmosphereThickness = defaultProceduralAtmosphereThickness; proceduralGroundColor = defaultProceduralGroundColor; proceduralSkyTint = defaultProceduralSkyTint; proceduralSkyExposure = defaultProceduralSkyExposure; proceduralSunColor = defaultProceduralSunColor; proceduralSunIntensity = defaultProceduralSunIntensity; proceduralLWRPSunIntensity = defaultProceduralLWRPSunIntensity; proceduralHDRPSunIntensity = defaultProceduralHDRPSunIntensity; proceduralFogColor = defaultProceduralFogColor; proceduralFogDistance = defaultProceduralFogDistance; proceduralNearFogDistance = defaultProceduralNearFogDistance; proceduralFogDensity = defaultProceduralFogDensity; proceduralSkyboxRotation = defaultProceduralSkyboxRotation; proceduralSkyboxPitch = defaultProceduralSkyboxPitch; includeSunInBaking = defaultIncludeSunInBaking; useSkies = defaultUseSkies; skyboxGroundIntensity = defaultSkyboxGroundIntensity; skyboxRotation = defaultSkyboxRotation; skyboxPitch = defaultSkyboxPitch; shadowStrength = defaultShadowStrength; indirectLightMultiplier = defaultIndirectLightMultiplier; shadowDistance = defaultShadowDistance; shadowType = defaultShadowType; scaleHorizonObjectWithFog = defaultScaleHorizonObjectWithFog; horizonSkyEnabled = defaultHorizonSkyEnabled; horizonBlend = defaultHorizonBlend; horizonFalloff = defaultHorizonFalloff; horizonFogDensity = defaultHorizonFogDensity; horizonScattering = defaultHorizonScattering; horizonSize = defaultHorizonSize; followPlayer = defaultFollowPlayer; horizonPosition = defaultHorizonPosition; horizonUpdateTime = defaultHorizonUpdateTime; ambientMode = defaultAmbientMode; skyColor = defaultSkyColor; equatorColor = defaultEquatorColor; groundColor = defaultGroundColor; lwrpSkyColor = defaultLWRPSkyColor; lwrpEquatorColor = defaultLWRPEquatorColor; lwrpGroundColor = defaultLWRPGroundColor; shadowQuality = defaultShadowQuality; shadowmaskMode = defaultShadowmaskMode; shadowResolution = defaultShadowResolution; shadowProjection = defaultShadowProjection; cascadeCount = defaultCascadeCount; enableSunDisk = defaultEnableSunDisk; proceduralSkyMultiplier = defaultProceduralSkyMultiplier; isGlobal = defaultIsGlobal; blendDistance = defaultBlendDistance; weight = defaultWeight; priority = defaultPriority; maxShadowDistance = defaultMaxShadowDistance; cascadeSplit1 = defaultCascadeSplit1; cascadeSplit2 = defaultCascadeSplit2; cascadeSplit3 = defaultCascadeSplit3; useContactShadows = defaultUseContactShadows; contactShadowsLength = defaultContactShadowsLength; contactShadowsDistanceScaleFactor = defaultContactShadowsDistanceScaleFactor; contactShadowsMaxDistance = defaultContactShadowsMaxDistance; contactShadowsFadeDistance = defaultContactShadowsFadeDistance; contactShadowsSampleCount = defaultContactShadowsSampleCount; contactShadowsOpacity = defaultContactShadowsOpacity; useMicroShadowing = defaultUseMicroShadowing; microShadowOpacity = defaultMicroShadowOpacity; hDRIExposure = defaultHDRIExposure; hDRIMultiplier = defaultHDRIMultiplier; hDRIUpdateMode = defaultHDRIUpdateMode; hDRIRotation = defaultHDRIRotation; volumetricSingleScatteringAlbedo = defaultVolumetricSingleScatteringAlbedo; volumetricBaseFogDistance = defaultVolumetricBaseFogDistance; volumetricBaseFogHeight = defaultVolumetricBaseFogHeight; volumetricMeanHeight = defaultVolumetricMeanHeight; volumetricGlobalAnisotropy = defaultVolumetricGlobalAnisotropy; volumetricGlobalLightProbeDimmer = defaultVolumetricGlobalLightProbeDimmer; volumetricMaxFogDistance = defaultVolumetricMaxFogDistance; volumetricEnableDistanceFog = defaultVolumetricEnableDistanceFog; volumetricConstFogColor = defaultVolumetricConstFogColor; volumetricMipFogNear = defaultVolumetricMipFogNear; volumetricMipFogFar = defaultVolumetricMipFogFar; volumetricMipFogMaxMip = defaultVolumetricMipFogMaxMip; volumetricDistanceRange = defaultVolumetricDistanceRange; volumetricSliceDistributionUniformity = defaultVolumetricSliceDistributionUniformity; exponentialBaseHeight = defaultExponentialBaseHeight; exponentialHeightAttenuation = defaultExponentialHeightAttenuation; exponentialMaxFogDistance = defaultExponentialMaxFogDistance; exponentialMipFogNear = defaultExponentialMipFogNear; exponentialMipFogFar = defaultExponentialMipFogFar; exponentialMipFogMaxMip = defaultExponentialMipFogMaxMip; linearHeightStart = defaultLinearHeightStart; linearHeightEnd = defaultLinearHeightEnd; linearMaxFogDistance = defaultLinearMaxFogDistance; linearMipFogNear = defaultLinearMipFogNear; linearMipFogFar = defaultLinearMipFogFar; linearMipFogMaxMip = defaultLinearMipFogMaxMip; indirectDiffuseIntensity = defaultIndirectDiffuseIntensity; indirectSpecularIntensity = defaultIndirectSpecularIntensity; enableScreenSpaceReflections = defaultEnableScreenSpaceReflections; screenEdgeFadeDistance = defaultScreenEdgeFadeDistance; maxNumberOfRaySteps = defaultMaxNumberOfRaySteps; objectThickness = defaultObjectThickness; minSmoothness = defaultMinSmoothness; smoothnessFadeStart = defaultSmoothnessFadeStart; reflectSky = defaultReflectSky; enableScreenSpaceRefractions = defaultEnableScreenSpaceRefractions; screenWeightDistance = defaultScreenWeightDistance; useBakingSky = defaultUseBakingSky; useFogDensityVolume = defaultUseFogDensityVolume; singleScatteringAlbedo = defaultSingleScatteringAlbedo; densityVolumeFogDistance = defaultDensityVolumeFogDistance; fogDensityMaskTexture = defaultFogDensityMaskTexture; densityMaskTiling = defaultDensityMaskTiling; densityScale = defaultDensityScale; linearFogDensity = defaultLinearFogDensity; exponentialFogDensity = defaultExponentialFogDensity; hDRPFogDistance = defaultHDRPFogDistance; #if HDPipeline #if UNITY_2018_3_OR_NEWER volumeProfile = defaultVolumeProfile; volumetricFogColorMode = defaultVolumetricFogColorMode; hDRISkyIntensityMode = defaultHDRISkyIntensityMode; fogColorMode = defaultFogColorMode; #endif #endif }
/// <summary> /// Sets the Shadow Resolution Quality, 4 possible values /// (0 - 3) or (Low, Medium, High, Very High) /// </summary> /// <param name="res"></param> public void setShadowResolution(ShadowResolution res) { QualitySettings.shadowResolution = res; }
private void LoadAllValues() { tog_fullScreen.isOn = Screen.fullScreen; tog_vSync.isOn = (QualitySettings.vSyncCount > 0); plac_targetFPS.text = Application.targetFrameRate.ToString(); slid_texQuality.value = slid_texQuality.maxValue - QualitySettings.masterTextureLimit; AnisotropicFiltering aniso = QualitySettings.anisotropicFiltering; if (aniso.Equals(AnisotropicFiltering.Disable)) { slid_aniso.value = slid_aniso.minValue; } else if (aniso.Equals(AnisotropicFiltering.Enable)) { slid_aniso.value = 1f; } else if (aniso.Equals(AnisotropicFiltering.ForceEnable)) { slid_aniso.value = slid_aniso.maxValue; } int aaValue = QualitySettings.antiAliasing; if (aaValue == 0) { slid_antialias.value = slid_antialias.minValue; } else if (aaValue == 2) { slid_antialias.value = 1f; } else if (aaValue == 4) { slid_antialias.value = 2f; } else if (aaValue == 8) { slid_antialias.value = slid_antialias.maxValue; } ShadowQuality shadowQual = QualitySettings.shadows; if (shadowQual.Equals(ShadowQuality.Disable)) { slid_shadows.value = slid_shadows.minValue; } else if (shadowQual.Equals(ShadowQuality.HardOnly)) { slid_shadows.value = 1f; } else if (shadowQual.Equals(ShadowQuality.All)) { slid_shadows.value = slid_shadows.maxValue; } ShadowResolution shadowRes = QualitySettings.shadowResolution; if (shadowRes.Equals(ShadowResolution.Low)) { slid_shadowRes.value = slid_shadowRes.minValue; } else if (shadowRes.Equals(ShadowResolution.Medium)) { slid_shadowRes.value = 1f; } else if (shadowRes.Equals(ShadowResolution.High)) { slid_shadowRes.value = 2f; } else if (shadowRes.Equals(ShadowResolution.VeryHigh)) { slid_shadowRes.value = slid_shadowRes.maxValue; } ShadowProjection shadowProj = QualitySettings.shadowProjection; if (shadowProj.Equals(ShadowProjection.CloseFit)) { slid_shadowProj.value = slid_shadowProj.minValue; } else if (shadowProj.Equals(ShadowProjection.StableFit)) { slid_shadowProj.value = slid_shadowProj.maxValue; } int shadowCasc = QualitySettings.shadowCascades; if (shadowCasc == 1) { slid_shadowCasc.value = slid_shadowCasc.minValue; } else if (shadowCasc == 2) { slid_shadowCasc.value = 1f; } else if (shadowCasc == 4) { slid_shadowCasc.value = slid_shadowCasc.maxValue; } plac_shadowDist.text = ((int)QualitySettings.shadowDistance).ToString(); plac_pixelLights.text = QualitySettings.pixelLightCount.ToString(); }
public void SetShadowQuality(ShadowResolution shadowQuality) { videoData.shadowQuality = shadowQuality; QualitySettings.shadowResolution = videoData.shadowQuality; }