Add Anti-Aliasing Settings

This commit is contained in:
gamer-jp
2022-09-28 03:23:10 +09:00
parent 931c2f64c5
commit e211f02ff0
3 changed files with 1186 additions and 11 deletions
File diff suppressed because it is too large Load Diff
+28
View File
@@ -4,16 +4,20 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.Rendering.PostProcessing;
public class CameraOrbit : MonoBehaviour public class CameraOrbit : MonoBehaviour
{ {
public int CameraMode = 0; public int CameraMode = 0;
public int AAMode = 0;
[Header("Light")] [Header("Light")]
public GameObject Light; public GameObject Light;
public Dropdown CameraModeDropdown; public Dropdown CameraModeDropdown;
public Dropdown AAModeDropdown;
public GameObject CameraTargetHelper; public GameObject CameraTargetHelper;
public Vector3 TargetCenter; public Vector3 TargetCenter;
@@ -75,6 +79,30 @@ public class CameraOrbit : MonoBehaviour
} }
CameraMode = CameraModeDropdown.value; CameraMode = CameraModeDropdown.value;
} }
if (AAMode != AAModeDropdown.value)
{
var postprocessLayer = Camera.main.GetComponent<PostProcessLayer>();
switch (AAModeDropdown.value) //new
{
case 0:
postprocessLayer.antialiasingMode = PostProcessLayer.Antialiasing.None;
break;
case 1:
postprocessLayer.antialiasingMode = PostProcessLayer.Antialiasing.FastApproximateAntialiasing;
break;
case 2:
postprocessLayer.antialiasingMode = PostProcessLayer.Antialiasing.SubpixelMorphologicalAntialiasing;
break;
case 3:
postprocessLayer.antialiasingMode = PostProcessLayer.Antialiasing.TemporalAntialiasing;
break;
default:
postprocessLayer.antialiasingMode = PostProcessLayer.Antialiasing.None;
break;
}
AAMode = AAModeDropdown.value;
}
#if UNITY_ANDROID #if UNITY_ANDROID
switch (CameraModeDropdown.value) switch (CameraModeDropdown.value)
{ {
+2 -1
View File
@@ -3,7 +3,8 @@
"rootNamespace": "", "rootNamespace": "",
"references": [ "references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f", "GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:800597811bcc5d848b15e12807d6de45" "GUID:800597811bcc5d848b15e12807d6de45",
"GUID:d60799ab2a985554ea1a39cd38695018"
], ],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": [], "excludePlatforms": [],