Restored AntiAliasing settings
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -10,7 +11,7 @@ public class CameraOrbit : MonoBehaviour
|
||||
[Header("Light")]
|
||||
public GameObject Light;
|
||||
|
||||
public Dropdown CameraModeDropdown;
|
||||
public TMP_Dropdown CameraModeDropdown;
|
||||
|
||||
public GameObject CameraTargetHelper;
|
||||
public Vector3 TargetCenter;
|
||||
|
||||
@@ -21,9 +21,12 @@ public class Config
|
||||
public string WorkModeTip = "Affects how application work, options: 0 - work with game client, 1 - work without game client(slow), Database needs to be updated manually";
|
||||
public WorkMode WorkMode = WorkMode.Default;
|
||||
|
||||
public string VmdKeyReductionLevelTip = " Affects the recording quality: 1 = record every frame, 2 = record every two frames, and so on.";
|
||||
public string VmdKeyReductionLevelTip = "Affects the recording quality: 1 = record every frame, 2 = record every two frames, and so on.";
|
||||
public int VmdKeyReductionLevel = 2;
|
||||
|
||||
public string AntiAliasingTip = "Display, screenshot antialiasing level. 0 - no AA, 1 - 2x MSAA, 2 - 4x MSAA, 3 - 8x MSAA";
|
||||
public int AntiAliasing = 2;
|
||||
|
||||
public string VmdMorphConvertSettingTip = "The mapping of MMD mprphs to UMA mprphs during VMD recording, multiple UMA expression weights will be combined (not exceeding 1)";
|
||||
public List<MorphConvertConfig> VmdMorphConvertSetting = new List<MorphConvertConfig>
|
||||
{
|
||||
@@ -122,10 +125,13 @@ public class Config
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public void UpdateConfig()
|
||||
public void UpdateConfig(bool requireRestart)
|
||||
{
|
||||
File.WriteAllText(configPath, JsonUtility.ToJson(this, true));
|
||||
UmaViewerUI.Instance.ShowMessage("The configuration has changed. Please restart the application.", UIMessageType.Default);
|
||||
if (requireRestart)
|
||||
{
|
||||
UmaViewerUI.Instance.ShowMessage("The configuration has changed. Please restart the application.", UIMessageType.Default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,8 @@ public class Screenshot : MonoBehaviour
|
||||
}
|
||||
|
||||
var tex_color = new Texture2D(width, height, TextureFormat.ARGB32, false);
|
||||
var render_texture = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.ARGB32,RenderTextureReadWrite.Default,8);
|
||||
int aaLevel = QualitySettings.antiAliasing == 0? 1 : QualitySettings.antiAliasing; //RT uses '1' for no antialiasing
|
||||
var render_texture = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.ARGB32,RenderTextureReadWrite.Default, aaLevel);
|
||||
var grab_area = new Rect(0, 0, width, height);
|
||||
|
||||
RenderTexture.active = render_texture;
|
||||
|
||||
@@ -220,12 +220,6 @@ public class UmaViewerMain : MonoBehaviour
|
||||
Builder.ShaderList = new List<Shader>(shaders.LoadAllAssets<Shader>());
|
||||
}
|
||||
|
||||
public void ChangeAA(int val)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void OpenUrl(string url)
|
||||
{
|
||||
Application.OpenURL(url);
|
||||
|
||||
@@ -120,6 +120,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
public Button UpdateDBButton;
|
||||
public TMP_Dropdown WorkModeDropdown;
|
||||
public TMP_Dropdown LanguageDropdown;
|
||||
public TMP_Dropdown AntialiasingDropdown;
|
||||
public List<GameObject> TogglablePanels = new List<GameObject>();
|
||||
public List<GameObject> TogglableFacials = new List<GameObject>();
|
||||
|
||||
@@ -167,6 +168,8 @@ public class UmaViewerUI : MonoBehaviour
|
||||
{
|
||||
WorkModeDropdown.SetValueWithoutNotify((int)Config.Instance.WorkMode);
|
||||
LanguageDropdown.SetValueWithoutNotify((int)Config.Instance.Language);
|
||||
AntialiasingDropdown.SetValueWithoutNotify(Config.Instance.AntiAliasing);
|
||||
ChangeAntiAliasing(Config.Instance.AntiAliasing);
|
||||
UpdateDBButton.interactable = (Config.Instance.WorkMode == WorkMode.Standalone);
|
||||
LoadedAssetsClear();
|
||||
UmaAssetManager.OnLoadedBundleUpdate += LoadedAssetsAdd;
|
||||
@@ -1386,7 +1389,21 @@ public class UmaViewerUI : MonoBehaviour
|
||||
if ((int)Config.Instance.Language != lang)
|
||||
{
|
||||
Config.Instance.Language = (Language)lang;
|
||||
Config.Instance.UpdateConfig();
|
||||
Config.Instance.UpdateConfig(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Converts values 1-4 to valid AA values </summary>
|
||||
public void ChangeAntiAliasing(int value)
|
||||
{
|
||||
int[] aaValues = { 0, 2, 4, 8 };
|
||||
|
||||
QualitySettings.antiAliasing = aaValues[value];
|
||||
|
||||
if (Config.Instance.AntiAliasing != value)
|
||||
{
|
||||
Config.Instance.AntiAliasing = value;
|
||||
Config.Instance.UpdateConfig(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,7 +1412,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
if ((int)Config.Instance.WorkMode != mode)
|
||||
{
|
||||
Config.Instance.WorkMode = (WorkMode)mode;
|
||||
Config.Instance.UpdateConfig();
|
||||
Config.Instance.UpdateConfig(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1408,7 +1425,7 @@ public class UmaViewerUI : MonoBehaviour
|
||||
if (path[0] != Config.Instance.MainPath)
|
||||
{
|
||||
Config.Instance.MainPath = path[0];
|
||||
Config.Instance.UpdateConfig();
|
||||
Config.Instance.UpdateConfig(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user