Add Anti-Aliasing Settings
This commit is contained in:
+1156
-10
File diff suppressed because it is too large
Load Diff
@@ -4,16 +4,20 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
public class CameraOrbit : MonoBehaviour
|
||||
{
|
||||
public int CameraMode = 0;
|
||||
public int AAMode = 0;
|
||||
|
||||
[Header("Light")]
|
||||
public GameObject Light;
|
||||
|
||||
public Dropdown CameraModeDropdown;
|
||||
|
||||
public Dropdown AAModeDropdown;
|
||||
|
||||
public GameObject CameraTargetHelper;
|
||||
public Vector3 TargetCenter;
|
||||
|
||||
@@ -75,6 +79,30 @@ public class CameraOrbit : MonoBehaviour
|
||||
}
|
||||
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
|
||||
switch (CameraModeDropdown.value)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:800597811bcc5d848b15e12807d6de45"
|
||||
"GUID:800597811bcc5d848b15e12807d6de45",
|
||||
"GUID:d60799ab2a985554ea1a39cd38695018"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
||||
Reference in New Issue
Block a user