uc-hoba 3 weeks ago
commit 1e5428816d
  1. 156
      .gitattributes
  2. 72
      .gitignore
  3. 5
      .vscode/extensions.json
  4. 10
      .vscode/launch.json
  5. 71
      .vscode/settings.json
  6. 9
      Assets/Horizon Based Ambient Occlusion.meta
  7. 9
      Assets/Horizon Based Ambient Occlusion/Documentation.meta
  8. BIN
      Assets/Horizon Based Ambient Occlusion/Documentation/User Guide.pdf
  9. 15
      Assets/Horizon Based Ambient Occlusion/Documentation/User Guide.pdf.meta
  10. 8
      Assets/Horizon Based Ambient Occlusion/Editor.meta
  11. 24
      Assets/Horizon Based Ambient Occlusion/Editor/HBAO.Editor.asmdef
  12. 14
      Assets/Horizon Based Ambient Occlusion/Editor/HBAO.Editor.asmdef.meta
  13. 282
      Assets/Horizon Based Ambient Occlusion/Editor/HBAOEditor.cs
  14. 19
      Assets/Horizon Based Ambient Occlusion/Editor/HBAOEditor.cs.meta
  15. 140
      Assets/Horizon Based Ambient Occlusion/Editor/HBAOGaiaExtension.cs
  16. 19
      Assets/Horizon Based Ambient Occlusion/Editor/HBAOGaiaExtension.cs.meta
  17. 9
      Assets/Horizon Based Ambient Occlusion/Editor/Resources.meta
  18. BIN
      Assets/Horizon Based Ambient Occlusion/Editor/Resources/hbao.png
  19. 62
      Assets/Horizon Based Ambient Occlusion/Editor/Resources/hbao.png.meta
  20. BIN
      Assets/Horizon Based Ambient Occlusion/Editor/Resources/icon.png
  21. 108
      Assets/Horizon Based Ambient Occlusion/Editor/Resources/icon.png.meta
  22. 307
      Assets/Horizon Based Ambient Occlusion/Readme.txt
  23. 15
      Assets/Horizon Based Ambient Occlusion/Readme.txt.meta
  24. 9
      Assets/Horizon Based Ambient Occlusion/Runtime.meta
  25. 20
      Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.Runtime.asmdef
  26. 14
      Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.Runtime.asmdef.meta
  27. 1817
      Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.cs
  28. 21
      Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.cs.meta
  29. 9
      Assets/Horizon Based Ambient Occlusion/SRP.meta
  30. 8
      Assets/Horizon Based Ambient Occlusion/SRP/URP.meta
  31. 8
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor.meta
  32. 20
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/HBAO.Universal.Editor.asmdef
  33. 7
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/HBAO.Universal.Editor.asmdef.meta
  34. 327
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/HBAOEditor.cs
  35. 11
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/HBAOEditor.cs.meta
  36. 8
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/Resources.meta
  37. BIN
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/Resources/hbao_urp.png
  38. 115
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Editor/Resources/hbao_urp.png.meta
  39. 8
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime.meta
  40. 23
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAO.Universal.Runtime.asmdef
  41. 7
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAO.Universal.Runtime.asmdef.meta
  42. 629
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAO.cs
  43. 11
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAO.cs.meta
  44. 1574
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAORendererFeature.cs
  45. 13
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Runtime/HBAORendererFeature.cs.meta
  46. 8
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders.meta
  47. 384
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO.shader
  48. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO.shader.meta
  49. 205
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_AO.hlsl
  50. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_AO.hlsl.meta
  51. 143
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Blur.hlsl
  52. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Blur.hlsl.meta
  53. 93
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Common.hlsl
  54. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Common.hlsl.meta
  55. 79
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Composite.hlsl
  56. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Composite.hlsl.meta
  57. 70
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Deinterleaving.hlsl
  58. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Deinterleaving.hlsl.meta
  59. 175
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_TemporalFilter.hlsl
  60. 9
      Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_TemporalFilter.hlsl.meta
  61. 9
      Assets/Horizon Based Ambient Occlusion/Shaders.meta
  62. 464
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO.shader
  63. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO.shader.meta
  64. 204
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_AO.cginc
  65. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_AO.cginc.meta
  66. 139
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Blur.cginc
  67. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Blur.cginc.meta
  68. 67
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Common.cginc
  69. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Common.cginc.meta
  70. 150
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Composite.cginc
  71. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Composite.cginc.meta
  72. 62
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Deinterleaving.cginc
  73. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Deinterleaving.cginc.meta
  74. 171
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_TemporalFilter.cginc
  75. 16
      Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_TemporalFilter.cginc.meta
  76. 1057
      Assets/InputSystem_Actions.inputactions
  77. 14
      Assets/InputSystem_Actions.inputactions.meta
  78. 8
      Assets/Main.meta
  79. 10077
      Assets/Main.unity
  80. 7
      Assets/Main.unity.meta
  81. 136
      Assets/Main/Black.mat
  82. 8
      Assets/Main/Black.mat.meta
  83. 254
      Assets/Main/GlobalVolumeProfile.asset
  84. 8
      Assets/Main/GlobalVolumeProfile.asset.meta
  85. 137
      Assets/Main/Gold.mat
  86. 8
      Assets/Main/Gold.mat.meta
  87. 137
      Assets/Main/Ground.mat
  88. 8
      Assets/Main/Ground.mat.meta
  89. BIN
      Assets/Main/LightingData.asset
  90. 8
      Assets/Main/LightingData.asset.meta
  91. 154
      Assets/Main/Lit.mat
  92. 8
      Assets/Main/Lit.mat.meta
  93. BIN
      Assets/Main/ReflectionProbe-0.exr
  94. 117
      Assets/Main/ReflectionProbe-0.exr.meta
  95. BIN
      Assets/Main/UnityMaterialBall.fbx
  96. 112
      Assets/Main/UnityMaterialBall.fbx.meta
  97. 136
      Assets/Main/White.mat
  98. 8
      Assets/Main/White.mat.meta
  99. 8
      Assets/Scenes.meta
  100. 432
      Assets/Scenes/SampleScene.unity
  101. Some files were not shown because too many files have changed in this diff Show More

156
.gitattributes vendored

@ -0,0 +1,156 @@
# Define macros (only works in top-level gitattributes files)
[attr]lfs filter=lfs diff=lfs merge=lfs -text
[attr]unity-yaml merge=unityyamlmerge eol=lf linguist-language=yaml
# Optionally collapse Unity-generated files on GitHub diffs
# [attr]unity-yaml merge=unityyamlmerge text linguist-language=yaml linguist-generated
# Unity files
*.cginc text
*.compute text linguist-language=hlsl
*.cs text diff=csharp
*.raytrace text linguist-language=hlsl
*.shader text
# Unity JSON files
*.asmdef text linguist-language=json
*.asmref text linguist-language=json
*.index text linguist-language=json
*.inputactions text linguist-language=json
*.shadergraph text linguist-language=json
*.shadersubgraph text linguist-language=json
# Unity UI Toolkit files
*.tss text diff=css linguist-language=css
*.uss text diff=css linguist-language=css
*.uxml text linguist-language=xml linguist-detectable
# Unity YAML
*.anim unity-yaml
*.asset unity-yaml
*.brush unity-yaml
*.controller unity-yaml
*.flare unity-yaml
*.fontsettings unity-yaml
*.giparams unity-yaml
*.guiskin unity-yaml
*.lighting unity-yaml
*.mask unity-yaml
*.mat unity-yaml
*.meta unity-yaml
*.mixer unity-yaml
*.overrideController unity-yaml
*.playable unity-yaml
*.prefab unity-yaml
*.preset unity-yaml
*.renderTexture unity-yaml
*.scenetemplate unity-yaml
*.shadervariants unity-yaml
*.signal unity-yaml
*.spriteatlas unity-yaml
*.spriteatlasv2 unity-yaml
*.terrainlayer unity-yaml
*.unity unity-yaml
# "physic" for 3D but "physics" for 2D
*.physicMaterial unity-yaml
*.physicsMaterial2D unity-yaml
# Exclude third-party plugins from GitHub stats
Assets/Plugins/** linguist-vendored
# Unity LFS
*.cubemap lfs
*.unitypackage lfs
# 3D models
*.3dm lfs
*.3ds lfs
*.blend lfs
*.c4d lfs
*.collada lfs
*.dae lfs
*.dxf lfs
*.FBX lfs
*.fbx lfs
*.jas lfs
*.lws lfs
*.lxo lfs
*.ma lfs
*.max lfs
*.mb lfs
*.obj lfs
*.ply lfs
*.skp lfs
*.stl lfs
*.ztl lfs
# Audio
*.aif lfs
*.aiff lfs
*.it lfs
*.mod lfs
*.mp3 lfs
*.ogg lfs
*.s3m lfs
*.wav lfs
*.xm lfs
# Video
*.asf lfs
*.avi lfs
*.flv lfs
*.mov lfs
*.mp4 lfs
*.mpeg lfs
*.mpg lfs
*.ogv lfs
*.wmv lfs
# Images
*.bmp lfs
*.exr lfs
*.gif lfs
*.hdr lfs
*.iff lfs
*.jpeg lfs
*.jpg lfs
*.pict lfs
*.png lfs
*.psd lfs
*.tga lfs
*.tif lfs
*.tiff lfs
*.webp lfs
# Compressed Archive
*.7z lfs
*.bz2 lfs
*.gz lfs
*.rar lfs
*.tar lfs
*.zip lfs
# Compiled Dynamic Library
*.dll lfs
*.pdb lfs
*.so lfs
# Fonts
*.otf lfs
*.ttf lfs
# Executable/Installer
*.apk lfs
*.exe lfs
# Documents
*.pdf lfs
# ETC
*.a lfs
*.reason lfs
*.rns lfs
# Spine export file for Unity
*.skel.bytes lfs

72
.gitignore vendored

@ -0,0 +1,72 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Recordings can get excessive in size
/[Rr]ecordings/
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
*.app
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

@ -0,0 +1,5 @@
{
"recommendations": [
"visualstudiotoolsforunity.vstuc"
]
}

@ -0,0 +1,10 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
}
]
}

@ -0,0 +1,71 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.vs": true,
"**/.gitmodules": true,
"**/.vsconfig": true,
"**/*.booproj": true,
"**/*.pidb": true,
"**/*.suo": true,
"**/*.user": true,
"**/*.userprefs": true,
"**/*.unityproj": true,
"**/*.dll": true,
"**/*.exe": true,
"**/*.pdf": true,
"**/*.mid": true,
"**/*.midi": true,
"**/*.wav": true,
"**/*.gif": true,
"**/*.ico": true,
"**/*.jpg": true,
"**/*.jpeg": true,
"**/*.png": true,
"**/*.psd": true,
"**/*.tga": true,
"**/*.tif": true,
"**/*.tiff": true,
"**/*.3ds": true,
"**/*.3DS": true,
"**/*.fbx": true,
"**/*.FBX": true,
"**/*.lxo": true,
"**/*.LXO": true,
"**/*.ma": true,
"**/*.MA": true,
"**/*.obj": true,
"**/*.OBJ": true,
"**/*.asset": true,
"**/*.cubemap": true,
"**/*.flare": true,
"**/*.mat": true,
"**/*.meta": true,
"**/*.prefab": true,
"**/*.unity": true,
"build/": true,
"Build/": true,
"Library/": true,
"library/": true,
"obj/": true,
"Obj/": true,
"Logs/": true,
"logs/": true,
"ProjectSettings/": true,
"UserSettings/": true,
"temp/": true,
"Temp/": true
},
"files.associations": {
"*.asset": "yaml",
"*.meta": "yaml",
"*.prefab": "yaml",
"*.unity": "yaml",
},
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.sln": "*.csproj",
"*.slnx": "*.csproj"
},
"dotnet.defaultSolution": "Unity-25014-ReadySetRide.slnx"
}

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1e2cc9e9ad4f108458033887c97bb038
folderAsset: yes
timeCreated: 1487248984
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9869ea90af1da7949848b63dddb25d26
folderAsset: yes
timeCreated: 1467127598
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 061da04314aaba248977f5671e799370
timeCreated: 1467127598
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Documentation/User Guide.pdf
uploadId: 886976

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 478a5a24ad1152f43ad164da3759717b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,24 @@
{
"name": "HBAO.Editor",
"rootNamespace": "",
"references": [
"GUID:b83dc51897666cb44bdfbf9671f74e85"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "Unity",
"expression": "2020.3.13",
"define": "UNITY_2020_3_13_OR_NEWER"
}
],
"noEngineReferences": false
}

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: bbd7cb83004dde543aac62cbce764d58
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Editor/HBAO.Editor.asmdef
uploadId: 886976

@ -0,0 +1,282 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Rendering;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace HorizonBasedAmbientOcclusion
{
[CustomEditor(typeof(HBAO))]
public class HBAOEditor : Editor
{
private HBAO m_HBAO;
private Texture2D m_HBAOTex;
private GUIStyle m_SettingsGroupStyle;
private GUIStyle m_TitleLabelStyle;
private int m_SelectedPreset;
// settings group <setting, property reference>
private Dictionary<FieldInfo, List<SerializedProperty>> m_GroupFields;
private readonly Dictionary<int, HBAO.Preset> m_Presets = new Dictionary<int, HBAO.Preset>()
{
{ 0, HBAO.Preset.Normal },
{ 1, HBAO.Preset.FastPerformance },
{ 2, HBAO.Preset.FastestPerformance },
{ 3, HBAO.Preset.Custom },
{ 4, HBAO.Preset.HighQuality },
{ 5, HBAO.Preset.HighestQuality }
};
void OnEnable()
{
m_HBAO = (HBAO)target;
m_HBAOTex = Resources.Load<Texture2D>("hbao");
m_GroupFields = new Dictionary<FieldInfo, List<SerializedProperty>>();
var settingsGroups = typeof(HBAO).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
.Where(x => x.GetCustomAttributes(typeof(HBAO.SettingsGroup), false).Any());
foreach (var group in settingsGroups)
{
foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
{
if (!m_GroupFields.ContainsKey(group))
m_GroupFields[group] = new List<SerializedProperty>();
var property = serializedObject.FindProperty(group.Name + "." + setting.Name);
if (property != null)
m_GroupFields[group].Add(property);
}
}
m_SelectedPreset = m_Presets.Values.ToList().IndexOf(m_HBAO.GetCurrentPreset());
}
public override void OnInspectorGUI()
{
serializedObject.Update();
SetStyles();
EditorGUILayout.BeginVertical();
{
// header
GUILayout.Space(10.0f);
GUILayout.Label(m_HBAOTex, m_TitleLabelStyle, GUILayout.ExpandWidth(true));
//if (m_HBAO.GetComponents<MonoBehaviour>()[0] != m_HBAO)
//{
//GUILayout.Space(6.0f);
//EditorGUILayout.HelpBox("This Post FX should be one of the first in your effect stack", MessageType.Info);
//}
Event e = Event.current;
// settings groups
foreach (var group in m_GroupFields)
{
var groupProperty = serializedObject.FindProperty(group.Key.Name);
if (groupProperty == null)
continue;
GUILayout.Space(6.0f);
Rect rect = GUILayoutUtility.GetRect(16f, 22f, m_SettingsGroupStyle);
GUI.Box(rect, ObjectNames.NicifyVariableName(groupProperty.displayName), m_SettingsGroupStyle);
if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition))
{
groupProperty.isExpanded = !groupProperty.isExpanded;
e.Use();
}
if (!groupProperty.isExpanded)
continue;
// presets is a special case
if (group.Key.FieldType == typeof(HBAO.Presets))
{
GUILayout.Space(6.0f);
m_SelectedPreset = GUILayout.SelectionGrid(m_SelectedPreset, m_Presets.Values.Select(x => ObjectNames.NicifyVariableName(x.ToString())).ToArray(), 3);
GUILayout.Space(6.0f);
if (GUILayout.Button("Apply Preset"))
{
Undo.RecordObject(target, "Apply Preset");
m_HBAO.ApplyPreset(m_Presets[m_SelectedPreset]);
EditorUtility.SetDirty(target);
if (!EditorApplication.isPlaying)
{
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene());
}
}
}
foreach (var field in group.Value)
{
// hide real presets
if (group.Key.FieldType == typeof(HBAO.Presets))
continue;
// hide resolution when deinterleaved HBAO is on
if (group.Key.FieldType == typeof(HBAO.GeneralSettings) && field.name == "resolution")
{
if (m_HBAO.GetDeinterleaving() != HBAO.Deinterleaving.Disabled)
{
continue;
}
}
// hide noise type when deinterleaved HBAO is on
else if (group.Key.FieldType == typeof(HBAO.GeneralSettings) && field.name == "noiseType")
{
if (m_HBAO.GetDeinterleaving() != HBAO.Deinterleaving.Disabled)
{
continue;
}
}
// hide useMultiBounce setting in BeforeReflections integration stage
else if (group.Key.FieldType == typeof(HBAO.AOSettings) && field.name == "useMultiBounce")
{
if (m_HBAO.GetPipelineStage() == HBAO.PipelineStage.BeforeReflections)
{
continue;
}
}
// hide multiBounceInfluence setting when not used
else if (group.Key.FieldType == typeof(HBAO.AOSettings) && field.name == "multiBounceInfluence")
{
if (m_HBAO.GetPipelineStage() == HBAO.PipelineStage.BeforeReflections || !m_HBAO.UseMultiBounce())
{
continue;
}
}
// warn about distance falloff greater than max distance
else if (group.Key.FieldType == typeof(HBAO.AOSettings) && field.name == "perPixelNormals")
{
if (m_HBAO.GetAoDistanceFalloff() > m_HBAO.GetAoMaxDistance())
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Distance Falloff shoudn't be greater than Max Distance.", MessageType.Warning);
}
}
// warn about motion vectors not supported
else if (group.Key.FieldType == typeof(HBAO.TemporalFilterSettings) && field.name == "enabled")
{
// For platforms not supporting motion vectors texture
// https://docs.unity3d.com/ScriptReference/DepthTextureMode.MotionVectors.html
if (!SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.RGHalf))
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Motion vectors not supported on this platform...", MessageType.Warning);
if (m_HBAO.IsTemporalFilterEnabled())
m_HBAO.EnableTemporalFilter(false);
}
else
{
if (IsVrRunning())
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Not supported yet in VR...", MessageType.Warning);
if (m_HBAO.IsTemporalFilterEnabled())
m_HBAO.EnableTemporalFilter(false);
}
}
}
// warn about color bleeding not supported in VR + MSAA prior to 2020.3.13
else if (group.Key.FieldType == typeof(HBAO.ColorBleedingSettings) && field.name == "enabled")
{
#if !UNITY_2020_3_13_OR_NEWER
if (m_HBAO.IsColorBleedingEnabled() && IsVrRunning())
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Unity 2020.3.13+ required when using VR + MSAA and color bleeding.", MessageType.Warning);
}
#endif
}
// hide albedoMultiplier when not in deferred
else if (group.Key.FieldType == typeof(HBAO.ColorBleedingSettings) && field.name == "albedoMultiplier")
{
if (m_HBAO.GetPipelineStage() == HBAO.PipelineStage.BeforeImageEffectsOpaque)
continue;
}
EditorGUILayout.BeginHorizontal();
GUILayout.Space(12.0f);
EditorGUILayout.PropertyField(field);
EditorGUILayout.EndHorizontal();
}
}
}
EditorGUILayout.EndVertical();
serializedObject.ApplyModifiedProperties();
}
private void SetStyles()
{
// set banner label style
m_TitleLabelStyle = new GUIStyle(GUI.skin.label);
m_TitleLabelStyle.alignment = TextAnchor.MiddleCenter;
m_TitleLabelStyle.contentOffset = new Vector2(0f, 0f);
// get shuriken module title style
GUIStyle skurikenModuleTitleStyle = "ShurikenModuleTitle";
// clone it as to not interfere with the original, and adjust it
m_SettingsGroupStyle = new GUIStyle(skurikenModuleTitleStyle);
m_SettingsGroupStyle.font = (new GUIStyle("Label")).font;
m_SettingsGroupStyle.fontStyle = FontStyle.Bold;
m_SettingsGroupStyle.border = new RectOffset(15, 7, 4, 4);
m_SettingsGroupStyle.fixedHeight = 22;
m_SettingsGroupStyle.contentOffset = new Vector2(10f, -2f);
}
List<UnityEngine.XR.XRDisplaySubsystem> displays = new List<UnityEngine.XR.XRDisplaySubsystem>();
private bool IsVrRunning()
{
bool vrIsRunning = false;
displays.Clear();
SubsystemManager.GetSubsystems(displays);
foreach (var displaySubsystem in displays)
{
if (displaySubsystem.running)
{
vrIsRunning = true;
break;
}
}
return vrIsRunning;
}
[CustomPropertyDrawer(typeof(HBAO.MinMaxSliderAttribute))]
public class MinMaxSliderDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (property.propertyType == SerializedPropertyType.Vector2)
{
Vector2 range = property.vector2Value;
float min = range.x;
float max = range.y;
var attr = attribute as HBAO.MinMaxSliderAttribute;
EditorGUI.BeginChangeCheck();
EditorGUI.MinMaxSlider(position, label, ref min, ref max, attr.min, attr.max);
if (EditorGUI.EndChangeCheck())
{
range.x = min;
range.y = max;
property.vector2Value = range;
}
}
else
{
EditorGUI.LabelField(position, label, "Use only with Vector2");
}
}
}
}
}

@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: c11bfebf2cb67334d8e543d164ef0cb0
timeCreated: 1478884394
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Editor/HBAOEditor.cs
uploadId: 886976

@ -0,0 +1,140 @@
#if GAIA_PRESENT && UNITY_EDITOR
using HorizonBasedAmbientOcclusion;
using UnityEditor;
using UnityEngine;
namespace Gaia.GX.MichaelJimenez
{
public class HBAOGaiaExtension : MonoBehaviour
{
#region Generic informational methods
/// <summary>
/// Returns the publisher name if provided.
/// This will override the publisher name in the namespace ie Gaia.GX.PublisherName
/// </summary>
/// <returns>Publisher name</returns>
public static string GetPublisherName()
{
return "Michael Jimenez";
}
/// <summary>
/// Returns the package name if provided
/// This will override the package name in the class name ie public class PackageName.
/// </summary>
/// <returns>Package name</returns>
public static string GetPackageName()
{
return "Horizon Based Ambient Occlusion";
}
#endregion
#region Methods exposed by Gaia as buttons must be prefixed with GX_
public static void GX_About()
{
EditorUtility.DisplayDialog("About Horizon Based Ambient Occlusion ", "HBAO is a post processing image effect to use in order to add realism to your scenes. It helps accentuating small surface details and reproduce light attenuation due to occlusion.\n\nNote: This Post FX should be the first in your effect stack.", "OK");
}
public static void GX_Presets_FastestPerformance()
{
HBAO hbao = StackPostFXOnTop();
if (hbao != null)
{
hbao.ApplyPreset(HBAO.Preset.FastestPerformance);
MarkDirty(hbao);
}
}
public static void GX_Presets_FastPerformance()
{
HBAO hbao = StackPostFXOnTop();
if (hbao != null)
{
hbao.ApplyPreset(HBAO.Preset.FastPerformance);
MarkDirty(hbao);
}
}
public static void GX_Presets_Normal()
{
HBAO hbao = StackPostFXOnTop();
if (hbao != null)
{
hbao.ApplyPreset(HBAO.Preset.Normal);
MarkDirty(hbao);
}
}
public static void GX_Presets_HighQuality()
{
HBAO hbao = StackPostFXOnTop();
if (hbao != null)
{
hbao.ApplyPreset(HBAO.Preset.HighQuality);
MarkDirty(hbao);
}
}
public static void GX_Presets_HighestQuality()
{
HBAO hbao = StackPostFXOnTop();
if (hbao != null)
{
hbao.ApplyPreset(HBAO.Preset.HighestQuality);
MarkDirty(hbao);
}
}
#endregion
#region Helper methods
private static HBAO StackPostFXOnTop()
{
Camera camera = Camera.main;
if (camera == null)
{
camera = FindObjectOfType<Camera>();
}
if (camera == null)
{
EditorUtility.DisplayDialog("OOPS!", "Could not find camera to add camera effects to. Please add a camera to your scene.", "OK");
return null;
}
// add HBAO to camera
HBAO hbao = camera.GetComponent<HBAO>();
if (hbao != null)
{
DestroyImmediate(hbao);
}
hbao = camera.gameObject.AddComponent<HBAO>();
// stack it on top
while (camera.GetComponents<MonoBehaviour>()[0] != hbao)
{
UnityEditorInternal.ComponentUtility.MoveComponentUp(hbao);
}
return hbao;
}
private static void MarkDirty(HBAO hbao)
{
EditorUtility.SetDirty(hbao);
if (!EditorApplication.isPlaying)
{
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene());
}
}
#endregion
}
}
#endif

@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 50df544c23aafa84584188552d7a8cd5
timeCreated: 1462456119
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Editor/HBAOGaiaExtension.cs
uploadId: 886976

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: fff65aff3cee6c44183cf61a6df77cac
folderAsset: yes
timeCreated: 1463304680
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

@ -0,0 +1,62 @@
fileFormatVersion: 2
guid: 363f071b5e3670a43ba62ba5322fc4d6
timeCreated: 1463304735
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Editor/Resources/hbao.png
uploadId: 886976

Binary file not shown.

@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: 6daa87e2aaa1bb04d930ca4b4bc926a7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: ea6ccb6043e0b05449baf0ac8d87f817
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Editor/Resources/icon.png
uploadId: 886976

@ -0,0 +1,307 @@
Horizon Based Ambient Occlusion (HBAO) is a post processing image effect to use
in order to add realism to your scenes. It helps accentuating small surface
details and reproduce light attenuation due to occlusion.
HBAO delivers more accurate AO compared to the other SSAO solutions
available on the asset store, and this without any compromise on performances.
This algorithm is highly optimized to use minimal GPU time and offers the best
quality to performance ratio.
-----------------------------------------------------------------------------
Usage
-----------------------------------------------------------------------------
In order to use this image effect, just add HBAO compoment to your main camera.
For this you can drag the HBAO.cs script on your camera or select it from the
Add Component menu (Image Effects/HBAO).
In most scenarios, using medium quality with a medium blur will yield very good
results.
Depending if you are targetting high performances vs beautiful AO you can use
the following settings:
- high performances: low quality with wide blur
- normal : medium quality with medium blur
- fine ao: high quality with narrow blur
For even more performances you can use half resolution AO, but it generally
introduces some objectionable flickering when the camera is in movement.
Using color bleeding is heavier on performances as it requires additional color
sampling. The normal color bleeding saturation to use is 1.
Important notice:
The placement of the HBAO component in your post FX stack is really important!
It should theoretically be the first effect in the chain meaning it should be
placed on top.
Shader Model 3.0 compatible hardware is required.
-----------------------------------------------------------------------------
Forum thread & support
-----------------------------------------------------------------------------
Link to the forum thread:
http://forum.unity3d.com/threads/horizon-based-ambient-occlusion-hbao-image-effect.387374/
For any support request, please drop me an email at jimmikaelkael@gmail.com
-----------------------------------------------------------------------------
Changelog
-----------------------------------------------------------------------------
3.7
- Fix compile error on Unity 6.4 (URP)
- Fix for HBAO usage as default profile (URP)
- Fix pass inputs (normal prepass not required in deferred) and xr eyecount (URP)
- Fix editor behavior with Lit AO (URP)
- Fix usage of worldspace normals for URP 10.10+
3.6.1
- Fix compile error on Unity 6.3
3.6
- Added RenderGraph support (URP)
3.5.5
- Fix for Unity 2023.3 (URP & HDRP, no RenderGraph support yet)
3.5.4
- Fixed broken LitAO (URP)
3.5.3
- Fixed right eye issue with Quest (Builtin)
- Fixed editor warning (URP)
3.5.2
- Fixed compatibility with Unity 2023.2 (all pipelines)
3.5.1
- Fixed dynamic resolution artefacts (URP and Builtin)
- Fixed blur uv delta incorrect in some cases
- Fixed warnings
3.5
- Standard pipeline: added VR SPI support
- Standard pipeline: fix compile error when built-in VR module is disabled
- Reduced number of shader variants (all pipelines)
- URP/HDRP: fixed VR SPI projection issue
- HDRP: fixed issue with R16G16B16A16 and R32G32B32A32 buffer formats
3.4.12
- Standard pipeline: fixed composite bug with MSAA and transparent objects
- HDRP: fix doubled properties in 2022.2
3.4.11
- Fixed bleeding occlusion on screen edges
3.4.10
- Fixed bug with orthographic projection
- Reduced number of shader variants
- URP: fixed wrong camera view normals on URP versions 10 and 11
3.4.9
- HDRP: fixed AO shifting issue
3.4.8
- HDRP: fixed VR SPI
- URP: prevent color bleeding to be used along with LitAO mode
- URP: warn about 2021.2+ required for motion vectors (temporal filter)
3.4.7
- Fixed temporal filter issues on URP (use BufferedRTHandleSystem)
- Fixed obsolete hasAdvancedMode field on HDRP
- Added min/max range for multibounce setting on HDRP
3.4.6
- Fixed temporal filtering ghosting issue on URP
3.4.5
- Added rendering path option in URP to fix issues with LitAO+Deferred
- Fixed scene rendered black in URP12 with LitAO and opaque texture enabled
3.4.4
- Fixed temporal filtering issue when using camera normals on URP
3.4.3
- Fixed wrong camera view normals on URP
3.4.2
- Enable temporal filtering on URP (URP12+, Unity 2021.2+)
3.4.1
- Fixed Deinterleaving per frame GC allocation on URP
3.4
- Added LitAO on URP (requires URP 10.0.0 or newer)
3.3.4
- Fixed VR Single Pass on URP
3.3.3
- Fixed VR on Standard Render Pipeline
3.3.2
- Added support for URP 12.0.0
3.3.1
- Added support for upcoming URP 10.0.0 (support view normals)
3.3
- Added VR support to Standard Render Pipeline HBAO
3.2.1
- Added assembly definitions for editor scripts
3.2
- Fixed colorbleeding white color bleed beyond max distance
- Switched HBAO for URP to Post Process VolumeComponent
3.1
- Added HDRP support
- Added more settings helper methods
- Added namespaces for each render pipelines variants
- Use 16bit floating point texture format for noise when platform supports it
- Fixed wrong albedoMultipier setter method
3.0
- Rewritten scripts/shaders code for Unity 2019.1+
- Added scene view effect
- Added temporal filtering
- Added interleaved gradient and spatial distribution noises
- Added possibility to stack AO components (both Standard and Universal Render Pipeline)
- Added UI for Universal Render Pipeline AO setting assets
- Fixed wrong RenderTextureFormat for color bleeding
- Fixed memory leaks
- Improved number of compiled shader variants
2.9
- Fixed URP version shader keywords problem resulting in blackscreen in builds
- Fixed URP support on OpenGLES2 graphic API
- Fixed PS4 compilation error
- Fixed orthographic camera support on OpenGL, OpenGLES2 and OpenGLES3 graphic APIs
- Fixed AO consistency on various resolutions (render scale, dynamic resolution)
- Fixed incorrect view normals sampling at half resolution
- Allowed use of local shader keywords instead of global keywords
- Removed obsolete random noise, downsampled blur and quarter AO resolution
2.8
- Added URP support
2.7.2
- Fixed deprecated editor API
2.7.1
- Fixed obsolete scripting API
- Added view normals debug display
2.7
- Added multibounce approximation feature to replace older luminance influence setting
- Improved AO intensity response
- Improved blur
- Fixed RGB colormask on composite passes
2.6
- Fixed emission not cancelling AO in deferred occlusion
- Added color bleeding emissive masking
- Fixed VR Single Pass support in Unity 2017.2
2.5
- Added offscreen samples contribution setting
- Improved color bleeding performance
2.4
- Added support for Single Pass Stereo Rendering
2.3
- Fixed Camera.hdr obsolete warning in Unity 5.6
- Fixed inconsistent line endings warning in HBAO.shader
2.2
- HBAO_Integrated: adjusted to avoid any per frame GC allocation
- Increased Max Radius Pixels limits to be compliant with 4K resolution
- Prefixed radius Slider control variable type with namespace to avoid potential ambiguity
2.1
- Fixed orthographic camera support with Deinterleaving in Unity 5.5+
2.0
- Added a rendering pipeline integrated HBAO component (HBAO_Integrated.cs)
- Fixed orthographic camera support in Unity 5.5+
1.8
- Fixed bad rendering path detection in builds
- Explicitely declared _NoiseTex as shader property
1.7
- Added downsampled blur setting
- Added quarter resolution setting
- Improved samples distribution (Mersenne Twister)
- Fixed black line artifacts in half resolution AO using reconstructed normals
- Fixed SV_Target semantics to the proper case
- Fixed ambiguous lerp in HBAO fragment
1.6
- Added Reconstruct as a per pixel normals option
- Simplified a few lerps in HBAO shader
- Removed sliders for max distance and falloff distance so as to remove bounds
1.5
- Added deinterleaving which gives performances gain for large radiuses and HD/UltraHD resolutions
- Fixed luminance influence not handled correctly in debug views
1.4.3
- Improved overall performances
- Added support for orthographic camera projection
1.4.2
- Added per pixel normals setting (GBuffer or Camera)
- Added Max Distance and Distance Falloff settings
- Fixed AO step size, allowing to get more interesting contact occlusion
- Moved initialization to OnEnable instead of Start
- Avoid to modify GUI.Label style directly as to not mess up the stats window
- Renamed "Show Type" setting to "Display Mode"
1.4.1
- Fix editor error when applying a preset in play mode
1.4
- Added new user friendly UI & some presets
- Fixed luminance influence not showing in AO only views
- Fixed vanishing AO bug in while in editor
1.3.4
- Integrate with Gaia as an extension
1.3.3
- Added AO base color setting
- Fix leaked noise texture
- Fix demo scene
1.3.2:
- Fix bad rendering path detection in unity editor with camera on "Use Player Settings"
- Limit the maximum radius in pixels to address the close-up objects performance issue
- Added an albedo contribution and multiplier for the color bleeding feature in deferred shading
- Increased intensity upper bound (useful for dark environment)
1.3.1:
- Improved color bleeding performances
- Fix NPE when adding the HBAO component to a camera for the 1st time
1.3:
- Improved performances
- Improved compatibility (now compiles on every platforms, targetting shader model 3.0)
- Improved settings (there are less settings, but they are more user-friendly)
1.2:
- Added Color Beeding feature
- Fixed artifacts on cutout materials in forward rendering
1.1:
- Improved blur
- Added another noise type

@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 5ea4d0d9dc9d11941b341f03453fd6d3
timeCreated: 1453642158
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Readme.txt
uploadId: 886976

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6b4762034a7dbee44a7dfa37d2418bf2
folderAsset: yes
timeCreated: 1455959812
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,20 @@
{
"name": "HBAO.Runtime",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.modules.vr",
"expression": "1.0.0",
"define": "ENABLE_VR_MODULE"
}
],
"noEngineReferences": false
}

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: b83dc51897666cb44bdfbf9671f74e85
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.Runtime.asmdef
uploadId: 886976

File diff suppressed because it is too large Load Diff

@ -0,0 +1,21 @@
fileFormatVersion: 2
guid: e1580e32f765c994b86a57bb3c49fe75
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- noiseTex: {instanceID: 0}
- quadMesh: {instanceID: 0}
- hbaoShader: {fileID: 4800000, guid: 7b834eafaedd0d842bb05a969d9d14bd, type: 3}
executionOrder: 0
icon: {fileID: 2800000, guid: 6daa87e2aaa1bb04d930ca4b4bc926a7, type: 3}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Runtime/HBAO.cs
uploadId: 886976

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b9eaca9eab5e52347a811cead6015f6f
folderAsset: yes
timeCreated: 1582907081
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c2f710d028e8644b9e7012d3657c785
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a82bfeb39ff8ba5459ceb4eb8d655938
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,20 @@
{
"name": "HBAO.Universal.Editor",
"rootNamespace": "",
"references": [
"GUID:09d385cb911270749b709e1bb48e9ea1",
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:3eae0364be2026648bf74846acb8a731"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f352a4e1c986a0b4e8661cfff9c14881
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,327 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
namespace HorizonBasedAmbientOcclusion.Universal
{
#if UNITY_2022_2_OR_NEWER
[CustomEditor(typeof(HBAO), true)]
#else
[VolumeComponentEditor(typeof(HBAO))]
#endif
public class HBAOEditor : VolumeComponentEditor
{
private HBAO m_HBAO;
private Texture2D m_HBAOTex;
private GUIStyle m_SettingsGroupStyle;
private GUIStyle m_TitleLabelStyle;
private int m_SelectedPreset;
private PropertyFetcher<HBAO> m_PropertyFetcher;
// settings group <setting, property reference>
private Dictionary<HBAO.SettingsGroup, List<MemberInfo>> m_GroupFields;
private readonly Dictionary<int, HBAO.Preset> m_Presets = new Dictionary<int, HBAO.Preset>()
{
{ 0, HBAO.Preset.Normal },
{ 1, HBAO.Preset.FastPerformance },
{ 2, HBAO.Preset.FastestPerformance },
{ 3, HBAO.Preset.Custom },
{ 4, HBAO.Preset.HighQuality },
{ 5, HBAO.Preset.HighestQuality }
};
#if UNITY_2021_2_OR_NEWER
public override bool hasAdditionalProperties => false;
#else
public override bool hasAdvancedMode => false;
#endif
public override void OnEnable()
{
base.OnEnable();
m_HBAO = (HBAO)target;
m_HBAOTex = Resources.Load<Texture2D>("hbao_urp");
//var o = new PropertyFetcher<HBAO>(serializedObject);
m_PropertyFetcher = new PropertyFetcher<HBAO>(serializedObject);
m_GroupFields = new Dictionary<HBAO.SettingsGroup, List<MemberInfo>>();
var settings = m_HBAO.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
.Where(t => t.FieldType.IsSubclassOf(typeof(VolumeParameter)))
.Where(t => (t.IsPublic && t.GetCustomAttributes(typeof(NonSerializedAttribute), false).Length == 0) ||
(t.GetCustomAttributes(typeof(SerializeField), false).Length > 0))
.Where(t => t.GetCustomAttributes(typeof(HideInInspector), false).Length == 0)
.Where(t => t.GetCustomAttributes(typeof(HBAO.SettingsGroup), false).Any());
foreach (var setting in settings)
{
//Debug.Log("setting name: " + setting.Name);
foreach (var attr in setting.GetCustomAttributes(typeof(HBAO.SettingsGroup)) as IEnumerable<HBAO.SettingsGroup>)
{
if (!m_GroupFields.ContainsKey(attr))
m_GroupFields[attr] = new List<MemberInfo>();
m_GroupFields[attr].Add(setting);
}
}
m_SelectedPreset = m_Presets.Values.ToList().IndexOf(m_HBAO.GetCurrentPreset());
}
public override void OnInspectorGUI()
{
SetStyles();
EditorGUILayout.BeginVertical();
{
// header
GUILayout.Space(10.0f);
GUILayout.Label(m_HBAOTex, m_TitleLabelStyle, GUILayout.ExpandWidth(true));
//if (m_HBAO.GetComponents<MonoBehaviour>()[0] != m_HBAO)
//{
//GUILayout.Space(6.0f);
//EditorGUILayout.HelpBox("This Post FX should be one of the first in your effect stack", MessageType.Info);
//}
Event e = Event.current;
// settings groups
foreach (var group in m_GroupFields)
{
GUILayout.Space(6.0f);
Rect rect = GUILayoutUtility.GetRect(16f, 22f, m_SettingsGroupStyle);
GUI.Box(rect, ObjectNames.NicifyVariableName(group.Key.GetType().Name), m_SettingsGroupStyle);
if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition))
{
group.Key.isExpanded = !group.Key.isExpanded;
e.Use();
}
if (!group.Key.isExpanded)
continue;
// presets is a special case
if (group.Key.GetType() == typeof(HBAO.Presets))
{
GUILayout.Space(6.0f);
m_SelectedPreset = GUILayout.SelectionGrid(m_SelectedPreset, m_Presets.Values.Select(x => ObjectNames.NicifyVariableName(x.ToString())).ToArray(), 3);
GUILayout.Space(6.0f);
if (GUILayout.Button("Apply Preset"))
{
Undo.RecordObject(target, "Apply Preset");
m_HBAO.ApplyPreset(m_Presets[m_SelectedPreset]);
EditorUtility.SetDirty(target);
/*if (!EditorApplication.isPlaying)
{
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene());
}*/
}
continue;
}
foreach (var field in group.Value)
{
// warn about URP10+ required when mode is LitAO
if (group.Key.GetType() == typeof(HBAO.GeneralSettings) && field.Name == "renderingPath")
{
#if UNITY_2021_2_OR_NEWER
if (m_HBAO.mode.overrideState && m_HBAO.mode.value != HBAO.Mode.LitAO)
{
continue; // hides rendering path settings when not LitAO
}
#else
continue; // hides rendering path before URP12
#endif
}
// hide resolution when deinterleaved HBAO is on
if (group.Key.GetType() == typeof(HBAO.GeneralSettings) && field.Name == "resolution")
{
if (m_HBAO.deinterleaving.overrideState && m_HBAO.GetDeinterleaving() != HBAO.Deinterleaving.Disabled)
{
continue;
}
}
// hide noise type when deinterleaved HBAO is on
else if (group.Key.GetType() == typeof(HBAO.GeneralSettings) && field.Name == "noiseType")
{
if (m_HBAO.deinterleaving.overrideState && m_HBAO.GetDeinterleaving() != HBAO.Deinterleaving.Disabled)
{
continue;
}
}
// hide useMultiBounce setting when mode is LitAO
else if (group.Key.GetType() == typeof(HBAO.AOSettings) && field.Name == "useMultiBounce")
{
if (!m_HBAO.mode.overrideState || m_HBAO.mode.value == HBAO.Mode.LitAO)
{
continue;
}
}
// hide multiBounceInfluence setting when not used or when mode is LitAO
else if (group.Key.GetType() == typeof(HBAO.AOSettings) && field.Name == "multiBounceInfluence")
{
if (!m_HBAO.useMultiBounce.overrideState || !m_HBAO.UseMultiBounce() ||
(!m_HBAO.mode.overrideState || m_HBAO.mode.value == HBAO.Mode.LitAO))
{
continue;
}
}
// hide directLightingStrength setting when mode is normal
else if (group.Key.GetType() == typeof(HBAO.AOSettings) && field.Name == "directLightingStrength")
{
if (m_HBAO.mode.overrideState && m_HBAO.mode.value == HBAO.Mode.Normal)
{
continue;
}
}
// warn about distance falloff greater than max distance
else if (group.Key.GetType() == typeof(HBAO.AOSettings) && field.Name == "perPixelNormals")
{
if ((m_HBAO.distanceFalloff.overrideState || m_HBAO.maxDistance.overrideState) && m_HBAO.GetAoDistanceFalloff() > m_HBAO.GetAoMaxDistance())
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Distance Falloff shoudn't be greater than Max Distance.", MessageType.Warning);
}
}
// warn about motion vectors not supported
else if (group.Key.GetType() == typeof(HBAO.TemporalFilterSettings) && field.Name == "temporalFilterEnabled")
{
// For platforms not supporting motion vectors texture
// https://docs.unity3d.com/ScriptReference/DepthTextureMode.MotionVectors.html
if (!SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.RGHalf))
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Motion vectors not supported on this platform...", MessageType.Warning);
if (m_HBAO.IsTemporalFilterEnabled())
m_HBAO.EnableTemporalFilter(false);
}
else
{
#if !UNITY_2021_2_OR_NEWER
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Requires proper motion vectors support available in 2021.2+", MessageType.Warning);
if (m_HBAO.IsTemporalFilterEnabled())
m_HBAO.EnableTemporalFilter(false);
#else
if (IsVrRunning())
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Not supported yet in VR...", MessageType.Warning);
if (m_HBAO.IsTemporalFilterEnabled())
m_HBAO.EnableTemporalFilter(false);
}
#endif
}
}
// warn about color bleeding not supported when doing LitAO
else if (group.Key.GetType() == typeof(HBAO.ColorBleedingSettings) && field.Name == "colorBleedingEnabled")
{
if (!m_HBAO.mode.overrideState || m_HBAO.mode.value == HBAO.Mode.LitAO)
{
GUILayout.Space(6.0f);
EditorGUILayout.HelpBox("Color bleeding can't be used in LitAO mode as AO is being injected into the lighting.", MessageType.Warning);
if (m_HBAO.IsColorBleedingEnabled())
m_HBAO.EnableColorBleeding(false);
}
}
var parameter = Unpack(m_PropertyFetcher.Find(field.Name));
var displayName = parameter.displayName;
var hasDisplayName = field.GetCustomAttributes(typeof(HBAO.ParameterDisplayName)).Any();
if (hasDisplayName)
{
var displayNameAttribute = field.GetCustomAttributes(typeof(HBAO.ParameterDisplayName)).First() as HBAO.ParameterDisplayName;
displayName = displayNameAttribute.name;
}
PropertyField(parameter, new GUIContent(displayName));
}
GUILayout.Space(6.0f);
}
}
EditorGUILayout.EndVertical();
}
private void SetStyles()
{
// set banner label style
m_TitleLabelStyle = new GUIStyle(GUI.skin.label);
m_TitleLabelStyle.alignment = TextAnchor.MiddleCenter;
m_TitleLabelStyle.contentOffset = new Vector2(0f, 0f);
// get shuriken module title style
GUIStyle skurikenModuleTitleStyle = "ShurikenModuleTitle";
// clone it as to not interfere with the original, and adjust it
m_SettingsGroupStyle = new GUIStyle(skurikenModuleTitleStyle);
m_SettingsGroupStyle.font = (new GUIStyle("Label")).font;
m_SettingsGroupStyle.fontStyle = FontStyle.Bold;
m_SettingsGroupStyle.border = new RectOffset(15, 7, 4, 4);
m_SettingsGroupStyle.fixedHeight = 22;
m_SettingsGroupStyle.contentOffset = new Vector2(10f, -2f);
}
List<UnityEngine.XR.XRDisplaySubsystem> displays = new List<UnityEngine.XR.XRDisplaySubsystem>();
private bool IsVrRunning()
{
bool vrIsRunning = false;
displays.Clear();
SubsystemManager.GetSubsystems(displays);
foreach (var displaySubsystem in displays)
{
if (displaySubsystem.running)
{
vrIsRunning = true;
break;
}
}
return vrIsRunning;
}
[VolumeParameterDrawer(typeof(HBAO.MinMaxFloatParameter))]
public class MaxFloatParameterDrawer : VolumeParameterDrawer
{
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title)
{
if (parameter.value.propertyType == SerializedPropertyType.Vector2)
{
var o = parameter.GetObjectRef<HBAO.MinMaxFloatParameter>();
var range = o.value;
float x = range.x;
float y = range.y;
EditorGUI.BeginChangeCheck();
EditorGUILayout.MinMaxSlider(title, ref x, ref y, o.min, o.max);
if (EditorGUI.EndChangeCheck())
{
range.x = x;
range.y = y;
o.SetValue(new HBAO.MinMaxFloatParameter(range, o.min, o.max));
}
return true;
}
else
{
EditorGUILayout.LabelField(title, "Use only with Vector2");
return false;
}
}
}
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e055f53efc7d248489d6579ce7685547
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2ad43aa805fd6dd44a59e307ed9aa4bc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,115 @@
fileFormatVersion: 2
guid: ef156e8079ba9474aa9c13a37223ef49
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1f906a4e3c3820d4a9e15a21943c91ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,23 @@
{
"name": "HBAO.Universal.Runtime",
"rootNamespace": "",
"references": [
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:15fc0a57446b3144c949da3e2b9737a9"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.modules.vr",
"expression": "1.0.0",
"define": "ENABLE_VR_MODULE"
}
],
"noEngineReferences": false
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 09d385cb911270749b709e1bb48e9ea1
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,629 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace HorizonBasedAmbientOcclusion.Universal
{
[Serializable, VolumeComponentMenu("Lighting/HBAO")]
public class HBAO : VolumeComponent, IPostProcessComponent
{
public enum Preset
{
FastestPerformance,
FastPerformance,
Normal,
HighQuality,
HighestQuality,
Custom
}
public enum Mode
{
Normal,
LitAO
}
public enum RenderingPath
{
Forward,
Deferred
}
public enum Quality
{
Lowest,
Low,
Medium,
High,
Highest
}
public enum Resolution
{
Full,
Half
}
public enum NoiseType
{
Dither,
InterleavedGradientNoise,
SpatialDistribution
}
public enum Deinterleaving
{
Disabled,
x4
}
public enum DebugMode
{
Disabled,
AOOnly,
ColorBleedingOnly,
SplitWithoutAOAndWithAO,
SplitWithAOAndAOOnly,
SplitWithoutAOAndAOOnly,
ViewNormals
}
public enum BlurType
{
None,
Narrow,
Medium,
Wide,
ExtraWide
}
public enum PerPixelNormals
{
Reconstruct2Samples,
Reconstruct4Samples,
Camera
}
public enum VarianceClipping
{
Disabled,
_4Tap,
_8Tap
}
[Serializable]
public sealed class PresetParameter : VolumeParameter<Preset>
{
public PresetParameter(Preset value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class ModeParameter : VolumeParameter<Mode>
{
public ModeParameter(Mode value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class RenderingPathParameter : VolumeParameter<RenderingPath>
{
public RenderingPathParameter(RenderingPath value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class QualityParameter : VolumeParameter<Quality>
{
public QualityParameter(Quality value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class DeinterleavingParameter : VolumeParameter<Deinterleaving>
{
public DeinterleavingParameter(Deinterleaving value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class ResolutionParameter : VolumeParameter<Resolution>
{
public ResolutionParameter(Resolution value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class NoiseTypeParameter : VolumeParameter<NoiseType>
{
public NoiseTypeParameter(NoiseType value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class DebugModeParameter : VolumeParameter<DebugMode>
{
public DebugModeParameter(DebugMode value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class PerPixelNormalsParameter : VolumeParameter<PerPixelNormals>
{
public PerPixelNormalsParameter(PerPixelNormals value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class VarianceClippingParameter : VolumeParameter<VarianceClipping>
{
public VarianceClippingParameter(VarianceClipping value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class BlurTypeParameter : VolumeParameter<BlurType>
{
public BlurTypeParameter(BlurType value, bool overrideState = false)
: base(value, overrideState) { }
}
[Serializable]
public sealed class MinMaxFloatParameter : VolumeParameter<Vector2>
{
public float min;
public float max;
public MinMaxFloatParameter(Vector2 value, float min, float max, bool overrideState = false)
: base(value, overrideState)
{
this.min = min;
this.max = max;
}
}
[AttributeUsage(AttributeTargets.Field)]
public class SettingsGroup : Attribute
{
public bool isExpanded = true;
}
[AttributeUsage(AttributeTargets.Field)]
public class ParameterDisplayName : Attribute
{
public string name;
public ParameterDisplayName(string name)
{
this.name = name;
}
}
public class Presets : SettingsGroup { }
public class GeneralSettings : SettingsGroup { }
public class AOSettings : SettingsGroup { }
public class TemporalFilterSettings : SettingsGroup { }
public class BlurSettings : SettingsGroup { }
public class ColorBleedingSettings : SettingsGroup { }
[Presets]
public PresetParameter preset = new PresetParameter(Preset.Normal);
[Tooltip("The mode of the AO.")]
[GeneralSettings, Space(6)]
public ModeParameter mode = new ModeParameter(Mode.LitAO);
[Tooltip("The rendering path used for AO. Temporary settings as for now rendering path is internal to renderer settings.")]
[GeneralSettings, Space(6)]
public RenderingPathParameter renderingPath = new RenderingPathParameter(RenderingPath.Forward);
[Tooltip("The quality of the AO.")]
[GeneralSettings, Space(6)]
public QualityParameter quality = new QualityParameter(Quality.Medium);
[Tooltip("The deinterleaving factor.")]
[GeneralSettings]
public DeinterleavingParameter deinterleaving = new DeinterleavingParameter(Deinterleaving.Disabled);
[Tooltip("The resolution at which the AO is calculated.")]
[GeneralSettings]
public ResolutionParameter resolution = new ResolutionParameter(Resolution.Full);
[Tooltip("The type of noise to use.")]
[GeneralSettings, Space(10)]
public NoiseTypeParameter noiseType = new NoiseTypeParameter(NoiseType.Dither);
[Tooltip("The debug mode actually displayed on screen.")]
[GeneralSettings, Space(10)]
public DebugModeParameter debugMode = new DebugModeParameter(DebugMode.Disabled);
[Tooltip("AO radius: this is the distance outside which occluders are ignored.")]
[AOSettings, Space(6)]
public ClampedFloatParameter radius = new ClampedFloatParameter(0.8f, 0.25f, 5f);
[Tooltip("Maximum radius in pixels: this prevents the radius to grow too much with close-up " +
"object and impact on performances.")]
[AOSettings]
public ClampedFloatParameter maxRadiusPixels = new ClampedFloatParameter(128f, 16f, 256f);
[Tooltip("For low-tessellated geometry, occlusion variations tend to appear at creases and " +
"ridges, which betray the underlying tessellation. To remove these artifacts, we use " +
"an angle bias parameter which restricts the hemisphere.")]
[AOSettings]
public ClampedFloatParameter bias = new ClampedFloatParameter(0.05f, 0f, 0.5f);
[Tooltip("This value allows to scale up the ambient occlusion values.")]
[AOSettings]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0, 4f);
[Tooltip("Enable/disable MultiBounce approximation.")]
[AOSettings]
public BoolParameter useMultiBounce = new BoolParameter(false);
[Tooltip("MultiBounce approximation influence.")]
[AOSettings]
public ClampedFloatParameter multiBounceInfluence = new ClampedFloatParameter(1f, 0f, 1f);
[Tooltip("How much AO affect direct lighting.")]
[AOSettings]
public ClampedFloatParameter directLightingStrength = new ClampedFloatParameter(0.25f, 0, 1f);
[Tooltip("The amount of AO offscreen samples are contributing.")]
[AOSettings]
public ClampedFloatParameter offscreenSamplesContribution = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("The max distance to display AO.")]
[AOSettings, Space(10)]
public FloatParameter maxDistance = new FloatParameter(150f);
[Tooltip("The distance before max distance at which AO start to decrease.")]
[AOSettings]
public FloatParameter distanceFalloff = new FloatParameter(50f);
[Tooltip("The type of per pixel normals to use.")]
[AOSettings, Space(10)]
public PerPixelNormalsParameter perPixelNormals = new PerPixelNormalsParameter(PerPixelNormals.Camera);
[Tooltip("This setting allow you to set the base color if the AO, the alpha channel value is unused.")]
[AOSettings, Space(10)]
public ColorParameter baseColor = new ColorParameter(Color.black);
[TemporalFilterSettings, ParameterDisplayName("Enabled"), Space(6)]
public BoolParameter temporalFilterEnabled = new BoolParameter(false);
[Tooltip("The type of variance clipping to use.")]
[TemporalFilterSettings]
public VarianceClippingParameter varianceClipping = new VarianceClippingParameter(VarianceClipping._4Tap);
[Tooltip("The type of blur to use.")]
[BlurSettings, ParameterDisplayName("Type"), Space(6)]
public BlurTypeParameter blurType = new BlurTypeParameter(BlurType.Medium);
[Tooltip("This parameter controls the depth-dependent weight of the bilateral filter, to " +
"avoid bleeding across edges. A zero sharpness is a pure Gaussian blur. Increasing " +
"the blur sharpness removes bleeding by using lower weights for samples with large " +
"depth delta from the current pixel.")]
[BlurSettings, Space(10)]
public ClampedFloatParameter sharpness = new ClampedFloatParameter(8f, 0f, 16f);
[ColorBleedingSettings, ParameterDisplayName("Enabled"), Space(6)]
public BoolParameter colorBleedingEnabled = new BoolParameter(false);
[Tooltip("This value allows to control the saturation of the color bleeding.")]
[ColorBleedingSettings, Space(10)]
public ClampedFloatParameter saturation = new ClampedFloatParameter(1f, 0f, 4f);
[Tooltip("Use masking on emissive pixels")]
[ColorBleedingSettings]
public ClampedFloatParameter brightnessMask = new ClampedFloatParameter(1f, 0f, 1f);
[Tooltip("Brightness level where masking starts/ends")]
[ColorBleedingSettings]
public MinMaxFloatParameter brightnessMaskRange = new MinMaxFloatParameter(new Vector2(0f, 0.5f), 0f, 2f);
[Obsolete("This is deprecated method, please use SetAoIntensity instead.")]
public void EnableHBAO(bool enable)
{
intensity.overrideState = enable;
}
public Preset GetCurrentPreset()
{
return preset.value;
}
public void ApplyPreset(Preset preset)
{
if (preset == Preset.Custom)
{
this.preset.Override(preset);
return;
}
var actualDebugMode = debugMode.value;
var actualDebugModeOverride = debugMode.overrideState;
SetAllOverridesTo(false);
debugMode.overrideState = actualDebugModeOverride;
debugMode.value = actualDebugMode;
switch (preset)
{
case Preset.FastestPerformance:
SetQuality(Quality.Lowest);
SetAoRadius(0.5f);
SetAoMaxRadiusPixels(64.0f);
SetBlurType(BlurType.ExtraWide);
break;
case Preset.FastPerformance:
SetQuality(Quality.Low);
SetAoRadius(0.5f);
SetAoMaxRadiusPixels(64.0f);
SetBlurType(BlurType.Wide);
break;
case Preset.HighQuality:
SetQuality(Quality.High);
SetAoRadius(1.0f);
break;
case Preset.HighestQuality:
SetQuality(Quality.Highest);
SetAoRadius(1.2f);
SetAoMaxRadiusPixels(256.0f);
SetBlurType(BlurType.Narrow);
break;
case Preset.Normal:
default:
break;
}
this.preset.Override(preset);
}
public Mode GetMode()
{
return mode.value;
}
public void SetMode(Mode mode)
{
this.mode.Override(mode);
}
public RenderingPath GetRenderingPath()
{
return renderingPath.value;
}
public void SetRenderingPath(RenderingPath renderingPath)
{
this.renderingPath.Override(renderingPath);
}
public Quality GetQuality()
{
return quality.value;
}
public void SetQuality(Quality quality)
{
this.quality.Override(quality);
}
public Deinterleaving GetDeinterleaving()
{
return deinterleaving.value;
}
public void SetDeinterleaving(Deinterleaving deinterleaving)
{
this.deinterleaving.Override(deinterleaving);
}
public Resolution GetResolution()
{
return resolution.value;
}
public void SetResolution(Resolution resolution)
{
this.resolution.Override(resolution);
}
public NoiseType GetNoiseType()
{
return noiseType.value;
}
public void SetNoiseType(NoiseType noiseType)
{
this.noiseType.Override(noiseType);
}
public DebugMode GetDebugMode()
{
return debugMode.value;
}
public void SetDebugMode(DebugMode debugMode)
{
this.debugMode.Override(debugMode);
}
public float GetAoRadius()
{
return radius.value;
}
public void SetAoRadius(float radius)
{
this.radius.Override(Mathf.Clamp(radius, this.radius.min, this.radius.max));
}
public float GetAoMaxRadiusPixels()
{
return maxRadiusPixels.value;
}
public void SetAoMaxRadiusPixels(float maxRadiusPixels)
{
this.maxRadiusPixels.Override(Mathf.Clamp(maxRadiusPixels, this.maxRadiusPixels.min, this.maxRadiusPixels.max));
}
public float GetAoBias()
{
return bias.value;
}
public void SetAoBias(float bias)
{
this.bias.Override(Mathf.Clamp(bias, this.bias.min, this.bias.max));
}
public float GetAoOffscreenSamplesContribution()
{
return offscreenSamplesContribution.value;
}
public void SetAoOffscreenSamplesContribution(float offscreenSamplesContribution)
{
this.offscreenSamplesContribution.Override(Mathf.Clamp(offscreenSamplesContribution, this.offscreenSamplesContribution.min, this.offscreenSamplesContribution.max));
}
public float GetAoMaxDistance()
{
return maxDistance.value;
}
public void SetAoMaxDistance(float maxDistance)
{
this.maxDistance.Override(maxDistance);
}
public float GetAoDistanceFalloff()
{
return distanceFalloff.value;
}
public void SetAoDistanceFalloff(float distanceFalloff)
{
this.distanceFalloff.Override(distanceFalloff);
}
public PerPixelNormals GetAoPerPixelNormals()
{
return perPixelNormals.value;
}
public void SetAoPerPixelNormals(PerPixelNormals perPixelNormals)
{
this.perPixelNormals.Override(perPixelNormals);
}
public Color GetAoColor()
{
return baseColor.value;
}
public void SetAoColor(Color baseColor)
{
this.baseColor.Override(baseColor);
}
public float GetAoIntensity()
{
return intensity.value;
}
public void SetAoIntensity(float intensity)
{
this.intensity.Override(Mathf.Clamp(intensity, this.intensity.min, this.intensity.max));
}
public bool UseMultiBounce()
{
return useMultiBounce.value;
}
public void EnableMultiBounce(bool enabled = true)
{
useMultiBounce.Override(enabled);
}
public float GetAoMultiBounceInfluence()
{
return multiBounceInfluence.value;
}
public void SetAoMultiBounceInfluence(float multiBounceInfluence)
{
this.multiBounceInfluence.Override(Mathf.Clamp(multiBounceInfluence, this.multiBounceInfluence.min, this.multiBounceInfluence.max));
}
public bool IsTemporalFilterEnabled()
{
return temporalFilterEnabled.value;
}
public void EnableTemporalFilter(bool enabled = true)
{
temporalFilterEnabled.Override(enabled);
}
public VarianceClipping GetTemporalFilterVarianceClipping()
{
return varianceClipping.value;
}
public void SetTemporalFilterVarianceClipping(VarianceClipping varianceClipping)
{
this.varianceClipping.Override(varianceClipping);
}
public BlurType GetBlurType()
{
return blurType.value;
}
public void SetBlurType(BlurType blurType)
{
this.blurType.Override(blurType);
}
public float GetBlurSharpness()
{
return sharpness.value;
}
public void SetBlurSharpness(float sharpness)
{
this.sharpness.Override(Mathf.Clamp(sharpness, this.sharpness.min, this.sharpness.max));
}
public bool IsColorBleedingEnabled()
{
return colorBleedingEnabled.value;
}
public void EnableColorBleeding(bool enabled = true)
{
colorBleedingEnabled.Override(enabled);
}
public float GetColorBleedingSaturation()
{
return saturation.value;
}
public void SetColorBleedingSaturation(float saturation)
{
this.saturation.Override(Mathf.Clamp(saturation, this.saturation.min, this.saturation.max));
}
public float GetColorBleedingBrightnessMask()
{
return brightnessMask.value;
}
public void SetColorBleedingBrightnessMask(float brightnessMask)
{
this.brightnessMask.Override(Mathf.Clamp(brightnessMask, this.brightnessMask.min, this.brightnessMask.max));
}
public Vector2 GetColorBleedingBrightnessMaskRange()
{
return brightnessMaskRange.value;
}
public void SetColorBleedingBrightnessMaskRange(Vector2 brightnessMaskRange)
{
brightnessMaskRange.x = Mathf.Clamp(brightnessMaskRange.x, this.brightnessMaskRange.min, this.brightnessMaskRange.max);
brightnessMaskRange.y = Mathf.Clamp(brightnessMaskRange.y, this.brightnessMaskRange.min, this.brightnessMaskRange.max);
brightnessMaskRange.x = Mathf.Min(brightnessMaskRange.x, brightnessMaskRange.y);
this.brightnessMaskRange.Override(brightnessMaskRange);
}
public bool IsActive() => intensity.value > 0;
[Obsolete("Unused. #from(2023.1)")]
public bool IsTileCompatible() => true;
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 90fbf49926625114084d7e0c0cffe8d1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: f7c2c2c3c19808149a4d3454e1019255
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- settings: {fileID: 11400000, guid: 68dde9df85a05a54fbc92e3b6f3a8c42, type: 2}
- hbaoShader: {fileID: 4800000, guid: bf610497676b34e4dbe0f14fe3fe311c, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39ee3648c2c58684590305025db692f6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,384 @@
Shader "Hidden/Universal Render Pipeline/HBAO"
{
Properties
{
_MainTex("", any) = "" {}
_HBAOTex("", any) = "" {}
_TempTex("", any) = "" {}
_NoiseTex("", 2D) = "" {}
_DepthTex("", any) = "" {}
_NormalsTex("", any) = "" {}
}
HLSLINCLUDE
#pragma target 3.0
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma editor_sync_compilation
//#pragma enable_d3d11_debug_symbols
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if UNITY_VERSION >= 202330
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GlobalSamplers.hlsl"
#endif
TEXTURE2D_X(_MainTex);
TEXTURE2D_X(_HBAOTex);
TEXTURE2D_X(_TempTex);
TEXTURE2D_X(_DepthTex);
TEXTURE2D_X(_NormalsTex);
//TEXTURE2D_X(_CameraNormalsTexture);
TEXTURE2D_X(_MotionVectorTexture);
TEXTURE2D(_NoiseTex);
#if !(UNITY_VERSION >= 202330)
SAMPLER(sampler_LinearClamp);
SAMPLER(sampler_PointRepeat);
SAMPLER(sampler_PointClamp);
#endif
float4 _HistoryBuffer_RTHandleScale;
CBUFFER_START(FrequentlyUpdatedUniforms)
float4 _Input_TexelSize;
float4 _AO_TexelSize;
float4 _DeinterleavedAO_TexelSize;
float4 _ReinterleavedAO_TexelSize;
float4 _TargetScale;
float4 _UVToView[2];
//float4x4 _WorldToCameraMatrix;
float _Radius[2];
float _MaxRadiusPixels;
float _NegInvRadius2;
float _AngleBias;
float _AOmultiplier;
float _Intensity;
half4 _BaseColor;
float _MultiBounceInfluence;
float _OffscreenSamplesContrib;
float _MaxDistance;
float _DistanceFalloff;
float _BlurSharpness;
float _ColorBleedSaturation;
float _ColorBleedBrightnessMask;
float2 _ColorBleedBrightnessMaskRange;
float2 _TemporalParams;
CBUFFER_END
CBUFFER_START(PerPassUpdatedUniforms)
float2 _BlurDeltaUV;
CBUFFER_END
CBUFFER_START(PerPassUpdatedDeinterleavingUniforms)
float2 _Deinterleave_Offset00;
float2 _Deinterleave_Offset10;
float2 _Deinterleave_Offset01;
float2 _Deinterleave_Offset11;
float2 _AtlasOffset;
float2 _Jitter;
CBUFFER_END
struct Attributes
{
float4 positionOS : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
float2 TransformTriangleVertexToUV(float2 vertex)
{
float2 uv = (vertex + 1.0) * 0.5;
return uv;
}
Varyings Vert(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
//output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
// Note: The pass is setup with a mesh already in CS
// Therefore, we can just output vertex position
output.positionCS = float4(input.positionOS.xy, 0.0, 1.0);
output.uv = TransformTriangleVertexToUV(input.positionOS.xy);
#if UNITY_UV_STARTS_AT_TOP
output.uv = output.uv * float2(1.0, -1.0) + float2(0.0, 1.0);
#endif
return output;
}
Varyings Vert_Atlas(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
//float3 pos = input.positionOS.xyz;
//pos.xy = pos.xy * (_DeinterleavedAO_TexelSize.zw / _ReinterleavedAO_TexelSize.zw) + _AtlasOffset * _ReinterleavedAO_TexelSize.xy;
//output.positionCS = TransformObjectToHClip(pos);
output.positionCS = float4((input.positionOS.xy + float2(-3.0, 1.0)) * (_DeinterleavedAO_TexelSize.zw / _ReinterleavedAO_TexelSize.zw) + 2.0 * _AtlasOffset * _ReinterleavedAO_TexelSize.xy, 0.0, 1.0);
output.uv = TransformTriangleVertexToUV(input.positionOS.xy);
// flip triangle upside down
output.positionCS.y = 1 - output.positionCS.y;
return output;
}
ENDHLSL
SubShader
{
Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" }
LOD 100
ZWrite Off ZTest Always Blend Off Cull Off
Pass // 0
{
Name "HBAO - AO"
HLSLPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ OFFSCREEN_SAMPLES_CONTRIBUTION
#pragma multi_compile_local_fragment __ NORMALS_RECONSTRUCT2 NORMALS_RECONSTRUCT4
#pragma multi_compile_local_fragment __ INTERLEAVED_GRADIENT_NOISE
#pragma multi_compile_local_fragment QUALITY_LOWEST QUALITY_LOW QUALITY_MEDIUM QUALITY_HIGH QUALITY_HIGHEST
#pragma multi_compile_fragment __ _GBUFFER_NORMALS_OCT // support octahedron endoded normals
#if QUALITY_LOWEST
#define DIRECTIONS 3
#define STEPS 2
#elif QUALITY_LOW
#define DIRECTIONS 4
#define STEPS 3
#elif QUALITY_MEDIUM
#define DIRECTIONS 6
#define STEPS 4
#elif QUALITY_HIGH
#define DIRECTIONS 8
#define STEPS 4
#elif QUALITY_HIGHEST
#define DIRECTIONS 8
#define STEPS 6
#else
#define DIRECTIONS 1
#define STEPS 1
#endif
#pragma vertex Vert
#pragma fragment AO_Frag
#include "HBAO_AO.hlsl"
ENDHLSL
}
Pass // 1
{
Name "HBAO - AO Deinterleaved"
HLSLPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ OFFSCREEN_SAMPLES_CONTRIBUTION
#pragma multi_compile_local_fragment QUALITY_LOWEST QUALITY_LOW QUALITY_MEDIUM QUALITY_HIGH QUALITY_HIGHEST
#if QUALITY_LOWEST
#define DIRECTIONS 3
#define STEPS 2
#elif QUALITY_LOW
#define DIRECTIONS 4
#define STEPS 3
#elif QUALITY_MEDIUM
#define DIRECTIONS 6
#define STEPS 4
#elif QUALITY_HIGH
#define DIRECTIONS 8
#define STEPS 4
#elif QUALITY_HIGHEST
#define DIRECTIONS 8
#define STEPS 6
#else
#define DIRECTIONS 1
#define STEPS 1
#endif
#define DEINTERLEAVED
#pragma vertex Vert
#pragma fragment AO_Frag
#include "HBAO_AO.hlsl"
ENDHLSL
}
// 2
Pass {
Name "HBAO - Deinterleave Depth"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment DeinterleaveDepth_Frag
#include "HBAO_Deinterleaving.hlsl"
ENDHLSL
}
// 3
Pass {
Name "HBAO - Deinterleave Normals"
HLSLPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ NORMALS_RECONSTRUCT2 NORMALS_RECONSTRUCT4
#pragma multi_compile_fragment __ _GBUFFER_NORMALS_OCT // support octahedron endoded normals
#pragma vertex Vert
#pragma fragment DeinterleaveNormals_Frag
#include "HBAO_Deinterleaving.hlsl"
ENDHLSL
}
// 4
Pass {
Name "HBAO - Atlas Deinterleaved AO"
HLSLPROGRAM
#pragma vertex Vert_Atlas
#pragma fragment Frag
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
return SAMPLE_TEXTURE2D_X(_MainTex, sampler_PointClamp, uv);
}
ENDHLSL
}
// 5
Pass {
Name "HBAO - Reinterleave AO"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment ReinterleaveAO_Frag
#include "HBAO_Deinterleaving.hlsl"
ENDHLSL
}
Pass // 6
{
Name "HBAO - Blur"
HLSLPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment BLUR_RADIUS_2 BLUR_RADIUS_3 BLUR_RADIUS_4 BLUR_RADIUS_5
#if BLUR_RADIUS_2
#define KERNEL_RADIUS 2
#elif BLUR_RADIUS_3
#define KERNEL_RADIUS 3
#elif BLUR_RADIUS_4
#define KERNEL_RADIUS 4
#elif BLUR_RADIUS_5
#define KERNEL_RADIUS 5
#else
#define KERNEL_RADIUS 0
#endif
#pragma vertex Vert
#pragma fragment Blur_Frag
#include "HBAO_Blur.hlsl"
ENDHLSL
}
Pass // 7
{
Name "HBAO - Temporal Filter"
HLSLPROGRAM
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ VARIANCE_CLIPPING_4TAP VARIANCE_CLIPPING_8TAP
#pragma vertex Vert
#pragma fragment TemporalFilter_Frag
#include "HBAO_TemporalFilter.hlsl"
ENDHLSL
}
Pass // 8
{
Name "HBAO - Copy"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Frag
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
return SAMPLE_TEXTURE2D_X(_MainTex, sampler_LinearClamp, uv);
}
ENDHLSL
}
Pass // 9
{
Name "HBAO - Composite"
ColorMask RGB
HLSLPROGRAM
#pragma multi_compile_local_fragment __ LIT_AO
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ MULTIBOUNCE
#pragma multi_compile_local_fragment __ DEBUG_AO DEBUG_COLORBLEEDING DEBUG_NOAO_AO DEBUG_AO_AOONLY DEBUG_NOAO_AOONLY
#pragma vertex Vert
#pragma fragment Composite_Frag
#include "HBAO_Composite.hlsl"
ENDHLSL
}
Pass // 10
{
Name "HBAO - Debug ViewNormals"
ColorMask RGB
HLSLPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ NORMALS_RECONSTRUCT2 NORMALS_RECONSTRUCT4
#pragma multi_compile_fragment __ _GBUFFER_NORMALS_OCT // support octahedron endoded normals
#pragma vertex Vert
#pragma fragment AO_Frag
#define DIRECTIONS 1
#define STEPS 1
#define DEBUG_VIEWNORMALS
#include "HBAO_AO.hlsl"
ENDHLSL
}
}
Fallback Off
}

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bf610497676b34e4dbe0f14fe3fe311c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,205 @@
//----------------------------------------------------------------------------------
//
// Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------------
#ifndef HBAO_AO_INCLUDED
#define HBAO_AO_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Macros.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "HBAO_Common.hlsl"
inline float3 FetchLayerViewPos(float2 uv) {
uv = clamp(uv, 0, 1 - _Input_TexelSize.xy * 0.5); // uv guard
float depth = LinearizeDepth(SAMPLE_TEXTURE2D_X(_DepthTex, sampler_PointClamp, uv).r);
#if ORTHOGRAPHIC_PROJECTION
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw), depth);
#else
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw) * depth, depth);
#endif
}
inline float Falloff(float distanceSquare) {
// 1 scalar mad instruction
return distanceSquare * _NegInvRadius2 + 1.0;
}
inline float ComputeAO(float3 P, float3 N, float3 S) {
float3 V = S - P;
float VdotV = dot(V, V);
float NdotV = dot(N, V) * rsqrt(VdotV);
// Use saturate(x) instead of max(x,0.f) because that is faster on Kepler
return saturate(NdotV - _AngleBias) * saturate(Falloff(VdotV));
}
inline float2 RotateDirections(float2 dir, float2 rot) {
return float2(dir.x * rot.x - dir.y * rot.y,
dir.x * rot.y + dir.y * rot.x);
}
inline float InterleavedGradientNoise(float2 screenPos) {
// http://www.iryoku.com/downloads/Next-Generation-Post-Processing-in-Call-of-Duty-Advanced-Warfare-v18.pptx (slide 123)
float3 magic = float3(0.06711056, 0.00583715, 52.9829189);
return frac(magic.z * frac(dot(screenPos, magic.xy)));
}
inline float2 FetchNoise(float2 screenPos) {
#if INTERLEAVED_GRADIENT_NOISE
// Use Jorge Jimenez's IGN noise and GTAO spatial offsets distribution
// https://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf (slide 93)
return float2(InterleavedGradientNoise(screenPos), SAMPLE_TEXTURE2D(_NoiseTex, sampler_PointRepeat, screenPos / 4.0).g);
#else
// (cos(alpha), sin(alpha), jitter)
return SAMPLE_TEXTURE2D(_NoiseTex, sampler_PointRepeat, screenPos / 4.0).rg;
#endif
}
float4 AO_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
//uint2 positionSS = input.uv * _ScreenSize.xy;
#ifdef DEINTERLEAVED
float3 P = FetchLayerViewPos(uv);
#else
float3 P = FetchViewPos(uv);
#endif
#ifndef DEBUG_VIEWNORMALS
clip(_MaxDistance - P.z);
#endif
#if ORTHOGRAPHIC_PROJECTION
float stepSize = min(_Radius[unity_StereoEyeIndex], _MaxRadiusPixels) / (STEPS + 1.0);
#else
float stepSize = min((_Radius[unity_StereoEyeIndex] / P.z), _MaxRadiusPixels) / (STEPS + 1.0);
#endif
#ifdef DEINTERLEAVED
float3 N = SAMPLE_TEXTURE2D_X(_NormalsTex, sampler_PointClamp, uv).rgb * 2.0 - 1.0;
float2 rand = _Jitter; // angle, jitter
#else
float3 N = FetchViewNormals(uv, _AO_TexelSize.xy, P);
//float2 rand = FetchNoise(positionSS);
//float2 rand = FetchNoise(input.positionCS.xy);
float2 rand = FetchNoise(uv * _AO_TexelSize.zw);
#endif
const float alpha = 2.0 * PI / DIRECTIONS;
float ao = 0;
#if COLOR_BLEEDING
static float2 cbUVs[DIRECTIONS * STEPS];
static float cbContribs[DIRECTIONS * STEPS];
#endif
UNITY_UNROLL
for (int d = 0; d < DIRECTIONS; ++d) {
float angle = alpha * (float(d) + rand.x + _TemporalParams.x);
// Compute normalized 2D direction
float cosA, sinA;
sincos(angle, sinA, cosA);
float2 direction = float2(cosA, sinA);
// Jitter starting sample within the first step
float rayPixels = (frac(rand.y + _TemporalParams.y) * stepSize + 1.0);
UNITY_UNROLL
for (int s = 0; s < STEPS; ++s) {
#ifdef DEINTERLEAVED
float2 snappedUV = round(rayPixels * direction) * _DeinterleavedAO_TexelSize.xy + uv;
float3 S = FetchLayerViewPos(snappedUV);
#else
float2 snappedUV = round(rayPixels * direction) * _Input_TexelSize.xy + uv;
float3 S = FetchViewPos(snappedUV);
#endif
rayPixels += stepSize;
float contrib = ComputeAO(P, N, S);
#if OFFSCREEN_SAMPLES_CONTRIBUTION
float2 offscreenAmount = _OffscreenSamplesContrib * (snappedUV - saturate(snappedUV) != 0 ? 1 : 0);
contrib = max(contrib, offscreenAmount.x);
contrib = max(contrib, offscreenAmount.y);
#endif
ao += contrib;
#if COLOR_BLEEDING
int sampleIdx = d * s;
cbUVs[sampleIdx] = snappedUV;
cbContribs[sampleIdx] = contrib;
#endif
}
}
#ifdef DEBUG_VIEWNORMALS
return float4(N * 0.5 + 0.5, 1);
#else
#if COLOR_BLEEDING
half3 col = half3(0, 0, 0);
UNITY_UNROLL
for (int s = 0; s < DIRECTIONS * STEPS; s += 2) {
half3 emission = SAMPLE_TEXTURE2D_X_LOD(_MainTex, sampler_LinearClamp, cbUVs[s], 0).rgb;
half average = (emission.x + emission.y + emission.z) / 3;
half scaledAverage = saturate((average - _ColorBleedBrightnessMaskRange.x) / (_ColorBleedBrightnessMaskRange.y - _ColorBleedBrightnessMaskRange.x + 1e-6));
half maskMultiplier = 1 - (scaledAverage * _ColorBleedBrightnessMask);
col += emission * cbContribs[s] * maskMultiplier;
}
float4 aoOutput = float4(col, ao);
#else
float aoOutput = ao;
#endif
// apply bias multiplier
aoOutput *= (_AOmultiplier / (STEPS * DIRECTIONS));
float fallOffStart = _MaxDistance - _DistanceFalloff;
float distFactor = saturate((P.z - fallOffStart) / (_MaxDistance - fallOffStart));
#if COLOR_BLEEDING
//aoOutput.rgb = saturate(1 - lerp(dot(aoOutput.rgb, 0.333).xxx, aoOutput.rgb, _ColorBleedSaturation));
aoOutput.rgb = saturate(lerp(dot(aoOutput.rgb, 0.333).xxx, aoOutput.rgb, _ColorBleedSaturation));
aoOutput = lerp(saturate(float4(aoOutput.rgb, 1 - aoOutput.a)), float4(0, 0, 0, 1), distFactor);
return aoOutput;
#else
aoOutput = lerp(saturate(1 - aoOutput), 1, distFactor);
return float4(EncodeFloatRG(saturate(P.z * (1.0 / _ProjectionParams.z))), 1.0, aoOutput);
#endif
#endif // DEBUG_VIEWNORMALS
}
#endif // HBAO_AO_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1361d098ef86d6c41a6a6c41e84c33a4
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,143 @@
//----------------------------------------------------------------------------------
//
// Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------------
#ifndef HBAO_BLUR_INCLUDED
#define HBAO_BLUR_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "HBAO_Common.hlsl"
#if COLOR_BLEEDING
inline void FetchAoAndDepth(float2 uv, inout half4 ao, inout float depth) {
ao = SAMPLE_TEXTURE2D_X_LOD(_MainTex, sampler_PointClamp, uv, 0);
depth = LinearizeDepth(FetchRawDepth(uv));
}
inline float CrossBilateralWeight(float r, float d, float d0) {
const float BlurSigma = (float)KERNEL_RADIUS * 0.5;
const float BlurFalloff = 1.0 / (2.0*BlurSigma*BlurSigma);
float dz = (d0 - d) * _BlurSharpness;
return exp2(-r*r*BlurFalloff - dz*dz);
}
inline void ProcessSample(float4 ao, float z, float r, float d0, inout half4 totalAO, inout float totalW) {
float w = CrossBilateralWeight(r, d0, z);
totalW += w;
totalAO += w * ao;
}
inline void ProcessRadius(float2 uv0, float2 deltaUV, float d0, inout half4 totalAO, inout float totalW) {
half4 ao;
float z;
float2 uv;
UNITY_UNROLL
for (int r = 1; r <= KERNEL_RADIUS; r++) {
uv = uv0 + r * deltaUV;
FetchAoAndDepth(uv, ao, z);
ProcessSample(ao, z, r, d0, totalAO, totalW);
}
}
inline half4 ComputeBlur(float2 uv0, float2 deltaUV) {
half4 totalAO;
float depth;
FetchAoAndDepth(uv0, totalAO, depth);
float totalW = 1.0;
ProcessRadius(uv0, -deltaUV, depth, totalAO, totalW);
ProcessRadius(uv0, deltaUV, depth, totalAO, totalW);
totalAO /= totalW;
return totalAO;
}
#else
inline void FetchAoAndDepth(float2 uv, inout half ao, inout float2 depth) {
float3 aod = SAMPLE_TEXTURE2D_X_LOD(_MainTex, sampler_PointClamp, uv, 0).rga;
ao = aod.z;
depth = aod.xy;
}
inline float CrossBilateralWeight(float r, float d, float d0) {
const float BlurSigma = (float)KERNEL_RADIUS * 0.5;
const float BlurFalloff = 1.0 / (2.0*BlurSigma*BlurSigma);
float dz = (d0 - d) * _ProjectionParams.z * _BlurSharpness;
return exp2(-r*r*BlurFalloff - dz*dz);
}
inline void ProcessSample(float2 aoz, float r, float d0, inout half totalAO, inout float totalW) {
float w = CrossBilateralWeight(r, d0, aoz.y);
totalW += w;
totalAO += w * aoz.x;
}
inline void ProcessRadius(float2 uv0, float2 deltaUV, float d0, inout half totalAO, inout float totalW) {
half ao;
float z;
float2 d, uv;
UNITY_UNROLL
for (int r = 1; r <= KERNEL_RADIUS; r++) {
uv = uv0 + r * deltaUV;
FetchAoAndDepth(uv, ao, d);
z = DecodeFloatRG(d);
ProcessSample(float2(ao, z), r, d0, totalAO, totalW);
}
}
inline float4 ComputeBlur(float2 uv0, float2 deltaUV) {
half totalAO;
float2 depth;
FetchAoAndDepth(uv0, totalAO, depth);
float d0 = DecodeFloatRG(depth);
float totalW = 1.0;
ProcessRadius(uv0, -deltaUV, d0, totalAO, totalW);
ProcessRadius(uv0, deltaUV, d0, totalAO, totalW);
totalAO /= totalW;
return float4(depth, 1.0, totalAO);
}
#endif // COLOR_BLEEDING
float4 Blur_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
return ComputeBlur(uv, _BlurDeltaUV);
}
#endif // HBAO_BLUR_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 88f16f7670609254aa357e3d46e3dffe
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,93 @@
#ifndef HBAO_COMMON_INCLUDED
#define HBAO_COMMON_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#if VERSION_GREATER_EQUAL(10, 0)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl"
#endif
inline float FetchRawDepth(float2 uv) {
return SampleSceneDepth(uv * _TargetScale.xy);
}
inline float LinearizeDepth(float depth) {
// References: https://docs.unity3d.com/Manual/SL-PlatformDifferences.html
#if ORTHOGRAPHIC_PROJECTION
#if UNITY_REVERSED_Z
depth = 1 - depth;
#endif // UNITY_REVERSED_Z
float linearDepth = _ProjectionParams.y + depth * (_ProjectionParams.z - _ProjectionParams.y); // near + depth * (far - near)
#else
float linearDepth = LinearEyeDepth(depth, _ZBufferParams);
#endif // ORTHOGRAPHIC_PROJECTION
return linearDepth;
}
inline float3 FetchViewPos(float2 uv) {
uv = clamp(uv, 0, 1 - _Input_TexelSize.xy * 0.5); // uv guard
float depth = LinearizeDepth(FetchRawDepth(uv));
#if ORTHOGRAPHIC_PROJECTION
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw), depth);
#else
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw) * depth, depth);
#endif
}
inline float3 MinDiff(float3 P, float3 Pr, float3 Pl) {
float3 V1 = Pr - P;
float3 V2 = P - Pl;
return (dot(V1, V1) < dot(V2, V2)) ? V1 : V2;
}
inline float3 FetchViewNormals(float2 uv, float2 delta, float3 P) {
#if NORMALS_RECONSTRUCT4
float3 Pr, Pl, Pt, Pb;
Pr = FetchViewPos(uv + float2(delta.x, 0));
Pl = FetchViewPos(uv + float2(-delta.x, 0));
Pt = FetchViewPos(uv + float2(0, delta.y));
Pb = FetchViewPos(uv + float2(0, -delta.y));
float3 N = normalize(cross(MinDiff(P, Pr, Pl), MinDiff(P, Pt, Pb)));
#elif NORMALS_RECONSTRUCT2
float3 Pr, Pt;
Pr = FetchViewPos(uv + float2(delta.x, 0));
Pt = FetchViewPos(uv + float2(0, delta.y));
float3 N = normalize(cross(Pt - P, P - Pr));
#else
#if VERSION_GREATER_EQUAL(10, 0)
float3 N = SampleSceneNormals(uv * _TargetScale.xy);
#if VERSION_GREATER_EQUAL(10, 10) // Universal pipeline 10.10.1(2020.3.49f1) uses world space normals already, as per customer feedback
N = normalize(TransformWorldToViewDir(N)); // normals are worldspace, convert to viewspace
N = float3(N.x, -N.yz);
#else
N = float3(N.x, -N.y, N.z);
#endif
#else
float3 N = float3(0, 0, 0);
#endif
#endif
return N;
}
inline float3 FetchViewNormals(float2 uv, float2 delta) {
float3 P = FetchViewPos(uv);
return FetchViewNormals(uv, delta, P);
}
// https://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
inline float2 EncodeFloatRG(float v) {
float2 enc = float2(1.0, 255.0) * v;
enc = frac(enc);
enc.x -= enc.y * (1.0 / 255.0);
return enc;
}
inline float DecodeFloatRG(float2 rg) {
return dot(rg, float2(1.0, 1 / 255.0));
}
#endif // HBAO_COMMON_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c9db0967d4ddb8d4da2fc53a15906f15
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,79 @@
#ifndef HBAO_COMPOSITE_INCLUDED
#define HBAO_COMPOSITE_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "HBAO_Common.hlsl"
inline half4 FetchOcclusion(float2 uv) {
uv *= _HistoryBuffer_RTHandleScale.xy;
return SAMPLE_TEXTURE2D_X(_HBAOTex, sampler_LinearClamp, uv * _TargetScale.zw);
}
inline half4 FetchSceneColor(float2 uv) {
//return LOAD_TEXTURE2D_X(_MainTex, positionSS); // load not supported on GLES2
return SAMPLE_TEXTURE2D_X(_MainTex, sampler_PointClamp, uv);
}
inline half3 MultiBounceAO(float visibility, half3 albedo) {
half3 a = 2.0404 * albedo - 0.3324;
half3 b = -4.7951 * albedo + 0.6417;
half3 c = 2.7552 * albedo + 0.6903;
float x = visibility;
return max(x, ((x * a + b) * x + c) * x);
}
float4 Composite_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
//uint2 positionSS = input.uv * _ScreenSize.xy;
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
half4 ao = FetchOcclusion(uv);
ao.a = saturate(pow(abs(ao.a), _Intensity));
#if LIT_AO
half3 aoColor = ao.aaa;
half4 col = ao.aaaa;
#else
half3 aoColor = lerp(_BaseColor.rgb, half3(1.0, 1.0, 1.0), ao.a);
half4 col = FetchSceneColor(uv);
#if MULTIBOUNCE
aoColor = lerp(aoColor, MultiBounceAO(ao.a, lerp(col.rgb, _BaseColor.rgb, _BaseColor.rgb)), _MultiBounceInfluence);
#endif
col.rgb *= aoColor;
#if COLOR_BLEEDING
//col.rgb += 1 - ao.rgb;
col.rgb += ao.rgb;
#endif
#endif // LIT_AO
#if DEBUG_AO
col.rgb = aoColor;
#elif DEBUG_COLORBLEEDING && COLOR_BLEEDING
//col.rgb = 1 - ao.rgb;
col.rgb = ao.rgb;
#elif DEBUG_NOAO_AO || DEBUG_AO_AOONLY || DEBUG_NOAO_AOONLY
if (uv.x <= 0.4985) {
#if DEBUG_NOAO_AO || DEBUG_NOAO_AOONLY
col = FetchSceneColor(uv);
#endif // DEBUG_NOAO_AO || DEBUG_NOAO_AOONLY
return col;
}
if (uv.x > 0.4985 && uv.x < 0.5015) {
return half4(0, 0, 0, 1);
}
#if DEBUG_AO_AOONLY || DEBUG_NOAO_AOONLY
col.rgb = aoColor;
#endif // DEBUG_AO_AOONLY) || DEBUG_NOAO_AOONLY
#endif // DEBUG_AO
return col;
}
#endif // HBAO_COMPOSITE_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5724686e7ad5fff4cb8cc1ad5529cd06
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,70 @@
#ifndef HBAO_DEINTERLEAVING_INCLUDED
#define HBAO_DEINTERLEAVING_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "HBAO_Common.hlsl"
struct DeinterleavedOutput {
float4 Z00 : SV_Target0;
float4 Z10 : SV_Target1;
float4 Z01 : SV_Target2;
float4 Z11 : SV_Target3;
};
DeinterleavedOutput DeinterleaveDepth_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
DeinterleavedOutput o;
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
float2 pos = floor(uv * _DeinterleavedAO_TexelSize.zw) * 4.0;
float2 uv00 = (pos + _Deinterleave_Offset00 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv10 = (pos + _Deinterleave_Offset10 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv01 = (pos + _Deinterleave_Offset01 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv11 = (pos + _Deinterleave_Offset11 + 0.5) * _ReinterleavedAO_TexelSize.xy;
o.Z00 = FetchRawDepth(uv00).rrrr;
o.Z10 = FetchRawDepth(uv10).rrrr;
o.Z01 = FetchRawDepth(uv01).rrrr;
o.Z11 = FetchRawDepth(uv11).rrrr;
return o;
}
DeinterleavedOutput DeinterleaveNormals_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
DeinterleavedOutput o;
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
float2 pos = floor(uv * _DeinterleavedAO_TexelSize.zw) * 4.0;
float2 uv00 = (pos + _Deinterleave_Offset00 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv10 = (pos + _Deinterleave_Offset10 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv01 = (pos + _Deinterleave_Offset01 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv11 = (pos + _Deinterleave_Offset11 + 0.5) * _ReinterleavedAO_TexelSize.xy;
o.Z00 = float4(FetchViewNormals(uv00, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z10 = float4(FetchViewNormals(uv10, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z01 = float4(FetchViewNormals(uv01, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z11 = float4(FetchViewNormals(uv11, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
return o;
}
half4 ReinterleaveAO_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
float2 offset = fmod(floor(uv * _ReinterleavedAO_TexelSize.zw), 4.0);
uv = (floor(uv * _DeinterleavedAO_TexelSize.zw) + (offset * _DeinterleavedAO_TexelSize.zw) + 0.5) * _ReinterleavedAO_TexelSize.xy;
return SAMPLE_TEXTURE2D_X(_MainTex, sampler_LinearClamp, uv);
}
#endif // HBAO_DEINTERLEAVING_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 713016b17f006794a883de31a276c28e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,175 @@
#ifndef HBAO_TEMPORALFILTER_INCLUDED
#define HBAO_TEMPORALFILTER_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "HBAO_Common.hlsl"
struct HistoryOutput {
float4 aoHistory : SV_Target0;
#if COLOR_BLEEDING
half4 colorBleedingHistory : SV_Target1;
#endif
};
#if COLOR_BLEEDING
#define CTYPE half4
#else
#define CTYPE half
#endif
inline void FetchAoAndDepth(float2 uv, inout CTYPE ao, inout float2 depth) {
#if COLOR_BLEEDING
ao = SAMPLE_TEXTURE2D_X(_HBAOTex, sampler_PointClamp, uv);
depth = EncodeFloatRG(saturate(LinearizeDepth(FetchRawDepth(uv)) * (1.0 / _ProjectionParams.z)));
#else
float3 aod = SAMPLE_TEXTURE2D_X(_HBAOTex, sampler_PointClamp, uv).rga;
ao = aod.z;
depth = aod.xy;
#endif
}
inline float2 FetchMotionVectors(float2 uv) {
return SAMPLE_TEXTURE2D_X(_MotionVectorTexture, sampler_PointClamp, uv * _TargetScale.xy).rg;
}
inline float4 FetchAoHistory(float2 uv) {
return SAMPLE_TEXTURE2D_X(_MainTex, sampler_LinearClamp, uv * _HistoryBuffer_RTHandleScale.zw);
}
inline half4 FetchColorBleedingHistory(float2 uv) {
return SAMPLE_TEXTURE2D_X(_TempTex, sampler_LinearClamp, uv * _HistoryBuffer_RTHandleScale.zw);
}
inline CTYPE FetchNeighbor(float2 uv, float2 offset) {
#if COLOR_BLEEDING
return SAMPLE_TEXTURE2D_X(_HBAOTex, sampler_PointClamp, uv + _AO_TexelSize.xy * offset);
#else
return SAMPLE_TEXTURE2D_X(_HBAOTex, sampler_PointClamp, uv + _AO_TexelSize.xy * offset).a;
#endif
}
inline half DisocclusionTest(float2 uvm1, float2 depth, float2 depthm1) {
// disocclusion test
// https://developer.nvidia.com/sites/default/files/akamai/gamedev/files/gdc12/GDC12_Bavoil_Stable_SSAO_In_BF3_With_STF.pdf (Page 19)
float z = DecodeFloatRG(depth);
float zm1 = DecodeFloatRG(depthm1);
// for fetching zi-1, use clamp-to-border to discard out-of-frame data, with borderZ = 0.f
// https://developer.nvidia.com/sites/default/files/akamai/gamedev/files/gdc12/GDC12_Bavoil_Stable_SSAO_In_BF3_With_STF.pdf (Page 39)
// if (uvm1.x < 0 || uvm1.y < 0 || uvm1.x > 1 || uvm1.y > 1) zm1 = 0;
// if (uvm1.x < 0 || uvm1.y < 0 || uvm1.x > 1 || uvm1.y > 1) => dot(step(half4(uvm1, 1, 1), half4(0, 0, uvm1)), 1) is 1 if out-of-frame, so
zm1 *= 1.0 - dot(step(float4(uvm1, 1, 1), float4(0, 0, uvm1)), 1);
// relaxed disocclusion test: abs(1.0 - (z / zm1)) > 0.1 => 10%
// float disocclusion = max(sign(abs(1.0 - (z / zm1)) - 0.1), 0.0);
float disocclusion = abs(1.0 - (z / zm1)) > 0.1;
return disocclusion;
}
inline CTYPE VarianceClipping(float2 uv, CTYPE ao, CTYPE aom1, float velocityWeight) {
// neighborhood clamping
// http://twvideo01.ubm-us.net/o1/vault/gdc2016/Presentations/Pedersen_LasseJonFuglsang_TemporalReprojectionAntiAliasing.pdf // (pages 26-28)
// superseded by variance clipping
// http://developer.download.nvidia.com/gameworks/events/GDC2016/msalvi_temporal_supersampling.pdf (page 23-29)
#if VARIANCE_CLIPPING_4TAP
CTYPE cT = FetchNeighbor(uv, float2(0, 1));
CTYPE cR = FetchNeighbor(uv, float2(1, 0));
CTYPE cB = FetchNeighbor(uv, float2(0, -1));
CTYPE cL = FetchNeighbor(uv, float2(-1, 0));
// compute 1st and 2nd color moments
CTYPE m1 = ao + cT + cR + cB + cL;
CTYPE m2 = ao * ao + cT * cT + cR * cR + cB * cB + cL * cL;
// aabb from mean u and variance sigma2
CTYPE mu = m1 / 5.0;
CTYPE sigma = sqrt(m2 / 5.0 - mu * mu);
#elif VARIANCE_CLIPPING_8TAP
CTYPE cTL = FetchNeighbor(uv, float2(-1, 1));
CTYPE cT = FetchNeighbor(uv, float2(0, 1));
CTYPE cTR = FetchNeighbor(uv, float2(1, 1));
CTYPE cR = FetchNeighbor(uv, float2(1, 0));
CTYPE cBR = FetchNeighbor(uv, float2(1, -1));
CTYPE cB = FetchNeighbor(uv, float2(0, -1));
CTYPE cBL = FetchNeighbor(uv, float2(-1, -1));
CTYPE cL = FetchNeighbor(uv, float2(-1, 0));
// compute 1st and 2nd color moments
CTYPE m1 = ao + cTL + cT + cTR + cR + cBR + cB + cBL + cL;
CTYPE m2 = ao * ao + cTL * cTL + cT * cT + cTR * cTR + cR * cR + cBR * cBR + cB * cB + cBL * cBL + cL * cL;
// aabb from mean u and variance sigma2
CTYPE mu = m1 / 9.0;
CTYPE sigma = sqrt(m2 / 9.0 - mu * mu);
#endif
#if VARIANCE_CLIPPING_4TAP || VARIANCE_CLIPPING_8TAP
float gamma = lerp(75.0, 0.75, velocityWeight); // scale down sigma for reduced ghosting
CTYPE cmin = mu - gamma * sigma;
CTYPE cmax = mu + gamma * sigma;
// clipping
return clamp(aom1, cmin, cmax);
#else
return aom1;
#endif
}
HistoryOutput TemporalFilter_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = UnityStereoTransformScreenSpaceTex(input.uv);
// fetch current frame data
CTYPE ao; float2 depth;
FetchAoAndDepth(uv, ao, depth);
// fetch motion vectors, calculate previous frame uv
float2 mv = FetchMotionVectors(uv);
float2 uvm1 = uv - mv.xy;
float mvl = length(mv);
// fetch history
float4 aoHistory = FetchAoHistory(uvm1);
#if COLOR_BLEEDING
half4 colorBleedingHistory = FetchColorBleedingHistory(uvm1);
CTYPE aom1 = colorBleedingHistory;
#else
CTYPE aom1 = aoHistory.w;
#endif
float2 depthm1 = aoHistory.xy;
float mvlm1 = aoHistory.z;
// velocity weight
float velocityWeight = saturate(abs(mvl - mvlm1) * 300.0);
// do disocclusion test
half disocclusion = DisocclusionTest(uvm1, depth, depthm1);
// apply velocity weight and disocclusion
#if COLOR_BLEEDING
aom1.a = aom1.a + saturate(dot(float2(velocityWeight, disocclusion), 1.0)) * (ao.a - aom1.a);
#else
aom1 = aom1 + saturate(dot(float2(velocityWeight, disocclusion), 1.0)) * (ao - aom1);
#endif
// do variance clipping
aom1 = VarianceClipping(uv, ao, aom1, velocityWeight);
// exponential accumulation buffer
// http://www.klayge.org/material/4_11/Filmic%20SMAA%20v7.pdf (page 54)
// http://developer.download.nvidia.com/gameworks/events/GDC2016/msalvi_temporal_supersampling.pdf (page 13)
ao = aom1 + 0.1 * (ao - aom1);
HistoryOutput o;
#if COLOR_BLEEDING
o.aoHistory = float4(depth, mvl, ao.a);
o.colorBleedingHistory = ao;
#else
o.aoHistory = float4(depth, mvl, ao);
#endif
return o;
}
#endif // HBAO_TEMPORALFILTER_INCLUDED

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bbf71e1c97b8d654da3f7646050e713e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a4a5705f6447808468fca071356bd185
folderAsset: yes
timeCreated: 1455959813
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,464 @@
Shader "Hidden/HBAO"
{
Properties {
_MainTex ("", any) = "" {}
_HBAOTex ("", any) = "" {}
_TempTex("", any) = "" {}
_NoiseTex("", 2D) = "" {}
_DepthTex("", any) = "" {}
_NormalsTex("", any) = "" {}
}
CGINCLUDE
#pragma target 3.0
#pragma editor_sync_compilation
#include "UnityCG.cginc"
UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex);
UNITY_DECLARE_SCREENSPACE_TEXTURE(_HBAOTex);
UNITY_DECLARE_SCREENSPACE_TEXTURE(_TempTex);
UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture);
UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraGBufferTexture0); // diffuse color (RGB), occlusion (A)
UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraGBufferTexture2); // normal (rgb), --unused-- (a)
UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraMotionVectorsTexture);
UNITY_DECLARE_SCREENSPACE_TEXTURE(_NormalsTex);
UNITY_DECLARE_TEX2D(_NoiseTex);
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
UNITY_DECLARE_DEPTH_TEXTURE(_DepthTex);
CBUFFER_START(FrequentlyUpdatedUniforms)
float4 _Input_TexelSize;
float4 _AO_TexelSize;
float4 _DeinterleavedAO_TexelSize;
float4 _ReinterleavedAO_TexelSize;
float4 _TargetScale;
float4 _UVToView[2];
//float4x4 _WorldToCameraMatrix;
float _Radius[2];
float _MaxRadiusPixels;
float _NegInvRadius2;
float _AngleBias;
float _AOmultiplier;
float _Intensity;
half4 _BaseColor;
float _MultiBounceInfluence;
float _OffscreenSamplesContrib;
float _MaxDistance;
float _DistanceFalloff;
float _BlurSharpness;
float _ColorBleedSaturation;
float _AlbedoMultiplier;
float _ColorBleedBrightnessMask;
float2 _ColorBleedBrightnessMaskRange;
float2 _TemporalParams;
CBUFFER_END
CBUFFER_START(PerPassUpdatedUniforms)
float4 _UVTransform;
float2 _BlurDeltaUV;
CBUFFER_END
CBUFFER_START(PerPassUpdatedDeinterleavingUniforms)
float2 _Deinterleave_Offset00;
float2 _Deinterleave_Offset10;
float2 _Deinterleave_Offset01;
float2 _Deinterleave_Offset11;
float2 _AtlasOffset;
float2 _Jitter;
CBUFFER_END
struct Attributes
{
float3 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
//float2 uvStereo : TEXCOORD1;
//#if STEREO_INSTANCING_ENABLED
//uint stereoTargetEyeIndex : SV_RenderTargetArrayIndex;
//#endif
UNITY_VERTEX_OUTPUT_STEREO
};
float2 TransformTriangleVertexToUV(float2 vertex)
{
float2 uv = (vertex + 1.0) * 0.5;
return uv;
}
Varyings Vert_Default(Attributes input)
{
Varyings o;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_OUTPUT(Varyings, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = float4(input.vertex.xy, 0.0, 1.0);
o.uv = TransformTriangleVertexToUV(input.vertex.xy);
#if UNITY_UV_STARTS_AT_TOP
o.uv = o.uv * float2(1.0, -1.0) + float2(0.0, 1.0);
#endif
//o.uvStereo = TransformStereoScreenSpaceTex(o.uv, 1.0);
o.uv = TransformStereoScreenSpaceTex(o.uv, 1.0);
return o;
}
Varyings Vert_Atlas(Attributes input)
{
Varyings o;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_OUTPUT(Varyings, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = float4((input.vertex.xy + float2(-3.0, 1.0)) * (_DeinterleavedAO_TexelSize.zw / _ReinterleavedAO_TexelSize.zw) + 2.0 * _AtlasOffset * _ReinterleavedAO_TexelSize.xy, 0.0, 1.0);
o.uv = TransformTriangleVertexToUV(input.vertex.xy);
// flip triangle upside down
o.vertex.y = 1 - o.vertex.y;
//o.uvStereo = TransformStereoScreenSpaceTex(o.uv, 1.0);
o.uv = TransformStereoScreenSpaceTex(o.uv, 1.0);
return o;
}
Varyings Vert_UVTransform(Attributes input)
{
Varyings o;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_OUTPUT(Varyings, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = float4(input.vertex.xy, 0.0, 1.0);
o.uv = TransformTriangleVertexToUV(input.vertex.xy) * _UVTransform.xy + _UVTransform.zw;
//o.uvStereo = TransformStereoScreenSpaceTex(o.uv, 1.0);
o.uv = TransformStereoScreenSpaceTex(o.uv, 1.0);
//#if STEREO_INSTANCING_ENABLED
//o.stereoTargetEyeIndex = (uint)_DepthSlice;
//#endif
return o;
}
ENDCG
SubShader {
LOD 100
ZTest Always Cull Off ZWrite Off
// 0
Pass {
Name "HBAO - AO"
CGPROGRAM
#pragma multi_compile_local_fragment __ DEFERRED_SHADING ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ OFFSCREEN_SAMPLES_CONTRIBUTION
#pragma multi_compile_local_fragment __ NORMALS_CAMERA NORMALS_RECONSTRUCT
#pragma multi_compile_local_fragment __ INTERLEAVED_GRADIENT_NOISE
#pragma multi_compile_local_fragment QUALITY_LOWEST QUALITY_LOW QUALITY_MEDIUM QUALITY_HIGH QUALITY_HIGHEST
#if QUALITY_LOWEST
#define DIRECTIONS 3
#define STEPS 2
#elif QUALITY_LOW
#define DIRECTIONS 4
#define STEPS 3
#elif QUALITY_MEDIUM
#define DIRECTIONS 6
#define STEPS 4
#elif QUALITY_HIGH
#define DIRECTIONS 8
#define STEPS 4
#elif QUALITY_HIGHEST
#define DIRECTIONS 8
#define STEPS 6
#else
#define DIRECTIONS 1
#define STEPS 1
#endif
#pragma vertex Vert_Default
#pragma fragment AO_Frag
#include "HBAO_AO.cginc"
ENDCG
}
// 1
Pass {
Name "HBAO - AO Deinterleaved"
CGPROGRAM
#pragma multi_compile_local_fragment __ DEFERRED_SHADING ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ OFFSCREEN_SAMPLES_CONTRIBUTION
#pragma multi_compile_local_fragment QUALITY_LOWEST QUALITY_LOW QUALITY_MEDIUM QUALITY_HIGH QUALITY_HIGHEST
#if QUALITY_LOWEST
#define DIRECTIONS 3
#define STEPS 2
#elif QUALITY_LOW
#define DIRECTIONS 4
#define STEPS 3
#elif QUALITY_MEDIUM
#define DIRECTIONS 6
#define STEPS 4
#elif QUALITY_HIGH
#define DIRECTIONS 8
#define STEPS 4
#elif QUALITY_HIGHEST
#define DIRECTIONS 8
#define STEPS 6
#else
#define DIRECTIONS 1
#define STEPS 1
#endif
#define DEINTERLEAVED
#pragma vertex Vert_Default
#pragma fragment AO_Frag
#include "HBAO_AO.cginc"
ENDCG
}
// 2
Pass {
Name "HBAO - Deinterleave Depth"
CGPROGRAM
#pragma vertex Vert_Default
#pragma fragment DeinterleaveDepth_Frag
#include "HBAO_Deinterleaving.cginc"
ENDCG
}
// 3
Pass {
Name "HBAO - Deinterleave Normals"
CGPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ NORMALS_CAMERA NORMALS_RECONSTRUCT
#pragma vertex Vert_Default
#pragma fragment DeinterleaveNormals_Frag
#include "HBAO_Deinterleaving.cginc"
ENDCG
}
// 4
Pass {
Name "HBAO - Atlas Deinterleaved AO"
CGPROGRAM
#pragma vertex Vert_Atlas
#pragma fragment Frag
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, input.uv);
}
ENDCG
}
// 5
Pass {
Name "HBAO - Reinterleave AO"
CGPROGRAM
#pragma vertex Vert_UVTransform
#pragma fragment ReinterleaveAO_Frag
#include "HBAO_Deinterleaving.cginc"
ENDCG
}
// 6
Pass {
Name "HBAO - Blur"
CGPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment BLUR_RADIUS_2 BLUR_RADIUS_3 BLUR_RADIUS_4 BLUR_RADIUS_5
#if BLUR_RADIUS_2
#define KERNEL_RADIUS 2
#elif BLUR_RADIUS_3
#define KERNEL_RADIUS 3
#elif BLUR_RADIUS_4
#define KERNEL_RADIUS 4
#elif BLUR_RADIUS_5
#define KERNEL_RADIUS 5
#else
#define KERNEL_RADIUS 0
#endif
#pragma vertex Vert_Default
#pragma fragment Blur_Frag
#include "HBAO_Blur.cginc"
ENDCG
}
// 7
Pass {
Name "HBAO - Temporal Filter"
CGPROGRAM
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ VARIANCE_CLIPPING_4TAP VARIANCE_CLIPPING_8TAP
#pragma vertex Vert_Default
#pragma fragment TemporalFilter_Frag
#include "HBAO_TemporalFilter.cginc"
ENDCG
}
// 8
Pass {
Name "HBAO - Copy"
CGPROGRAM
#pragma vertex Vert_Default
#pragma fragment Frag
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, input.uv);
}
ENDCG
}
// 9
Pass {
Name "HBAO - Composite"
ColorMask RGB
CGPROGRAM
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ MULTIBOUNCE
#pragma multi_compile_local_fragment __ DEBUG_AO DEBUG_COLORBLEEDING DEBUG_NOAO_AO DEBUG_AO_AOONLY DEBUG_NOAO_AOONLY
#pragma vertex Vert_UVTransform
#pragma fragment Composite_Frag
#include "HBAO_Composite.cginc"
ENDCG
}
// 10
Pass {
Name "HBAO - Composite AfterLighting"
CGPROGRAM
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ MULTIBOUNCE
#pragma multi_compile_local_fragment __ LIGHTING_LOG_ENCODED
#pragma vertex Vert_Default
#pragma fragment Composite_Frag
#include "HBAO_Composite.cginc"
ENDCG
}
// 11
Pass {
Name "HBAO - Composite BeforeReflections"
CGPROGRAM
#pragma multi_compile_local_fragment __ COLOR_BLEEDING
#pragma multi_compile_local_fragment __ LIGHTING_LOG_ENCODED
#pragma vertex Vert_Default
#pragma fragment Composite_Lit_Frag
#include "HBAO_Composite.cginc"
ENDCG
}
// 12
Pass {
Name "HBAO - Composite BlendAO"
ColorMask RGB
Blend Zero SrcColor
CGPROGRAM
#pragma multi_compile_local_fragment __ MULTIBOUNCE
#pragma vertex Vert_UVTransform
#pragma fragment Composite_Frag_BlendAO
#include "HBAO_Composite.cginc"
ENDCG
}
// 13
Pass {
Name "HBAO - Composite BlendCB"
ColorMask RGB
Blend One One
CGPROGRAM
#pragma vertex Vert_UVTransform
#pragma fragment Composite_Frag_BlendCB
#include "HBAO_Composite.cginc"
ENDCG
}
// 14
Pass {
Name "HBAO - Debug ViewNormals"
ColorMask RGB
CGPROGRAM
#pragma multi_compile_local_fragment __ ORTHOGRAPHIC_PROJECTION
#pragma multi_compile_local_fragment __ NORMALS_CAMERA NORMALS_RECONSTRUCT
#pragma vertex Vert_UVTransform
#pragma fragment AO_Frag
#define DIRECTIONS 1
#define STEPS 1
#define DEBUG_VIEWNORMALS
#include "HBAO_AO.cginc"
ENDCG
}
}
FallBack off
}

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 7b834eafaedd0d842bb05a969d9d14bd
timeCreated: 1453645791
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO.shader
uploadId: 886976

@ -0,0 +1,204 @@
//----------------------------------------------------------------------------------
//
// Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------------
#ifndef HBAO_AO_INCLUDED
#define HBAO_AO_INCLUDED
#include "UnityCG.cginc"
#include "HBAO_Common.cginc"
inline float3 FetchLayerViewPos(float2 uv) {
uv = clamp(uv, 0, 1 - _Input_TexelSize.xy * 0.5); // uv guard
float depth = LinearizeDepth(SAMPLE_DEPTH_TEXTURE(_DepthTex, uv));
#if ORTHOGRAPHIC_PROJECTION
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw), depth);
#else
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw) * depth, depth);
#endif
}
inline float Falloff(float distanceSquare) {
// 1 scalar mad instruction
return distanceSquare * _NegInvRadius2 + 1.0;
}
inline float ComputeAO(float3 P, float3 N, float3 S) {
float3 V = S - P;
float VdotV = dot(V, V);
float NdotV = dot(N, V) * rsqrt(VdotV);
// Use saturate(x) instead of max(x,0.f) because that is faster on Kepler
return saturate(NdotV - _AngleBias) * saturate(Falloff(VdotV));
}
inline float2 RotateDirections(float2 dir, float2 rot) {
return float2(dir.x * rot.x - dir.y * rot.y,
dir.x * rot.y + dir.y * rot.x);
}
inline float InterleavedGradientNoise(float2 screenPos) {
// http://www.iryoku.com/downloads/Next-Generation-Post-Processing-in-Call-of-Duty-Advanced-Warfare-v18.pptx (slide 123)
float3 magic = float3(0.06711056, 0.00583715, 52.9829189);
return frac(magic.z * frac(dot(screenPos, magic.xy)));
}
inline float2 FetchNoise(float2 screenPos) {
#if INTERLEAVED_GRADIENT_NOISE
// Use Jorge Jimenez's IGN noise and GTAO spatial offsets distribution
// https://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf (slide 93)
return float2(InterleavedGradientNoise(screenPos), UNITY_SAMPLE_TEX2D(_NoiseTex, screenPos / 4.0).g);
#else
// (cos(alpha), sin(alpha), jitter)
return UNITY_SAMPLE_TEX2D(_NoiseTex, screenPos / 4.0).rg;
#endif
}
float4 AO_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
#ifdef DEINTERLEAVED
float3 P = FetchLayerViewPos(input.uv);
#else
float3 P = FetchViewPos(input.uv);
#endif
#ifndef DEBUG_VIEWNORMALS
clip(_MaxDistance - P.z);
#endif
#if ORTHOGRAPHIC_PROJECTION
float stepSize = min(_Radius[unity_StereoEyeIndex], _MaxRadiusPixels) / (STEPS + 1.0);
#else
float stepSize = min((_Radius[unity_StereoEyeIndex] / P.z), _MaxRadiusPixels) / (STEPS + 1.0);
#endif
#ifdef DEINTERLEAVED
float3 N = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_NormalsTex, input.uv).rgb * 2.0 - 1.0;
float2 rand = _Jitter; // angle, jitter
#else
float3 N = FetchViewNormals(input.uv, _AO_TexelSize.xy, P);
float2 rand = FetchNoise(input.uv * _AO_TexelSize.zw); // angle, jitter
#endif
const float alpha = 2.0 * UNITY_PI / DIRECTIONS;
float ao = 0;
#if COLOR_BLEEDING
static float2 cbUVs[DIRECTIONS * STEPS];
static float cbContribs[DIRECTIONS * STEPS];
#endif
UNITY_UNROLL
for (int d = 0; d < DIRECTIONS; ++d) {
float angle = alpha * (float(d) + rand.x + _TemporalParams.x);
// Compute normalized 2D direction
float cosA, sinA;
sincos(angle, sinA, cosA);
float2 direction = float2(cosA, sinA);
// Jitter starting sample within the first step
float rayPixels = (frac(rand.y + _TemporalParams.y) * stepSize + 1.0);
UNITY_UNROLL
for (int s = 0; s < STEPS; ++s) {
#ifdef DEINTERLEAVED
float2 snappedUV = round(rayPixels * direction) * _DeinterleavedAO_TexelSize.xy + input.uv;
float3 S = FetchLayerViewPos(snappedUV);
#else
float2 snappedUV = round(rayPixels * direction) * _Input_TexelSize.xy + input.uv;
float3 S = FetchViewPos(snappedUV);
#endif
rayPixels += stepSize;
float contrib = ComputeAO(P, N, S);
#if OFFSCREEN_SAMPLES_CONTRIBUTION
float2 offscreenAmount = _OffscreenSamplesContrib * (snappedUV - saturate(snappedUV) != 0 ? 1 : 0);
contrib = max(contrib, offscreenAmount.x);
contrib = max(contrib, offscreenAmount.y);
#endif
ao += contrib;
#if COLOR_BLEEDING
int sampleIdx = d * s;
cbUVs[sampleIdx] = snappedUV;
cbContribs[sampleIdx] = contrib;
#endif
}
}
#ifdef DEBUG_VIEWNORMALS
N = float3(N.x, -N.y, N.z);
return float4(N * 0.5 + 0.5, 1);
#else
#if COLOR_BLEEDING
half3 col = half3(0, 0, 0);
UNITY_UNROLL
for (int s = 0; s < DIRECTIONS * STEPS; s += 2) {
half3 emission = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, cbUVs[s]).rgb;
half average = (emission.x + emission.y + emission.z) / 3;
half scaledAverage = saturate((average - _ColorBleedBrightnessMaskRange.x) / (_ColorBleedBrightnessMaskRange.y - _ColorBleedBrightnessMaskRange.x + 1e-6));
half maskMultiplier = 1 - (scaledAverage * _ColorBleedBrightnessMask);
col += emission * cbContribs[s] * maskMultiplier;
}
#if DEFERRED_SHADING
half3 albedo = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraGBufferTexture0, input.uv).rgb * 0.8 + 0.2;
albedo *= _AlbedoMultiplier;
#else
half3 albedo = half3(1, 1, 1);
#endif
float4 aoOutput = float4(col, ao);
#else
float aoOutput = ao;
#endif
// apply bias multiplier
aoOutput *= (_AOmultiplier / (STEPS * DIRECTIONS));
float fallOffStart = _MaxDistance - _DistanceFalloff;
float distFactor = saturate((P.z - fallOffStart) / (_MaxDistance - fallOffStart));
#if COLOR_BLEEDING
//aoOutput.rgb = saturate(1 - lerp(dot(aoOutput.rgb, 0.333).xxx, aoOutput.rgb * albedo, _ColorBleedSaturation));
aoOutput.rgb = saturate(lerp(dot(aoOutput.rgb, 0.333).xxx, aoOutput.rgb * albedo, _ColorBleedSaturation));
aoOutput = lerp(saturate(float4(aoOutput.rgb, 1 - aoOutput.a)), float4(0, 0, 0, 1), distFactor);
return aoOutput;
#else
aoOutput = lerp(saturate(1 - aoOutput), 1, distFactor);
return float4(EncodeFloatRG(saturate(P.z * (1.0 / _ProjectionParams.z))), 1.0, aoOutput);
#endif
#endif // DEBUG_VIEWNORMALS
}
#endif // HBAO_AO_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: aa7be86dd68319442ac4a9c85bb21c81
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_AO.cginc
uploadId: 886976

@ -0,0 +1,139 @@
//----------------------------------------------------------------------------------
//
// Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------------
#ifndef HBAO_BLUR_INCLUDED
#define HBAO_BLUR_INCLUDED
#include "HBAO_Common.cginc"
#if COLOR_BLEEDING
inline void FetchAoAndDepth(float2 uv, inout half4 ao, inout float depth) {
ao = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv);
depth = LinearizeDepth(FetchRawDepth(uv));
}
inline float CrossBilateralWeight(float r, float d, float d0) {
const float BlurSigma = (float)KERNEL_RADIUS * 0.5;
const float BlurFalloff = 1.0 / (2.0*BlurSigma*BlurSigma);
float dz = (d0 - d) * _BlurSharpness;
return exp2(-r*r*BlurFalloff - dz*dz);
}
inline void ProcessSample(float4 ao, float z, float r, float d0, inout half4 totalAO, inout float totalW) {
float w = CrossBilateralWeight(r, d0, z);
totalW += w;
totalAO += w * ao;
}
inline void ProcessRadius(float2 uv0, float2 deltaUV, float d0, inout half4 totalAO, inout float totalW) {
half4 ao;
float z;
float2 uv;
UNITY_UNROLL
for (int r = 1; r <= KERNEL_RADIUS; r++) {
uv = uv0 + r * deltaUV;
FetchAoAndDepth(uv, ao, z);
ProcessSample(ao, z, r, d0, totalAO, totalW);
}
}
inline half4 ComputeBlur(float2 uv0, float2 deltaUV) {
half4 totalAO;
float depth;
FetchAoAndDepth(uv0, totalAO, depth);
float totalW = 1.0;
ProcessRadius(uv0, -deltaUV, depth, totalAO, totalW);
ProcessRadius(uv0, deltaUV, depth, totalAO, totalW);
totalAO /= totalW;
return totalAO;
}
#else
inline void FetchAoAndDepth(float2 uv, inout half ao, inout float2 depth) {
float3 aod = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv).rga;
ao = aod.z;
depth = aod.xy;
}
inline float CrossBilateralWeight(float r, float d, float d0) {
const float BlurSigma = (float)KERNEL_RADIUS * 0.5;
const float BlurFalloff = 1.0 / (2.0*BlurSigma*BlurSigma);
float dz = (d0 - d) * _ProjectionParams.z * _BlurSharpness;
return exp2(-r*r*BlurFalloff - dz*dz);
}
inline void ProcessSample(float2 aoz, float r, float d0, inout half totalAO, inout float totalW) {
float w = CrossBilateralWeight(r, d0, aoz.y);
totalW += w;
totalAO += w * aoz.x;
}
inline void ProcessRadius(float2 uv0, float2 deltaUV, float d0, inout half totalAO, inout float totalW) {
half ao;
float z;
float2 d, uv;
UNITY_UNROLL
for (int r = 1; r <= KERNEL_RADIUS; r++) {
uv = uv0 + r * deltaUV;
FetchAoAndDepth(uv, ao, d);
z = DecodeFloatRG(d);
ProcessSample(float2(ao, z), r, d0, totalAO, totalW);
}
}
inline float4 ComputeBlur(float2 uv0, float2 deltaUV) {
half totalAO;
float2 depth;
FetchAoAndDepth(uv0, totalAO, depth);
float d0 = DecodeFloatRG(depth);
float totalW = 1.0;
ProcessRadius(uv0, -deltaUV, d0, totalAO, totalW);
ProcessRadius(uv0, deltaUV, d0, totalAO, totalW);
totalAO /= totalW;
return float4(depth, 1.0, totalAO);
}
#endif // COLOR_BLEEDING
float4 Blur_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
return ComputeBlur(input.uv, _BlurDeltaUV);
}
#endif // HBAO_BLUR_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 6fd3fc8e7b174414084ef2a2f3ce7cc0
timeCreated: 1453540070
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Blur.cginc
uploadId: 886976

@ -0,0 +1,67 @@
#ifndef HBAO_COMMON_INCLUDED
#define HBAO_COMMON_INCLUDED
#include "UnityCG.cginc"
inline float FetchRawDepth(float2 uv) {
return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv * _TargetScale.xy);
}
inline float LinearizeDepth(float depth) {
// References: https://docs.unity3d.com/Manual/SL-PlatformDifferences.html
#if ORTHOGRAPHIC_PROJECTION
#if UNITY_REVERSED_Z
depth = 1 - depth;
#endif // UNITY_REVERSED_Z
float linearDepth = _ProjectionParams.y + depth * (_ProjectionParams.z - _ProjectionParams.y); // near + depth * (far - near)
#else
float linearDepth = LinearEyeDepth(depth);
#endif // ORTHOGRAPHIC_PROJECTION
return linearDepth;
}
inline float3 FetchViewPos(float2 uv) {
uv = clamp(uv, 0, 1 - _Input_TexelSize.xy * 0.5); // uv guard
float depth = LinearizeDepth(FetchRawDepth(uv));
#if ORTHOGRAPHIC_PROJECTION
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw), depth);
#else
return float3((uv * _UVToView[unity_StereoEyeIndex].xy + _UVToView[unity_StereoEyeIndex].zw) * depth, depth);
#endif
}
inline float3 MinDiff(float3 P, float3 Pr, float3 Pl) {
float3 V1 = Pr - P;
float3 V2 = P - Pl;
return (dot(V1, V1) < dot(V2, V2)) ? V1 : V2;
}
inline float3 FetchViewNormals(float2 uv, float2 delta, float3 P) {
#if NORMALS_RECONSTRUCT
float3 Pr, Pl, Pt, Pb;
Pr = FetchViewPos(uv + float2(delta.x, 0));
Pl = FetchViewPos(uv + float2(-delta.x, 0));
Pt = FetchViewPos(uv + float2(0, delta.y));
Pb = FetchViewPos(uv + float2(0, -delta.y));
float3 N = normalize(cross(MinDiff(P, Pr, Pl), MinDiff(P, Pt, Pb)));
#else
#if NORMALS_CAMERA
float3 N = DecodeViewNormalStereo(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv * _TargetScale.xy));
#else
float3 N = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraGBufferTexture2, uv * _TargetScale.xy).rgb * 2.0 - 1.0;
//N = mul((float3x3)_WorldToCameraMatrix, N);
N = mul((float3x3)UNITY_MATRIX_V, N);
#endif // NORMALS_CAMERA
N = float3(N.x, -N.yz);
#endif // NORMALS_RECONSTRUCT
return N;
}
inline float3 FetchViewNormals(float2 uv, float2 delta) {
float3 P = FetchViewPos(uv);
return FetchViewNormals(uv, delta, P);
}
#endif // HBAO_COMMON_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: bd898bf629326454b8b704ad339d0312
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Common.cginc
uploadId: 886976

@ -0,0 +1,150 @@
#ifndef HBAO_COMPOSITE_INCLUDED
#define HBAO_COMPOSITE_INCLUDED
#include "UnityCG.cginc"
#include "HBAO_Common.cginc"
inline half4 FetchOcclusion(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HBAOTex, uv * _TargetScale.zw);
}
inline half4 FetchSceneColor(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv);
}
inline half4 FetchGBuffer0(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_TempTex, uv);
}
inline half4 FetchGBuffer3(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv);
}
inline half3 MultiBounceAO(float visibility, half3 albedo) {
half3 a = 2.0404 * albedo - 0.3324;
half3 b = -4.7951 * albedo + 0.6417;
half3 c = 2.7552 * albedo + 0.6903;
float x = visibility;
return max(x, ((x * a + b) * x + c) * x);
}
half4 Composite_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
//uint2 positionSS = input.uv * _ScreenSize.xy;
half4 ao = FetchOcclusion(input.uv);
ao.a = saturate(pow(abs(ao.a), _Intensity));
half3 aoColor = lerp(_BaseColor.rgb, half3(1.0, 1.0, 1.0), ao.a);
half4 col = FetchSceneColor(input.uv);
#if LIGHTING_LOG_ENCODED
col.rgb = -log2(col.rgb);
#endif
#if MULTIBOUNCE
aoColor = lerp(aoColor, MultiBounceAO(ao.a, lerp(col.rgb, _BaseColor.rgb, _BaseColor.rgb)), _MultiBounceInfluence);
#endif
col.rgb *= aoColor;
#if COLOR_BLEEDING
//col.rgb += 1 - ao.rgb;
col.rgb += ao.rgb;
#endif
#if LIGHTING_LOG_ENCODED
col.rgb = exp2(-col.rgb);
#endif
#if DEBUG_AO
col.rgb = aoColor;
#elif DEBUG_COLORBLEEDING && COLOR_BLEEDING
//col.rgb = 1 - ao.rgb;
col.rgb = ao.rgb;
#elif DEBUG_NOAO_AO || DEBUG_AO_AOONLY || DEBUG_NOAO_AOONLY
if (input.uv.x <= 0.4985) {
#if DEBUG_NOAO_AO || DEBUG_NOAO_AOONLY
col = FetchSceneColor(input.uv);
#endif // DEBUG_NOAO_AO || DEBUG_NOAO_AOONLY
return col;
}
if (input.uv.x > 0.4985 && input.uv.x < 0.5015) {
return half4(0, 0, 0, 1);
}
#if DEBUG_AO_AOONLY || DEBUG_NOAO_AOONLY
col.rgb = aoColor;
#endif // DEBUG_AO_AOONLY) || DEBUG_NOAO_AOONLY
#endif // DEBUG_AO
return col;
}
half4 Composite_Frag_BlendAO(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
half4 ao = FetchOcclusion(input.uv);
ao.a = saturate(pow(abs(ao.a), _Intensity));
half3 aoColor = lerp(_BaseColor.rgb, half3(1.0, 1.0, 1.0), ao.a);
#if MULTIBOUNCE
half4 col = FetchSceneColor(input.uv);
aoColor = lerp(aoColor, MultiBounceAO(ao.a, lerp(col.rgb, _BaseColor.rgb, _BaseColor.rgb)), _MultiBounceInfluence);
#endif
return float4(aoColor, 1);
}
half4 Composite_Frag_BlendCB(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
half4 ao = FetchOcclusion(input.uv);
return float4(ao.rgb, 1);
}
struct CombinedOutput {
half4 gbuffer0 : SV_Target0; // albedo (RGB), occlusion (A)
half4 gbuffer3 : SV_Target1; // emission (RGB), unused(A)
};
CombinedOutput Composite_Lit_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
half4 ao = FetchOcclusion(input.uv);
ao.a = saturate(pow(abs(ao.a), _Intensity));
half3 aoColor = lerp(_BaseColor.rgb, half3(1.0, 1.0, 1.0), ao.a);
half4 albedoOcc = FetchGBuffer0(input.uv);
half4 emission = FetchGBuffer3(input.uv);
#if LIGHTING_LOG_ENCODED
emission.rgb = -log2(emission.rgb);
#endif
CombinedOutput o;
o.gbuffer0 = half4(albedoOcc.rgb, albedoOcc.a * ao.a);
o.gbuffer3 = half4(emission.rgb * lerp(aoColor, half3(1.0, 1.0, 1.0), saturate((emission.r + emission.g + emission.b) / 3)), emission.a);
#if COLOR_BLEEDING
//o.gbuffer3.rgb += 1 - ao.rgb;
o.gbuffer3.rgb += ao.rgb;
#endif
#if LIGHTING_LOG_ENCODED
o.gbuffer3.rgb = exp2(-o.gbuffer3.rgb);
#endif
return o;
}
#endif // HBAO_COMPOSITE_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: fccaaf1b3dbd6e74d80289679d2d1e5a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Composite.cginc
uploadId: 886976

@ -0,0 +1,62 @@
#ifndef HBAO_DEINTERLEAVING_INCLUDED
#define HBAO_DEINTERLEAVING_INCLUDED
#include "HBAO_Common.cginc"
struct DeinterleavedOutput {
float4 Z00 : SV_Target0;
float4 Z10 : SV_Target1;
float4 Z01 : SV_Target2;
float4 Z11 : SV_Target3;
};
DeinterleavedOutput DeinterleaveDepth_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
DeinterleavedOutput o;
float2 pos = floor(input.uv * _DeinterleavedAO_TexelSize.zw) * 4.0;
float2 uv00 = (pos + _Deinterleave_Offset00 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv10 = (pos + _Deinterleave_Offset10 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv01 = (pos + _Deinterleave_Offset01 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv11 = (pos + _Deinterleave_Offset11 + 0.5) * _ReinterleavedAO_TexelSize.xy;
o.Z00 = FetchRawDepth(uv00).rrrr;
o.Z10 = FetchRawDepth(uv10).rrrr;
o.Z01 = FetchRawDepth(uv01).rrrr;
o.Z11 = FetchRawDepth(uv11).rrrr;
return o;
}
DeinterleavedOutput DeinterleaveNormals_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
DeinterleavedOutput o;
float2 pos = floor(input.uv * _DeinterleavedAO_TexelSize.zw) * 4.0;
float2 uv00 = (pos + _Deinterleave_Offset00 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv10 = (pos + _Deinterleave_Offset10 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv01 = (pos + _Deinterleave_Offset01 + 0.5) * _ReinterleavedAO_TexelSize.xy;
float2 uv11 = (pos + _Deinterleave_Offset11 + 0.5) * _ReinterleavedAO_TexelSize.xy;
o.Z00 = float4(FetchViewNormals(uv00, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z10 = float4(FetchViewNormals(uv10, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z01 = float4(FetchViewNormals(uv01, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
o.Z11 = float4(FetchViewNormals(uv11, _ReinterleavedAO_TexelSize.xy) * 0.5 + 0.5, 0);
return o;
}
half4 ReinterleaveAO_Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 offset = fmod(floor(input.uv * _ReinterleavedAO_TexelSize.zw), 4.0);
float2 uv = (floor(input.uv * _DeinterleavedAO_TexelSize.zw) + (offset * _DeinterleavedAO_TexelSize.zw) + 0.5) * _ReinterleavedAO_TexelSize.xy;
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv);
}
#endif // HBAO_DEINTERLEAVING_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 87df896bfe60ae541ae6565690473297
timeCreated: 1467102228
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_Deinterleaving.cginc
uploadId: 886976

@ -0,0 +1,171 @@
#ifndef HBAO_TEMPORALFILTER_INCLUDED
#define HBAO_TEMPORALFILTER_INCLUDED
#include "HBAO_Common.cginc"
struct HistoryOutput {
float4 aoHistory : SV_Target0;
#if COLOR_BLEEDING
half4 colorBleedingHistory : SV_Target1;
#endif
};
#if COLOR_BLEEDING
#define CTYPE half4
#else
#define CTYPE half
#endif
inline void FetchAoAndDepth(float2 uv, inout CTYPE ao, inout float2 depth) {
#if COLOR_BLEEDING
ao = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HBAOTex, uv);
depth = EncodeFloatRG(saturate(LinearizeDepth(FetchRawDepth(uv)) * (1.0 / _ProjectionParams.z)));
#else
float3 aod = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HBAOTex, uv).rga;
ao = aod.z;
depth = aod.xy;
#endif
}
inline float2 FetchMotionVectors(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraMotionVectorsTexture, uv * _TargetScale.xy).rg;
}
inline float4 FetchAoHistory(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv);
}
inline half4 FetchColorBleedingHistory(float2 uv) {
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_TempTex, uv);
}
inline CTYPE FetchNeighbor(float2 uv, float2 offset) {
#if COLOR_BLEEDING
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HBAOTex, uv + _AO_TexelSize.xy * offset);
#else
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HBAOTex, uv + _AO_TexelSize.xy * offset).a;
#endif
}
inline half DisocclusionTest(float2 uvm1, float2 depth, float2 depthm1) {
// disocclusion test
// https://developer.nvidia.com/sites/default/files/akamai/gamedev/files/gdc12/GDC12_Bavoil_Stable_SSAO_In_BF3_With_STF.pdf (Page 19)
float z = DecodeFloatRG(depth);
float zm1 = DecodeFloatRG(depthm1);
// for fetching zi-1, use clamp-to-border to discard out-of-frame data, with borderZ = 0.f
// https://developer.nvidia.com/sites/default/files/akamai/gamedev/files/gdc12/GDC12_Bavoil_Stable_SSAO_In_BF3_With_STF.pdf (Page 39)
// if (uvm1.x < 0 || uvm1.y < 0 || uvm1.x > 1 || uvm1.y > 1) zm1 = 0;
// if (uvm1.x < 0 || uvm1.y < 0 || uvm1.x > 1 || uvm1.y > 1) => dot(step(half4(uvm1, 1, 1), half4(0, 0, uvm1)), 1) is 1 if out-of-frame, so
zm1 *= 1.0 - dot(step(float4(uvm1, 1, 1), float4(0, 0, uvm1)), 1);
// relaxed disocclusion test: abs(1.0 - (z / zm1)) > 0.1 => 10%
// float disocclusion = max(sign(abs(1.0 - (z / zm1)) - 0.1), 0.0);
float disocclusion = abs(1.0 - (z / zm1)) > 0.1;
return disocclusion;
}
inline CTYPE VarianceClipping(float2 uv, CTYPE ao, CTYPE aom1, float velocityWeight) {
// neighborhood clamping
// http://twvideo01.ubm-us.net/o1/vault/gdc2016/Presentations/Pedersen_LasseJonFuglsang_TemporalReprojectionAntiAliasing.pdf // (pages 26-28)
// superseded by variance clipping
// http://developer.download.nvidia.com/gameworks/events/GDC2016/msalvi_temporal_supersampling.pdf (page 23-29)
#if VARIANCE_CLIPPING_4TAP
CTYPE cT = FetchNeighbor(uv, float2(0, 1));
CTYPE cR = FetchNeighbor(uv, float2(1, 0));
CTYPE cB = FetchNeighbor(uv, float2(0, -1));
CTYPE cL = FetchNeighbor(uv, float2(-1, 0));
// compute 1st and 2nd color moments
CTYPE m1 = ao + cT + cR + cB + cL;
CTYPE m2 = ao * ao + cT * cT + cR * cR + cB * cB + cL * cL;
// aabb from mean u and variance sigma2
CTYPE mu = m1 / 5.0;
CTYPE sigma = sqrt(m2 / 5.0 - mu * mu);
#elif VARIANCE_CLIPPING_8TAP
CTYPE cTL = FetchNeighbor(uv, float2(-1, 1));
CTYPE cT = FetchNeighbor(uv, float2(0, 1));
CTYPE cTR = FetchNeighbor(uv, float2(1, 1));
CTYPE cR = FetchNeighbor(uv, float2(1, 0));
CTYPE cBR = FetchNeighbor(uv, float2(1, -1));
CTYPE cB = FetchNeighbor(uv, float2(0, -1));
CTYPE cBL = FetchNeighbor(uv, float2(-1, -1));
CTYPE cL = FetchNeighbor(uv, float2(-1, 0));
// compute 1st and 2nd color moments
CTYPE m1 = ao + cTL + cT + cTR + cR + cBR + cB + cBL + cL;
CTYPE m2 = ao * ao + cTL * cTL + cT * cT + cTR * cTR + cR * cR + cBR * cBR + cB * cB + cBL * cBL + cL * cL;
// aabb from mean u and variance sigma2
CTYPE mu = m1 / 9.0;
CTYPE sigma = sqrt(m2 / 9.0 - mu * mu);
#endif
#if VARIANCE_CLIPPING_4TAP || VARIANCE_CLIPPING_8TAP
float gamma = lerp(75.0, 0.75, velocityWeight); // scale down sigma for reduced ghosting
CTYPE cmin = mu - gamma * sigma;
CTYPE cmax = mu + gamma * sigma;
// clipping
return clamp(aom1, cmin, cmax);
#else
return aom1;
#endif
}
HistoryOutput TemporalFilter_Frag(Varyings input)
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
// fetch current frame data
CTYPE ao; float2 depth;
FetchAoAndDepth(input.uv, ao, depth);
// fetch motion vectors, calculate previous frame uv
float2 mv = FetchMotionVectors(input.uv);
float2 uvm1 = input.uv - mv;
float mvl = length(mv);
// fetch history
float4 aoHistory = FetchAoHistory(uvm1);
#if COLOR_BLEEDING
half4 colorBleedingHistory = FetchColorBleedingHistory(uvm1);
CTYPE aom1 = colorBleedingHistory;
#else
CTYPE aom1 = aoHistory.w;
#endif
float2 depthm1 = aoHistory.xy;
float mvlm1 = aoHistory.z;
// velocity weight
float velocityWeight = saturate(abs(mvl - mvlm1) * 300.0);
// do disocclusion test
half disocclusion = DisocclusionTest(uvm1, depth, depthm1);
// apply velocity weight and disocclusion
#if COLOR_BLEEDING
aom1.a = aom1.a + saturate(dot(float2(velocityWeight, disocclusion), 1.0)) * (ao.a - aom1.a);
#else
aom1 = aom1 + saturate(dot(float2(velocityWeight, disocclusion), 1.0)) * (ao - aom1);
#endif
// do variance clipping
aom1 = VarianceClipping(input.uv, ao, aom1, velocityWeight);
// exponential accumulation buffer
// http://www.klayge.org/material/4_11/Filmic%20SMAA%20v7.pdf (page 54)
// http://developer.download.nvidia.com/gameworks/events/GDC2016/msalvi_temporal_supersampling.pdf (page 13)
ao = aom1 + 0.1 * (ao - aom1);
HistoryOutput o;
#if COLOR_BLEEDING
o.aoHistory = float4(depth, mvl, ao.a);
o.colorBleedingHistory = ao;
#else
o.aoHistory = float4(depth, mvl, ao);
#endif
return o;
}
#endif // HBAO_TEMPORALFILTER_INCLUDED

@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 5fb134650ee52e041b4eb742f0f5e6fc
timeCreated: 1583930399
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 54780
packageName: Horizon Based Ambient Occlusion
packageVersion: 3.7
assetPath: Assets/Horizon Based Ambient Occlusion/Shaders/HBAO_TemporalFilter.cginc
uploadId: 886976

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 052faaac586de48259a63d0c4782560b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
generateWrapperCode: 0
wrapperCodePath:
wrapperClassName:
wrapperCodeNamespace:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8434ef6815e9c7c4681acf829e0d84ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9e27af73fb025934d90889c63af29bba
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Black
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.103999995, g: 0.103999995, b: 0.10053333, a: 1}
- _Color: {r: 0.10399995, g: 0.10399995, b: 0.1005333, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &4431363231931934953
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1295642f1274bc34a98dba24a73d45e6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,254 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6989835814840294288
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90fbf49926625114084d7e0c0cffe8d1, type: 3}
m_Name: HBAO
m_EditorClassIdentifier: HBAO.Universal.Runtime::HorizonBasedAmbientOcclusion.Universal.HBAO
active: 1
preset:
m_OverrideState: 0
m_Value: 2
mode:
m_OverrideState: 0
m_Value: 1
renderingPath:
m_OverrideState: 0
m_Value: 0
quality:
m_OverrideState: 0
m_Value: 2
deinterleaving:
m_OverrideState: 0
m_Value: 0
resolution:
m_OverrideState: 0
m_Value: 0
noiseType:
m_OverrideState: 0
m_Value: 0
debugMode:
m_OverrideState: 0
m_Value: 0
radius:
m_OverrideState: 1
m_Value: 4.51
maxRadiusPixels:
m_OverrideState: 0
m_Value: 128
bias:
m_OverrideState: 1
m_Value: 0.097
intensity:
m_OverrideState: 1
m_Value: 1
useMultiBounce:
m_OverrideState: 0
m_Value: 0
multiBounceInfluence:
m_OverrideState: 0
m_Value: 1
directLightingStrength:
m_OverrideState: 0
m_Value: 0.25
offscreenSamplesContribution:
m_OverrideState: 0
m_Value: 0
maxDistance:
m_OverrideState: 0
m_Value: 150
distanceFalloff:
m_OverrideState: 0
m_Value: 50
perPixelNormals:
m_OverrideState: 0
m_Value: 2
baseColor:
m_OverrideState: 0
m_Value: {r: 0, g: 0, b: 0, a: 1}
temporalFilterEnabled:
m_OverrideState: 0
m_Value: 1
varianceClipping:
m_OverrideState: 0
m_Value: 1
blurType:
m_OverrideState: 0
m_Value: 2
sharpness:
m_OverrideState: 0
m_Value: 8
colorBleedingEnabled:
m_OverrideState: 0
m_Value: 0
saturation:
m_OverrideState: 0
m_Value: 1
brightnessMask:
m_OverrideState: 0
m_Value: 1
brightnessMaskRange:
m_OverrideState: 0
m_Value: {x: 0, y: 0.5}
min: 0
max: 2
--- !u!114 &-5474690943039039243
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3}
m_Name: DepthOfField
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.DepthOfField
active: 1
mode:
m_OverrideState: 1
m_Value: 2
gaussianStart:
m_OverrideState: 1
m_Value: 60
gaussianEnd:
m_OverrideState: 1
m_Value: 70
gaussianMaxRadius:
m_OverrideState: 1
m_Value: 1
highQualitySampling:
m_OverrideState: 1
m_Value: 0
focusDistance:
m_OverrideState: 1
m_Value: 60
aperture:
m_OverrideState: 1
m_Value: 1
focalLength:
m_OverrideState: 1
m_Value: 300
bladeCount:
m_OverrideState: 0
m_Value: 5
bladeCurvature:
m_OverrideState: 0
m_Value: 1
bladeRotation:
m_OverrideState: 0
m_Value: 0
--- !u!114 &-32820517437979890
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 1
skipIterations:
m_OverrideState: 0
m_Value: 1
threshold:
m_OverrideState: 0
m_Value: 0.9
intensity:
m_OverrideState: 1
m_Value: 0.5
scatter:
m_OverrideState: 0
m_Value: 0.7
clamp:
m_OverrideState: 0
m_Value: 65472
tint:
m_OverrideState: 0
m_Value: {r: 1, g: 1, b: 1, a: 1}
highQualityFiltering:
m_OverrideState: 0
m_Value: 0
filter:
m_OverrideState: 0
m_Value: 0
downscale:
m_OverrideState: 0
m_Value: 0
maxIterations:
m_OverrideState: 0
m_Value: 6
dirtTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
dimension: 1
dirtIntensity:
m_OverrideState: 0
m_Value: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
m_Name: GlobalVolumeProfile
m_EditorClassIdentifier:
components:
- {fileID: 1881579288749618558}
- {fileID: -32820517437979890}
- {fileID: -5474690943039039243}
- {fileID: -6989835814840294288}
--- !u!114 &1881579288749618558
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
m_Name: Tonemapping
m_EditorClassIdentifier:
active: 1
mode:
m_OverrideState: 1
m_Value: 2
neutralHDRRangeReductionMode:
m_OverrideState: 0
m_Value: 2
acesPreset:
m_OverrideState: 0
m_Value: 3
hueShiftAmount:
m_OverrideState: 0
m_Value: 0
detectPaperWhite:
m_OverrideState: 0
m_Value: 0
paperWhite:
m_OverrideState: 0
m_Value: 300
detectBrightnessLimits:
m_OverrideState: 0
m_Value: 1
minNits:
m_OverrideState: 0
m_Value: 0.005
maxNits:
m_OverrideState: 0
m_Value: 1000

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f46645358cbbd04eaa1121591e09687
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Gold
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 1
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.829
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0.8235294, b: 0.5058824, a: 1}
- _Color: {r: 1, g: 0.8235294, b: 0.5058824, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &4431363231931934953
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ea33cab331b2f0e4fa84f1bf90a3c6db
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ground
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.65099996, g: 0.65099996, b: 0.65099996, a: 1}
- _Color: {r: 0.6509999, g: 0.6509999, b: 0.6509999, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &4431363231931934953
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: df53c85fb9e7b32469227e519820b309
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38e65b272d6d7aa468b968dc218375f3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,154 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8081582795363580827
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Lit
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ClearCoatMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicSpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoat: 0
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossinessSource: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _ReflectionSource: 0
- _Shininess: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f6c74585b8cf8e4d937f89ac4e94747
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Main/ReflectionProbe-0.exr (Stored with Git LFS)

Binary file not shown.

@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 19fde3f08bcb7fb40bff481b52835c30
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Main/UnityMaterialBall.fbx (Stored with Git LFS)

Binary file not shown.

@ -0,0 +1,112 @@
fileFormatVersion: 2
guid: 222a53bfd672e6742a55f3f0809aa1fe
ModelImporter:
serializedVersion: 22102
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: 10 - Default
second: {fileID: 2100000, guid: e0f7961861aa5ae4a97805f16f8306b7, type: 2}
materials:
materialImportMode: 0
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 0
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: White
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &4431363231931934953
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90cb37d4746524b45a22b588b2fa0f8e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 91c90b6f4ca65b946a1e24669c8c19e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,432 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 330585546}
- component: {fileID: 330585545}
- component: {fileID: 330585544}
- component: {fileID: 330585547}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &330585544
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
--- !u!20 &330585545
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &330585546
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &330585547
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 1
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
quality: 3
frameInfluence: 0.1
jitterScale: 1
mipBias: 0
varianceClampScale: 0.9
contrastAdaptiveSharpening: 0
--- !u!1 &410087039
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 410087041}
- component: {fileID: 410087040}
- component: {fileID: 410087042}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &410087040
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 2
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 5000
m_UseColorTemperature: 1
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &410087041
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &410087042
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 1
--- !u!1 &832575517
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 832575519}
- component: {fileID: 832575518}
m_Layer: 0
m_Name: Global Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &832575518
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 832575517}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2}
--- !u!4 &832575519
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 832575517}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 330585546}
- {fileID: 410087041}
- {fileID: 832575519}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save