├── .gitignore
├── .vsconfig
├── Assets
├── Crosshair.png
├── Crosshair.png.meta
├── Materials.meta
├── Materials
│ ├── Basic.mat
│ ├── Basic.mat.meta
│ ├── OctreeLit.mat
│ ├── OctreeLit.mat.meta
│ ├── Skybox_Mat.mat
│ └── Skybox_Mat.mat.meta
├── Scenes.meta
├── Scenes
│ ├── SVO.unity
│ └── SVO.unity.meta
├── Scripts.meta
├── Scripts
│ ├── CameraController.cs
│ ├── CameraController.cs.meta
│ ├── SVO.meta
│ ├── SVO
│ │ ├── AttributeEncoder.cs
│ │ ├── AttributeEncoder.cs.meta
│ │ ├── MeshToOctree.meta
│ │ ├── MeshToOctree
│ │ │ ├── MeshToOctree.cs
│ │ │ ├── MeshToOctree.cs.meta
│ │ │ ├── MeshToOctreeEditor.cs
│ │ │ ├── MeshToOctreeEditor.cs.meta
│ │ │ ├── MeshToOctreeStandard.cs
│ │ │ └── MeshToOctreeStandard.cs.meta
│ │ ├── Octree.cs
│ │ ├── Octree.cs.meta
│ │ ├── RayHit.cs
│ │ ├── RayHit.cs.meta
│ │ ├── Shaders.meta
│ │ ├── Shaders
│ │ │ ├── GeometryRayCast.hlsl
│ │ │ ├── GeometryRayCast.hlsl.meta
│ │ │ ├── OctreeBase.shader
│ │ │ ├── OctreeBase.shader.meta
│ │ │ ├── Util.hlsl
│ │ │ └── Util.hlsl.meta
│ │ ├── ShadowRenderer.cs
│ │ ├── ShadowRenderer.cs.meta
│ │ ├── TriBoxOverlap.cs
│ │ ├── TriBoxOverlap.cs.meta
│ │ ├── Utils.meta
│ │ └── Utils
│ │ │ ├── OctreeMath.cs
│ │ │ └── OctreeMath.cs.meta
│ ├── VoxelPlacer.cs
│ └── VoxelPlacer.cs.meta
├── Settings.meta
└── Settings
│ ├── ForwardRenderer.asset
│ ├── ForwardRenderer.asset.meta
│ ├── SampleSceneProfile.asset
│ ├── SampleSceneProfile.asset.meta
│ ├── UniversalRP-HighQuality.asset
│ ├── UniversalRP-HighQuality.asset.meta
│ ├── UniversalRP-LowQuality.asset
│ ├── UniversalRP-LowQuality.asset.meta
│ ├── UniversalRP-MediumQuality.asset
│ └── UniversalRP-MediumQuality.asset.meta
├── LICENSE
├── Packages
├── manifest.json
└── packages-lock.json
├── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── PackageManagerSettings.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── URPProjectSettings.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
└── XRSettings.asset
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # This .gitignore file should be placed at the root of your Unity project directory
2 | #
3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4 | #
5 | /[Ll]ibrary/
6 | /[Tt]emp/
7 | /[Oo]bj/
8 | /[Bb]uild/
9 | /[Bb]uilds/
10 | /[Ll]ogs/
11 | /[Mm]emoryCaptures/
12 |
13 | # Asset meta data should only be ignored when the corresponding asset is also ignored
14 | !/[Aa]ssets/**/*.meta
15 |
16 | # Uncomment this line if you wish to ignore the asset store tools plugin
17 | # /[Aa]ssets/AssetStoreTools*
18 |
19 | # Autogenerated Jetbrains Rider plugin
20 | [Aa]ssets/Plugins/Editor/JetBrains*
21 |
22 | # Visual Studio cache directory
23 | .vs/
24 |
25 | # Gradle cache directory
26 | .gradle/
27 |
28 | # Autogenerated VS/MD/Consulo solution and project files
29 | ExportedObj/
30 | .consulo/
31 | *.csproj
32 | *.unityproj
33 | *.sln
34 | *.suo
35 | *.tmp
36 | *.user
37 | *.userprefs
38 | *.pidb
39 | *.booproj
40 | *.svd
41 | *.pdb
42 | *.mdb
43 | *.opendb
44 | *.VC.db
45 |
46 | # Unity3D generated meta files
47 | *.pidb.meta
48 | *.pdb.meta
49 | *.mdb.meta
50 |
51 | # Unity3D generated file on crash reports
52 | sysinfo.txt
53 |
54 | # Builds
55 | *.apk
56 | *.unitypackage
57 |
58 | # Crashlytics generated file
59 | crashlytics-build.properties
60 |
61 | .idea
--------------------------------------------------------------------------------
/.vsconfig:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "components": [
4 | "Microsoft.VisualStudio.Workload.ManagedGame"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/Assets/Crosshair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xandergos/unity-svo-demo/8f5fec00c665a459c4ee55df8ba31b8c0481168a/Assets/Crosshair.png
--------------------------------------------------------------------------------
/Assets/Crosshair.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c5d70f0f47569bb48b40de31ed601b2d
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 11
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 1
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 0
17 | mipMapFadeDistanceEnd: 10
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 0
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: 1
35 | aniso: 2
36 | mipBias: -100
37 | wrapU: 1
38 | wrapV: 1
39 | wrapW: 1
40 | nPOTScale: 0
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 1
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 32
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 0
51 | alphaUsage: 1
52 | alphaIsTransparency: 1
53 | spriteTessellationDetail: -1
54 | textureType: 8
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | applyGammaDecoding: 0
61 | platformSettings:
62 | - serializedVersion: 3
63 | buildTarget: DefaultTexturePlatform
64 | maxTextureSize: 8192
65 | resizeAlgorithm: 0
66 | textureFormat: -1
67 | textureCompression: 1
68 | compressionQuality: 50
69 | crunchedCompression: 0
70 | allowsAlphaSplitting: 0
71 | overridden: 0
72 | androidETC2FallbackOverride: 0
73 | forceMaximumCompressionQuality_BC6H_BC7: 0
74 | - serializedVersion: 3
75 | buildTarget: Standalone
76 | maxTextureSize: 8192
77 | resizeAlgorithm: 0
78 | textureFormat: -1
79 | textureCompression: 1
80 | compressionQuality: 50
81 | crunchedCompression: 0
82 | allowsAlphaSplitting: 0
83 | overridden: 0
84 | androidETC2FallbackOverride: 0
85 | forceMaximumCompressionQuality_BC6H_BC7: 0
86 | - serializedVersion: 3
87 | buildTarget: iPhone
88 | maxTextureSize: 8192
89 | resizeAlgorithm: 0
90 | textureFormat: -1
91 | textureCompression: 1
92 | compressionQuality: 50
93 | crunchedCompression: 0
94 | allowsAlphaSplitting: 0
95 | overridden: 0
96 | androidETC2FallbackOverride: 0
97 | forceMaximumCompressionQuality_BC6H_BC7: 0
98 | - serializedVersion: 3
99 | buildTarget: Android
100 | maxTextureSize: 8192
101 | resizeAlgorithm: 0
102 | textureFormat: -1
103 | textureCompression: 1
104 | compressionQuality: 50
105 | crunchedCompression: 0
106 | allowsAlphaSplitting: 0
107 | overridden: 0
108 | androidETC2FallbackOverride: 0
109 | forceMaximumCompressionQuality_BC6H_BC7: 0
110 | - serializedVersion: 3
111 | buildTarget: Windows Store Apps
112 | maxTextureSize: 8192
113 | resizeAlgorithm: 0
114 | textureFormat: -1
115 | textureCompression: 1
116 | compressionQuality: 50
117 | crunchedCompression: 0
118 | allowsAlphaSplitting: 0
119 | overridden: 0
120 | androidETC2FallbackOverride: 0
121 | forceMaximumCompressionQuality_BC6H_BC7: 0
122 | spriteSheet:
123 | serializedVersion: 2
124 | sprites: []
125 | outline: []
126 | physicsShape: []
127 | bones: []
128 | spriteID: 5e97eb03825dee720800000000000000
129 | internalID: 0
130 | vertices: []
131 | indices:
132 | edges: []
133 | weights: []
134 | secondaryTextures: []
135 | spritePackingTag:
136 | pSDRemoveMatte: 0
137 | pSDShowRemoveMatteOption: 0
138 | userData:
139 | assetBundleName:
140 | assetBundleVariant:
141 |
--------------------------------------------------------------------------------
/Assets/Materials.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0234ba368eeec9418390da711bfdad0
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Materials/Basic.mat:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-6806776278004627503
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 11
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | version: 2
16 | --- !u!21 &2100000
17 | Material:
18 | serializedVersion: 6
19 | m_ObjectHideFlags: 0
20 | m_CorrespondingSourceObject: {fileID: 0}
21 | m_PrefabInstance: {fileID: 0}
22 | m_PrefabAsset: {fileID: 0}
23 | m_Name: Basic
24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
25 | m_ShaderKeywords:
26 | m_LightmapFlags: 4
27 | m_EnableInstancingVariants: 0
28 | m_DoubleSidedGI: 0
29 | m_CustomRenderQueue: 2000
30 | stringTagMap:
31 | RenderType: Opaque
32 | disabledShaderPasses: []
33 | m_SavedProperties:
34 | serializedVersion: 3
35 | m_TexEnvs:
36 | - _BaseMap:
37 | m_Texture: {fileID: 0}
38 | m_Scale: {x: 1, y: 1}
39 | m_Offset: {x: 0, y: 0}
40 | - _BumpMap:
41 | m_Texture: {fileID: 0}
42 | m_Scale: {x: 1, y: 1}
43 | m_Offset: {x: 0, y: 0}
44 | - _EmissionMap:
45 | m_Texture: {fileID: 0}
46 | m_Scale: {x: 1, y: 1}
47 | m_Offset: {x: 0, y: 0}
48 | - _MainTex:
49 | m_Texture: {fileID: 0}
50 | m_Scale: {x: 1, y: 1}
51 | m_Offset: {x: 0, y: 0}
52 | - _MetallicGlossMap:
53 | m_Texture: {fileID: 0}
54 | m_Scale: {x: 1, y: 1}
55 | m_Offset: {x: 0, y: 0}
56 | - _OcclusionMap:
57 | m_Texture: {fileID: 0}
58 | m_Scale: {x: 1, y: 1}
59 | m_Offset: {x: 0, y: 0}
60 | - _SpecGlossMap:
61 | m_Texture: {fileID: 0}
62 | m_Scale: {x: 1, y: 1}
63 | m_Offset: {x: 0, y: 0}
64 | m_Floats:
65 | - _AlphaClip: 0
66 | - _Blend: 0
67 | - _BumpScale: 1
68 | - _Cull: 2
69 | - _Cutoff: 0.5
70 | - _DstBlend: 0
71 | - _EnvironmentReflections: 1
72 | - _GlossMapScale: 0
73 | - _Glossiness: 0
74 | - _GlossyReflections: 0
75 | - _Metallic: 0
76 | - _OcclusionStrength: 1
77 | - _QueueOffset: 0
78 | - _ReceiveShadows: 1
79 | - _Smoothness: 0.5
80 | - _SmoothnessTextureChannel: 0
81 | - _SpecularHighlights: 1
82 | - _SrcBlend: 1
83 | - _Surface: 0
84 | - _WorkflowMode: 1
85 | - _ZWrite: 1
86 | m_Colors:
87 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1}
88 | - _Color: {r: 1, g: 1, b: 1, a: 1}
89 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
90 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
91 |
--------------------------------------------------------------------------------
/Assets/Materials/Basic.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 30d2e453a1a16d648bf4cfed197d5c5d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2100000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Materials/OctreeLit.mat:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-9117321739268400919
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 11
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | version: 2
16 | --- !u!21 &2100000
17 | Material:
18 | serializedVersion: 6
19 | m_ObjectHideFlags: 0
20 | m_CorrespondingSourceObject: {fileID: 0}
21 | m_PrefabInstance: {fileID: 0}
22 | m_PrefabAsset: {fileID: 0}
23 | m_Name: OctreeLit
24 | m_Shader: {fileID: 4800000, guid: 1d83b7f417db45379038f53f5ab515b0, type: 3}
25 | m_ShaderKeywords: _CULL_FRONT
26 | m_LightmapFlags: 4
27 | m_EnableInstancingVariants: 0
28 | m_DoubleSidedGI: 0
29 | m_CustomRenderQueue: -1
30 | stringTagMap: {}
31 | disabledShaderPasses: []
32 | m_SavedProperties:
33 | serializedVersion: 3
34 | m_TexEnvs:
35 | - _BaseMap:
36 | m_Texture: {fileID: 0}
37 | m_Scale: {x: 1, y: 1}
38 | m_Offset: {x: 0, y: 0}
39 | - _BumpMap:
40 | m_Texture: {fileID: 0}
41 | m_Scale: {x: 1, y: 1}
42 | m_Offset: {x: 0, y: 0}
43 | - _EmissionMap:
44 | m_Texture: {fileID: 0}
45 | m_Scale: {x: 1, y: 1}
46 | m_Offset: {x: 0, y: 0}
47 | - _MainTex:
48 | m_Texture: {fileID: 0}
49 | m_Scale: {x: 1, y: 1}
50 | m_Offset: {x: 0, y: 0}
51 | - _MetallicGlossMap:
52 | m_Texture: {fileID: 0}
53 | m_Scale: {x: 1, y: 1}
54 | m_Offset: {x: 0, y: 0}
55 | - _OcclusionMap:
56 | m_Texture: {fileID: 0}
57 | m_Scale: {x: 1, y: 1}
58 | m_Offset: {x: 0, y: 0}
59 | - _SpecGlossMap:
60 | m_Texture: {fileID: 0}
61 | m_Scale: {x: 1, y: 1}
62 | m_Offset: {x: 0, y: 0}
63 | - _Volume:
64 | m_Texture: {fileID: 0}
65 | m_Scale: {x: 1, y: 1}
66 | m_Offset: {x: 0, y: 0}
67 | m_Floats:
68 | - _AlphaClip: 0
69 | - _Blend: 0
70 | - _BumpScale: 1
71 | - _Cull: 1
72 | - _Cutoff: 0.5
73 | - _DstBlend: 0
74 | - _EnvironmentReflections: 1
75 | - _GlossMapScale: 0
76 | - _Glossiness: 0
77 | - _GlossyReflections: 0
78 | - _Metallic: 0
79 | - _OcclusionStrength: 1
80 | - _QueueOffset: 0
81 | - _ReceiveShadows: 1
82 | - _Shininess: 0.074
83 | - _Smoothness: 0.5
84 | - _SmoothnessTextureChannel: 0
85 | - _SpecularHighlights: 1
86 | - _SrcBlend: 1
87 | - _Surface: 0
88 | - _WorkflowMode: 1
89 | - _ZWrite: 1
90 | m_Colors:
91 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1}
92 | - _Color: {r: 1, g: 1, b: 1, a: 1}
93 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
94 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
95 |
--------------------------------------------------------------------------------
/Assets/Materials/OctreeLit.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 01a5bf5c32c507d4cbd6064c81e3eac0
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 2100000
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Materials/Skybox_Mat.mat:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!21 &2100000
4 | Material:
5 | serializedVersion: 6
6 | m_ObjectHideFlags: 0
7 | m_CorrespondingSourceObject: {fileID: 0}
8 | m_PrefabInstance: {fileID: 0}
9 | m_PrefabAsset: {fileID: 0}
10 | m_Name: Skybox_Mat
11 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0}
12 | m_ShaderKeywords: _METALLIC_SETUP _SUNDISK_HIGH_QUALITY
13 | m_LightmapFlags: 4
14 | m_EnableInstancingVariants: 0
15 | m_DoubleSidedGI: 0
16 | m_CustomRenderQueue: -1
17 | stringTagMap: {}
18 | disabledShaderPasses: []
19 | m_SavedProperties:
20 | serializedVersion: 3
21 | m_TexEnvs:
22 | - _BumpMap:
23 | m_Texture: {fileID: 0}
24 | m_Scale: {x: 1, y: 1}
25 | m_Offset: {x: 0, y: 0}
26 | - _DetailAlbedoMap:
27 | m_Texture: {fileID: 0}
28 | m_Scale: {x: 1, y: 1}
29 | m_Offset: {x: 0, y: 0}
30 | - _DetailMask:
31 | m_Texture: {fileID: 0}
32 | m_Scale: {x: 1, y: 1}
33 | m_Offset: {x: 0, y: 0}
34 | - _DetailNormalMap:
35 | m_Texture: {fileID: 0}
36 | m_Scale: {x: 1, y: 1}
37 | m_Offset: {x: 0, y: 0}
38 | - _EmissionMap:
39 | m_Texture: {fileID: 0}
40 | m_Scale: {x: 1, y: 1}
41 | m_Offset: {x: 0, y: 0}
42 | - _MainTex:
43 | m_Texture: {fileID: 0}
44 | m_Scale: {x: 1, y: 1}
45 | m_Offset: {x: 0, y: 0}
46 | - _MetallicGlossMap:
47 | m_Texture: {fileID: 0}
48 | m_Scale: {x: 1, y: 1}
49 | m_Offset: {x: 0, y: 0}
50 | - _OcclusionMap:
51 | m_Texture: {fileID: 0}
52 | m_Scale: {x: 1, y: 1}
53 | m_Offset: {x: 0, y: 0}
54 | - _ParallaxMap:
55 | m_Texture: {fileID: 0}
56 | m_Scale: {x: 1, y: 1}
57 | m_Offset: {x: 0, y: 0}
58 | - _SpecGlossMap:
59 | m_Texture: {fileID: 0}
60 | m_Scale: {x: 1, y: 1}
61 | m_Offset: {x: 0, y: 0}
62 | m_Floats:
63 | - _AtmosphereThickness: 0.53
64 | - _BumpScale: 1
65 | - _Cutoff: 0.5
66 | - _DetailNormalMapScale: 1
67 | - _DstBlend: 0
68 | - _Exposure: 1
69 | - _GlossMapScale: 1
70 | - _Glossiness: 0.5
71 | - _GlossyReflections: 1
72 | - _Metallic: 0
73 | - _Mode: 0
74 | - _OcclusionStrength: 1
75 | - _Parallax: 0.02
76 | - _SmoothnessTextureChannel: 0
77 | - _SpecularHighlights: 1
78 | - _SrcBlend: 1
79 | - _SunDisk: 2
80 | - _SunSize: 0.046
81 | - _SunSizeConvergence: 4.88
82 | - _UVSec: 0
83 | - _WorkflowMode: 1
84 | - _ZWrite: 1
85 | m_Colors:
86 | - _Color: {r: 1, g: 1, b: 1, a: 1}
87 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
88 | - _GroundColor: {r: 0.6392157, g: 0.6901961, b: 0.7411765, a: 1}
89 | - _SkyTint: {r: 1, g: 1, b: 1, a: 1}
90 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
91 |
--------------------------------------------------------------------------------
/Assets/Materials/Skybox_Mat.mat.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ffaa0b7117ba8c47a9d05ae701d4b4d
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8b2243ebbdf49b34fa12efec23c992d5
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scenes/SVO.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 799223979bdce2e4bb68c5aa162b02af
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 02a3527b6b33a924e8ec66aa805ea717
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/CameraController.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Sparse Voxel Octrees Demo
3 | Copyright (C) 2021 Alexander Goslin
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program. If not, see .
17 | */
18 |
19 | using System;
20 | using UnityEngine;
21 |
22 | namespace UnityTemplateProjects
23 | {
24 | public class CameraController : MonoBehaviour
25 | {
26 | public float speed = 0;
27 | public float pitch = 0f;
28 | public float yaw = 0f;
29 |
30 | private void Update()
31 | {
32 | pitch -= Input.GetAxis("Mouse Y");
33 | yaw += Input.GetAxis("Mouse X");
34 | transform.rotation = Quaternion.Euler(pitch, yaw, 0f);
35 |
36 | Vector3 dir = Vector3.zero;
37 | if (Input.GetKey(KeyCode.W))
38 | dir += transform.forward;
39 | if (Input.GetKey(KeyCode.A))
40 | dir -= transform.right;
41 | if (Input.GetKey(KeyCode.S))
42 | dir -= transform.forward;
43 | if (Input.GetKey(KeyCode.D))
44 | dir += transform.right;
45 | if (Input.GetKey(KeyCode.Space))
46 | dir += transform.up;
47 | if (Input.GetKey(KeyCode.LeftControl))
48 | dir -= transform.up;
49 | dir = Vector3.Normalize(dir);
50 |
51 | var tempSpeed = 1f;
52 | if (Input.GetKey(KeyCode.LeftShift))
53 | tempSpeed = 2f;
54 | transform.position += dir * (Time.deltaTime * Mathf.Pow(2, speed) * tempSpeed);
55 |
56 | speed += Input.mouseScrollDelta.y * 0.2f;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/Assets/Scripts/CameraController.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9f505e950ba34d739d3bcb128ce7d887
3 | timeCreated: 1625942540
--------------------------------------------------------------------------------
/Assets/Scripts/SVO.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2ce13a04353d0c14ca70c788bb88faac
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/AttributeEncoder.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using UnityEngine;
20 |
21 | namespace SVO
22 | {
23 | public static class AttributeEncoder
24 | {
25 | ///
26 | /// Encodes the shading data used by most standard octree shaders.
27 | ///
28 | /// Normal to encode.
29 | /// The shading data to be used.
30 | public static int[] EncodeStandardAttributes(Vector3 normal)
31 | {
32 | return new[] { EncodeNormal(normal) };
33 | }
34 |
35 | public static int EncodeNormal(Vector3 normal)
36 | {
37 | var encoded = 0;
38 | var maxAbsComp = Mathf.Max(Mathf.Max(Mathf.Abs(normal.x), Mathf.Abs(normal.y)), Mathf.Abs(normal.z));
39 | var cubicNormal = normal / maxAbsComp;
40 | var cubicNormalUnorm = cubicNormal * .5f + new Vector3(.5f, .5f, .5f);
41 | if (Mathf.Abs(normal.x) == maxAbsComp)
42 | {
43 | encoded |= ((System.Math.Sign(normal.x) + 1) / 2) << 22;
44 | encoded |= (int)(1023f * cubicNormalUnorm.y) << 10;
45 | encoded |= (int)(1023f * cubicNormalUnorm.z);
46 | }
47 | else if (Mathf.Abs(normal.y) == maxAbsComp)
48 | {
49 | encoded |= ((System.Math.Sign(normal.y) + 1) / 2) << 22;
50 | encoded |= 1 << 20;
51 | encoded |= (int)(1023f * cubicNormalUnorm.x) << 10;
52 | encoded |= (int)(1023f * cubicNormalUnorm.z);
53 | }
54 | else if (Mathf.Abs(normal.z) == maxAbsComp)
55 | {
56 | encoded |= ((System.Math.Sign(normal.z) + 1) / 2) << 22;
57 | encoded |= 2 << 20;
58 | encoded |= (int)(1023f * cubicNormalUnorm.x) << 10;
59 | encoded |= (int)(1023f * cubicNormalUnorm.y);
60 | }
61 |
62 | return encoded;
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/AttributeEncoder.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9ba599f58577484e9bc32b8313ef6ed0
3 | timeCreated: 1598459583
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 220ceb98d6004f1f833a8defd47cd385
3 | timeCreated: 1604172888
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctree.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using UnityEditor;
22 | using UnityEngine;
23 |
24 | #if UNITY_EDITOR
25 |
26 | namespace SVO
27 | {
28 | public abstract class MeshToOctree: MonoBehaviour
29 | {
30 | public Mesh mesh;
31 | public float voxelSize;
32 | public Material material;
33 | public void Generate()
34 | {
35 | var idealBounds = FindIdealOctreeBounds();
36 |
37 | var depth = Mathf.RoundToInt(Mathf.Log(idealBounds.size.x / voxelSize, 2));
38 |
39 | if (depth > 12)
40 | throw new NotSupportedException("Octree voxel size is too small. Please split the mesh.");
41 |
42 | var octreeData = new Octree();
43 | for (var submesh = 0; submesh < mesh.subMeshCount; submesh++)
44 | {
45 | FillSubmesh(octreeData, depth, submesh, idealBounds.size.x, idealBounds.center);
46 | }
47 | AssetDatabase.CreateAsset(octreeData.Apply(true), "Assets/mesh.asset");
48 | }
49 |
50 | private void FillSubmesh(Octree data, int depth, int submesh, float octreeSize, Vector3 octreeCenter)
51 | {
52 | OnFillSubmesh(submesh);
53 |
54 | var indices = mesh.GetIndices(submesh);
55 | var triIndices = new int[3];
56 | var vertices = new List();
57 | mesh.GetVertices(vertices);
58 |
59 | var triVerts = new Vector3[3];
60 | var triVertsMesh = new Vector3[3];
61 |
62 | var octreeSizeInv = 1 / octreeSize;
63 |
64 | for (var i = 0; i < indices.Length; i += 3)
65 | {
66 | triIndices[0] = indices[i];
67 | triIndices[1] = indices[i + 1];
68 | triIndices[2] = indices[i + 2];
69 | triVerts[0] = (vertices[triIndices[0]] - octreeCenter) * octreeSizeInv;
70 | triVerts[1] = (vertices[triIndices[1]] - octreeCenter) * octreeSizeInv;
71 | triVerts[2] = (vertices[triIndices[2]] - octreeCenter) * octreeSizeInv;
72 | triVertsMesh[0] = vertices[triIndices[0]];
73 | triVertsMesh[1] = vertices[triIndices[1]];
74 | triVertsMesh[2] = vertices[triIndices[2]];
75 | Tuple InternalGenerateAttributes(Bounds bounds)
76 | {
77 | var transformedCenter = bounds.center * octreeSize + octreeCenter;
78 | return GenerateAttributes(triVertsMesh, triIndices, bounds,
79 | new Bounds(transformedCenter, Vector3.one * voxelSize),
80 | octreeSize, octreeCenter);
81 | }
82 | data.FillTriangle(triVerts, depth, InternalGenerateAttributes);
83 | }
84 | }
85 |
86 | protected abstract void OnFillSubmesh(int submesh);
87 |
88 | protected abstract Tuple GenerateAttributes(Vector3[] triangleVertices, int[] indices,
89 | Bounds voxelLocalBounds, Bounds voxelMeshBounds, float octreeSize, Vector3 octreeCenter);
90 |
91 | private Bounds FindIdealOctreeBounds()
92 | {
93 | // octreePos = center of mesh bounds aligned to grid of size voxelSize
94 | // Alignment to grid makes it easier to align with other octrees of same voxelSize.
95 | var octreePos = new Vector3();
96 | for(var i = 0; i < 3; i++)
97 | octreePos[i] = Mathf.Round(mesh.bounds.center[i] / voxelSize) * voxelSize;
98 |
99 | // octreeSize = Smallest octree size that still encapsulates entire mesh
100 | var octreeSize = -1f;
101 | for (var i = 0; i < 3; i++)
102 | {
103 | octreeSize = Mathf.Max(octreeSize, Mathf.Abs(mesh.bounds.max[i] - octreePos[i]));
104 | octreeSize = Mathf.Max(octreeSize, Mathf.Abs(mesh.bounds.min[i] - octreePos[i]));
105 | }
106 |
107 | octreeSize *= 2;
108 |
109 | // Make octreeSize the smallest number for which voxelSize * 2^n exists for some natural number n
110 | // Makes sure that a voxel of voxelSize can actually be made.
111 | octreeSize = Mathf.NextPowerOfTwo(Mathf.CeilToInt(octreeSize / voxelSize)) * voxelSize;
112 |
113 | return new Bounds(octreePos, Vector3.one * octreeSize);
114 | }
115 | }
116 | }
117 |
118 | #endif
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctree.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: dce999b0cb6f435c980185bdcf4fc4b7
3 | timeCreated: 1604109913
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctreeEditor.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #if UNITY_EDITOR
20 |
21 | using UnityEditor;
22 | using UnityEngine;
23 |
24 | namespace SVO
25 | {
26 | [CustomEditor(typeof(MeshToOctree), true)]
27 | public class MeshToOctreeEditor: Editor
28 | {
29 | public override void OnInspectorGUI()
30 | {
31 | DrawDefaultInspector();
32 |
33 | if (GUILayout.Button("Generate"))
34 | {
35 | ((MeshToOctree)target).Generate();
36 | }
37 | }
38 | }
39 | }
40 |
41 | #endif
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctreeEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 048ced747f2f488ca2bcf0733424a352
3 | timeCreated: 1604172751
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctreeStandard.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #if UNITY_EDITOR
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using UnityEngine;
24 |
25 | namespace SVO
26 | {
27 | ///
28 | /// Utility class for converting a mesh to an octree: Uses standard attributes given by AttributeEncoder.
29 | ///
30 | public class MeshToOctreeStandard: MeshToOctree
31 | {
32 |
33 | private readonly List _normals = new List();
34 | private readonly List _uvs = new List();
35 | private Texture2D _mainTexture;
36 |
37 | protected override void OnFillSubmesh(int submesh)
38 | {
39 | mesh.GetNormals(_normals);
40 | mesh.GetUVs(0, _uvs);
41 | _mainTexture = (Texture2D) material.mainTexture ?? Texture2D.whiteTexture;
42 | }
43 |
44 | protected override Tuple GenerateAttributes(Vector3[] triangleVertices, int[] indices,
45 | Bounds voxelLocalBounds, Bounds voxelMeshBounds, float octreeSize, Vector3 octreeCenter)
46 | {
47 | var barycentric = OctreeMath.ToBarycentricCoordinates(voxelMeshBounds.center, triangleVertices[0],
48 | triangleVertices[1], triangleVertices[2]);
49 | var interpolatedUV = barycentric.x * _uvs[indices[0]] + barycentric.y * _uvs[indices[1]] + barycentric.z * _uvs[indices[2]];
50 | var interpolatedNormal = barycentric.x * _normals[indices[0]] + barycentric.y * _normals[indices[1]] + barycentric.z * _normals[indices[2]];
51 | interpolatedNormal.Normalize();
52 |
53 | var color = _mainTexture.GetPixelBilinear(interpolatedUV.x, interpolatedUV.y);
54 | return new Tuple(color, AttributeEncoder.EncodeStandardAttributes(interpolatedNormal));
55 | }
56 | }
57 | }
58 |
59 | #endif
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/MeshToOctree/MeshToOctreeStandard.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3f86367b717e425a81a4df8eeca7165b
3 | timeCreated: 1604172902
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Octree.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Linq;
22 | using UnityEngine;
23 | using Object = UnityEngine.Object;
24 |
25 | namespace SVO
26 | {
27 | public class Octree : IDisposable
28 | {
29 | private static Texture3D tempTex = null;
30 |
31 | public Texture3D Data { get; private set; }
32 |
33 | // These lists are effectively unmanaged memory blocks. This allows for a simple transition from CPU to GPU memory,
34 | // and is much easier for the C# gc to deal with.
35 | private List _data = new List(new[] { 1 << 31 });
36 | private readonly HashSet _freeStructureMemory = new HashSet();
37 | private readonly HashSet _freeAttributeMemory = new HashSet();
38 | private ulong[] _updateCount = new ulong[2048];
39 | private ulong[] _lastApply = new ulong[2048];
40 |
41 | private int[] _ptrStack = new int[24];
42 | private Vector3 _ptrStackPos = Vector3.one;
43 | private int _ptrStackDepth;
44 |
45 | public Octree(Texture3D data)
46 | {
47 | for (int i = 0; i < _lastApply.Length; i++)
48 | _lastApply[i] = ulong.MaxValue;
49 | _ptrStack[0] = 0;
50 | Data = data;
51 | }
52 |
53 | public Octree()
54 | {
55 | _ptrStack[0] = 0;
56 | Data = null;
57 | }
58 |
59 | ///
60 | /// Edits the voxel at some position with depth and attributes data.
61 | ///
62 | /// Position of the voxel, with each component in the range [-.5, .5).
63 | /// Depth of the voxel. A depth of n means a voxel of editDepth pow(2f, -n)
64 | /// Color of the voxel. Transparency is currently ignored, unless an alpha value of 0 is
65 | /// provided, in which case the voxel is simply deleted.
66 | /// Shading data for the voxel. Best for properties like normals.
67 | public void SetVoxel(Vector3 position, int depth, Color color, int[] attributes)
68 | {
69 | SetVoxelNormalized(position + new Vector3(1.5f, 1.5f, 1.5f), depth, color, attributes);
70 | }
71 |
72 | ///
73 | /// Edits the voxel at some position with depth and attributes data.
74 | ///
75 | /// Position of the voxel, with each component in the range [1, 2).
76 | /// Depth of the voxel. A depth of n means a voxel of size pow(2f, -n)
77 | /// Color of the voxel
78 | /// Shading data for the voxel. Best for properties like normals.
79 | private void SetVoxelNormalized(Vector3 position, int depth, Color color, int[] attributes)
80 | {
81 | unsafe int AsInt(float f) => *(int*)&f;
82 | int FirstSetHigh(int i) => (AsInt(i) >> 23) - 127;
83 |
84 | position.x = Mathf.Clamp(position.x, 1f, 1.99999988079f);
85 | position.y = Mathf.Clamp(position.y, 1f, 1.99999988079f);
86 | position.z = Mathf.Clamp(position.z, 1f, 1.99999988079f);
87 |
88 | // Create 'internalAttributes' which is the same as attributes
89 | // but with one extra int at the beggining for color and metadata
90 | int[] internalAttributes = null;
91 | if(color.a != 0f)
92 | {
93 | internalAttributes = new int[attributes.Length + 1];
94 | internalAttributes[0] |= attributes.Length + 1 << 24;
95 | internalAttributes[0] |= (int)(color.r * 255) << 16;
96 | internalAttributes[0] |= (int)(color.g * 255) << 8;
97 | internalAttributes[0] |= (int)(color.b * 255) << 0;
98 | for (var i = 0; i < attributes.Length; i++) internalAttributes[i + 1] = attributes[i];
99 | }
100 |
101 | // Attempt to skip initial tree iterations by reusing the position of the last voxel
102 | var differingBits = AsInt(_ptrStackPos.x) ^ AsInt(position.x);
103 | differingBits |= AsInt(_ptrStackPos.y) ^ AsInt(position.y);
104 | differingBits |= AsInt(_ptrStackPos.z) ^ AsInt(position.z);
105 | var firstSet = 23 - FirstSetHigh(differingBits);
106 | var stepDepth = Math.Min(Math.Min(firstSet - 1, _ptrStackDepth), depth);
107 |
108 | var ptr = _ptrStack[stepDepth];
109 | var type = (_data[ptr] >> 31) & 1; // Type of root node
110 | // Step down one depth until a non-ptr node is hit or the desired depth is reached.
111 | while(type == 0 && stepDepth < depth)
112 | {
113 | // Descend to the next branch
114 | ptr = _data[ptr];
115 |
116 | // Step to next node
117 | stepDepth++;
118 | var xm = (AsInt(position.x) >> (23 - stepDepth)) & 1;
119 | var ym = (AsInt(position.y) >> (23 - stepDepth)) & 1;
120 | var zm = (AsInt(position.z) >> (23 - stepDepth)) & 1;
121 | var childIndex = (xm << 2) + (ym << 1) + zm;
122 | ptr += childIndex;
123 | _ptrStack[stepDepth] = ptr;
124 |
125 | // Get type of the node
126 | type = (_data[ptr] >> 31) & 1;
127 | }
128 |
129 | // The new voxels position or desired depth has now been reached
130 | // delete old voxel data
131 | var original = _data[ptr];
132 | int[] originalShadingData;
133 | if (type == 0)
134 | {
135 | FreeBranch(original);
136 | }
137 | if (type == 1 && original != 1 << 31)
138 | {
139 | // Get the attributes data
140 | var attribPtr = original & 0x7FFFFFFF;
141 | var size = (_data[attribPtr] >> 24) & 0xFF;
142 | originalShadingData = new int[size];
143 | for (var i = 0; i < size; i++)
144 | originalShadingData[i] = _data[attribPtr + i];
145 | FreeAttributes(attribPtr);
146 | }
147 | else originalShadingData = null;
148 |
149 | while (stepDepth < depth)
150 | {
151 | stepDepth++;
152 |
153 | // Calculate index of next node
154 | var xm = (AsInt(position.x) >> (23 - stepDepth)) & 1;
155 | var ym = (AsInt(position.y) >> (23 - stepDepth)) & 1;
156 | var zm = (AsInt(position.z) >> (23 - stepDepth)) & 1;
157 | var childIndex = (xm << 2) + (ym << 1) + zm;
158 |
159 | // Create another branch to go down another depth
160 | // The last hit voxel MUST be type 1 (Voxel). Otherwise stepDepth == depth.
161 | var defaultData = new int[8];
162 | for (var i = 0; i < 8; i++)
163 | if (i == childIndex)
164 | defaultData[i] = 1 << 31; // Placeholder
165 | else
166 | defaultData[i] = (1 << 31) | AllocateAttributeData(originalShadingData);
167 | var branchPtr = AllocateBranch(defaultData);
168 | _data[ptr] = branchPtr;
169 | RecordUpdate(ptr);
170 | ptr = branchPtr + childIndex;
171 | _ptrStack[stepDepth] = ptr;
172 | }
173 | _data[ptr] = (1 << 31) | AllocateAttributeData(internalAttributes);
174 | RecordUpdate(ptr);
175 |
176 | _ptrStackDepth = stepDepth;
177 | _ptrStackPos = position;
178 | }
179 |
180 | public void FillTriangle(Vector3[] vertices, int depth, Func> attributeGenerator)
181 | {
182 | void FillRecursively(int currentDepth, Bounds bounds)
183 | {
184 | if (TriBoxOverlap.IsIntersecting(bounds, vertices))
185 | {
186 | if (depth == currentDepth)
187 | {
188 | var (color, attributes) = attributeGenerator(bounds);
189 | SetVoxel(bounds.min, depth, color, attributes);
190 | }
191 | else for (var i = 0; i < 8; i++) // Call recursively for children.
192 | {
193 | var nextCenter = 0.5f * bounds.extents + bounds.min;
194 | if ((i & 4) > 0) nextCenter.x += bounds.extents.x;
195 | if ((i & 2) > 0) nextCenter.y += bounds.extents.y;
196 | if ((i & 1) > 0) nextCenter.z += bounds.extents.z;
197 | FillRecursively(currentDepth + 1, new Bounds(nextCenter, bounds.extents));
198 | }
199 | }
200 | }
201 |
202 | FillRecursively(0, new Bounds(Vector3.zero, Vector3.one));
203 | }
204 |
205 | public bool CastRay(
206 | Ray world_ray,
207 | Transform octreeTransform,
208 | out RayHit hit)
209 | {
210 | hit = new RayHit();
211 |
212 | unsafe int AsInt(float f) => *(int*)&f;
213 | unsafe float AsFloat(int value) => *(float*)&value;
214 | int FirstSetHigh(int value) => (AsInt(value) >> 23) - 127;
215 | int GetType(int value) => (value >> 31) & 1;
216 | Vector3 VecMul(Vector3 a, Vector3 b) => new Vector3(a.x * b.x, a.y * b.y, a.z * b.z);
217 | Vector3 VecClamp(Vector3 a, float min, float max) =>
218 | new Vector3(Mathf.Clamp(a.x, min, max),
219 | Mathf.Clamp(a.y, min, max),
220 | Mathf.Clamp(a.z, min, max));
221 |
222 | var ray_dir = (Vector3)(octreeTransform.worldToLocalMatrix * new Vector4(world_ray.direction.x, world_ray.direction.y, world_ray.direction.z, 0));
223 | var ray_origin = (Vector3)(octreeTransform.worldToLocalMatrix * new Vector4(world_ray.origin.x, world_ray.origin.y, world_ray.origin.z, 1));
224 | // Calculations assume octree voxels are in [1, 2) but object is in [-.5, .5]. This corrects that.
225 | ray_origin += new Vector3(1.5f, 1.5f, 1.5f);
226 |
227 | const int max_depth = 23;
228 | const float epsilon = 0.00000011920928955078125f;
229 | // Mirror coordinate system such that all ray direction components are negative.
230 | int sign_mask = 0;
231 | if(ray_dir.x > 0f)
232 | {
233 | sign_mask ^= 4;
234 | ray_origin.x = 3f - ray_origin.x;
235 | }
236 | if(ray_dir.y > 0f)
237 | {
238 | sign_mask ^= 2;
239 | ray_origin.y = 3f - ray_origin.y;
240 | }
241 | if(ray_dir.z > 0f)
242 | {
243 | sign_mask ^= 1;
244 | ray_origin.z = 3f - ray_origin.z;
245 | }
246 |
247 | ray_dir = -new Vector3(Mathf.Abs(ray_dir.x), Mathf.Abs(ray_dir.y), Mathf.Abs(ray_dir.z));
248 | var ray_inv_dir = -new Vector3(Mathf.Abs(1 / ray_dir.x), Mathf.Abs(1 / ray_dir.y), Mathf.Abs(1 / ray_dir.z));
249 |
250 | // Get intersections of octree (if hit)
251 | var root_min_distances = VecMul(Vector3.one * 2f - ray_origin, ray_inv_dir);
252 | var root_max_distances = VecMul(Vector3.one - ray_origin, ray_inv_dir);
253 | var root_tmin = Mathf.Max(Mathf.Max(Mathf.Max(root_min_distances.x, root_min_distances.y), root_min_distances.z), 0);
254 | var root_tmax = Mathf.Min(Mathf.Min(root_max_distances.x, root_max_distances.y), root_max_distances.z);
255 |
256 | if(root_tmax < 0 || root_tmin >= root_tmax) return false;
257 | if(root_tmin == root_min_distances.x)
258 | {
259 | hit.faceNormal = new Vector3(1, 0, 0);
260 | if((sign_mask >> 2) != 0)
261 | hit.faceNormal.x = -hit.faceNormal.x;
262 | }
263 | else if(root_tmin == root_min_distances.y)
264 | {
265 | hit.faceNormal = new Vector3(0, 1, 0);
266 | if((sign_mask >> 1 & 1) != 0)
267 | hit.faceNormal.y = -hit.faceNormal.y;
268 | }
269 | else
270 | {
271 | hit.faceNormal = new Vector3(0, 0, 1);
272 | if((sign_mask & 1) != 0)
273 | hit.faceNormal.z = -hit.faceNormal.z;
274 | }
275 |
276 | Vector3 next_path = VecClamp(ray_origin + ray_dir * root_tmin, 1f, AsFloat(0x3fffffff));
277 |
278 | var stack = new int[max_depth + 1];
279 | stack[0] = 0;
280 | var stack_depth = 0;
281 | Vector3 stack_path = new Vector3(1, 1, 1);
282 |
283 | int i = 0;
284 | do
285 | {
286 | i++;
287 | // Get voxel at targetPos
288 | var differing_bits = AsInt(stack_path.x) ^ AsInt(next_path.x);
289 | differing_bits |= AsInt(stack_path.y) ^ AsInt(next_path.y);
290 | differing_bits |= AsInt(stack_path.z) ^ AsInt(next_path.z);
291 | var first_set = 23 - FirstSetHigh(differing_bits);
292 | var depth = Mathf.Min(first_set - 1, stack_depth);
293 | var ptr = stack[depth];
294 | int data = _data[ptr];
295 | int type = GetType(data);
296 | while(type == 0)
297 | {
298 | ptr = data;
299 | depth++;
300 | int xm = (AsInt(next_path.x) >> (23 - depth)) & 1; // 1 or 0 for sign of movement in x direction
301 | int ym = (AsInt(next_path.y) >> (23 - depth)) & 1; // 1 or 0 for sign of movement in y direction
302 | int zm = (AsInt(next_path.z) >> (23 - depth)) & 1; // 1 or 0 for sign of movement in z direction
303 | int child_index = (xm << 2) + (ym << 1) + zm;
304 | child_index ^= sign_mask;
305 | ptr += child_index;
306 | stack[depth] = ptr;
307 | data = _data[ptr]; // Follow ptr
308 | type = GetType(data);
309 | }
310 | stack_depth = depth;
311 | stack_path = new Vector3(
312 | AsFloat(AsInt(next_path.x) & ~((1 << 23 - depth) - 1)),
313 | AsFloat(AsInt(next_path.y) & ~((1 << 23 - depth) - 1)),
314 | AsFloat(AsInt(next_path.z) & ~((1 << 23 - depth) - 1))
315 | ); // Remove unused bits
316 |
317 | // Return hit if voxel is solid
318 | if(type == 1 && data != (1 << 31))
319 | {
320 | int attributes_head_ptr = data & ~(1 << 31);
321 |
322 | int color_data = _data[attributes_head_ptr];
323 | hit.attributesPtr = attributes_head_ptr + 1;
324 | hit.color = new Vector4((color_data >> 16 & 0xFF) / 255f, (color_data >> 8 & 0xFF) / 255f, (color_data & 0xFF) / 255f, (color_data >> 24 & 0xFF) / 255f);
325 |
326 | // Undo coordinate mirroring in next_path
327 | Vector3 mirrored_path = next_path;
328 | hit.voxelObjSize = AsFloat((0b01111111 - depth) << 23); // exp2(-depth)
329 | if(sign_mask >> 2 != 0)
330 | {
331 | hit.faceNormal.x = -hit.faceNormal.x;
332 | mirrored_path.x = 3f - next_path.x;
333 | }
334 | if((sign_mask >> 1 & 1) != 0)
335 | {
336 | hit.faceNormal.y = -hit.faceNormal.y;
337 | mirrored_path.y = 3f - next_path.y;
338 | }
339 | if((sign_mask & 1) != 0)
340 | {
341 | hit.faceNormal.z = -hit.faceNormal.z;
342 | mirrored_path.z = 3f - next_path.z;
343 | }
344 | hit.voxelObjPos -= Vector3.one * 1.5f;
345 | hit.objPos = mirrored_path - Vector3.one * 1.5f;
346 | hit.voxelObjPos = new Vector3(
347 | AsFloat(AsInt(mirrored_path.x) & ~((1 << 23 - depth) - 1)) - 1.5f,
348 | AsFloat(AsInt(mirrored_path.y) & ~((1 << 23 - depth) - 1)) - 1.5f,
349 | AsFloat(AsInt(mirrored_path.z) & ~((1 << 23 - depth) - 1)) - 1.5f
350 | );
351 | hit.worldPos = octreeTransform.localToWorldMatrix * new Vector4(hit.objPos.x, hit.objPos.y, hit.objPos.z, 1f);
352 |
353 | return true;
354 | }
355 |
356 | // Step to the next voxel by moving along the normal on the far side of the voxel that was hit.
357 | var t_max = VecMul((stack_path - ray_origin), ray_inv_dir);
358 | var min_t_max = Mathf.Min(Mathf.Min(t_max.x, t_max.y), t_max.z);
359 | var cmax = new Vector3(
360 | AsFloat(AsInt(stack_path.x) + (1 << 23 - depth) - 1),
361 | AsFloat(AsInt(stack_path.y) + (1 << 23 - depth) - 1),
362 | AsFloat(AsInt(stack_path.z) + (1 << 23 - depth) - 1)
363 | );
364 | next_path = new Vector3(
365 | Mathf.Clamp(ray_origin.x + ray_dir.x * min_t_max, stack_path.x, cmax.x),
366 | Mathf.Clamp(ray_origin.y + ray_dir.y * min_t_max, stack_path.y, cmax.y),
367 | Mathf.Clamp(ray_origin.z + ray_dir.z * min_t_max, stack_path.z, cmax.z)
368 | );
369 |
370 | if(t_max.x == min_t_max)
371 | {
372 | hit.faceNormal = new Vector3(1, 0, 0);
373 | next_path.x = stack_path.x - epsilon;
374 | }
375 | else if(t_max.y == min_t_max)
376 | {
377 | hit.faceNormal = new Vector3(0, 1, 0);
378 | next_path.y = stack_path.y - epsilon;
379 | }
380 | else
381 | {
382 | hit.faceNormal = new Vector3(0, 0, 1);
383 | next_path.z = stack_path.z - epsilon;
384 | }
385 | }
386 | while((AsInt(next_path.x) & 0xFF800000) == 0x3f800000 &&
387 | (AsInt(next_path.y) & 0xFF800000) == 0x3f800000 &&
388 | (AsInt(next_path.z) & 0xFF800000) == 0x3f800000 &&
389 | i <= 250); // Same as 1 <= next_path < 2 && i <= 250
390 |
391 | return false;
392 | }
393 |
394 | private void FreeBranch(int ptr)
395 | {
396 | _freeStructureMemory.Add(ptr);
397 | for (var i = 0; i < 8; i++)
398 | {
399 | var optr = ptr + i;
400 | var type = (_data[optr] >> 31) & 1;
401 | if(type == 0)
402 | FreeBranch(_data[optr]);
403 | else if(_data[optr] != 1 << 31)
404 | FreeAttributes(_data[optr] & 0x7FFFFFFF);
405 | }
406 | }
407 |
408 | private void FreeAttributes(int ptr)
409 | {
410 | _freeAttributeMemory.Add(ptr);
411 | }
412 |
413 | private int AllocateBranch(IReadOnlyList ptrs)
414 | {
415 | int ptr;
416 | if (_freeStructureMemory.Count == 0)
417 | {
418 | ptr = _data.Count;
419 | _data.AddRange(ptrs);
420 | }
421 | else
422 | {
423 | ptr = _freeStructureMemory.Last();
424 | for (var i = 0; i < ptrs.Count; i++)
425 | _data[i + ptr] = ptrs[i];
426 | _freeStructureMemory.Remove(ptr);
427 | }
428 | // Only need to record update twice because branch can only be in 2 slices at most
429 | RecordUpdate(ptr);
430 | RecordUpdate(ptr + 7);
431 | return ptr;
432 | }
433 |
434 | private int AllocateAttributeData(IReadOnlyList attributes)
435 | {
436 | if (attributes == null) return 0;
437 | var index = 0;
438 | foreach (var ptr in _freeAttributeMemory)
439 | {
440 | var size = (uint)_data[ptr] >> 24;
441 | if (size != attributes.Count)
442 | {
443 | index++;
444 | continue;
445 | }
446 |
447 | for (var i = 0; i < attributes.Count; i++)
448 | {
449 | _data[ptr + i] = attributes[i];
450 | }
451 | if (attributes.Count > 256 * 256) throw new ArgumentException("Too many attributes. Max number is 65536 per voxel.");
452 | // Assume attributes.Count is less than the size of one slice.
453 | RecordUpdate(ptr);
454 | RecordUpdate(ptr + attributes.Count - 1);
455 | _freeAttributeMemory.Remove(ptr);
456 | return ptr;
457 | }
458 |
459 | var endPtr = _data.Count;
460 | _data.AddRange(attributes);
461 | RecordUpdate(endPtr);
462 | RecordUpdate(endPtr + attributes.Count - 1);
463 | return endPtr;
464 | }
465 |
466 | ///
467 | /// Creates a texture to contain this octree.
468 | ///
469 | /// Attempt to reuse the previous texture. This can be faster, but the old texture will no longer be usable.
470 | /// A new texture containing the updated Octree.
471 | public Texture3D Apply(bool tryReuseOldTexture=true)
472 | {
473 | if (tempTex is null)
474 | tempTex = new Texture3D(256, 256, 1, TextureFormat.RFloat, false);
475 |
476 | var depth = Mathf.NextPowerOfTwo(Mathf.CeilToInt((float) _data.Count / 256 / 256));
477 | if (Data is null || depth != Data.depth || !tryReuseOldTexture)
478 | {
479 | Object.Destroy(Data);
480 | Data = new Texture3D(256, 256, depth, TextureFormat.RFloat, false);
481 | for (int i = 0; i < _lastApply.Length; i++)
482 | _lastApply[i] = ulong.MaxValue;
483 | }
484 |
485 | uint updated = 0;
486 | for (var i = 0; i < depth; i++)
487 | {
488 | if (_lastApply[i] == _updateCount[i])
489 | continue;
490 |
491 | updated++;
492 | _lastApply[i] = _updateCount[i];
493 |
494 | var minIndex = i * 256 * 256;
495 | var maxIndex = (i + 1) * 256 * 256;
496 | if (minIndex > _data.Count) minIndex = _data.Count;
497 | if (maxIndex > _data.Count) maxIndex = _data.Count;
498 |
499 | if (minIndex >= maxIndex) break;
500 | var block = new int[256 * 256];
501 | _data.CopyTo(minIndex, block, 0, maxIndex - minIndex);
502 | tempTex.SetPixelData(block, 0);
503 | tempTex.Apply();
504 | Graphics.CopyTexture(tempTex, 0, 0, 0, 0, 256, 256, Data, i, 0, 0, 0);
505 |
506 | }
507 |
508 | if (updated != 0)
509 | {
510 | Data.IncrementUpdateCount();
511 | }
512 | return Data;
513 | }
514 |
515 | ///
516 | /// Rebuilds the internal structure of the octree. This makes the octree memory continuous, lowering memory
517 | /// overhead and potentially increasing performance.
518 | ///
519 | /// For smaller octrees it runs almost instantly but can take several seconds for more detailed octrees.
520 | ///
521 | public void Rebuild()
522 | {
523 | var capacity = Mathf.NextPowerOfTwo(_data.Count - _freeStructureMemory.Count * 8 - _freeAttributeMemory.Count);
524 | var optimizedData = new List(capacity);
525 |
526 | void RebuildBranch(int referenceBranchPtr)
527 | {
528 | var start = optimizedData.Count;
529 | optimizedData.AddRange(new int[8]);
530 | for (var i = 0; i < 8; i++)
531 | {
532 | if (_data[referenceBranchPtr + i] == 1 << 31)
533 | {
534 | optimizedData[start + i] = 1 << 31;
535 | }
536 | else if ((_data[referenceBranchPtr + i] >> 31 & 1) == 1)
537 | {
538 | optimizedData[start + i] = 1 << 31 | optimizedData.Count;
539 | var attribPtr = _data[referenceBranchPtr + i] & 0x7FFFFFFF;
540 | var c = (_data[attribPtr] >> 24) & 0xFF;
541 | for(var j = 0; j < c; j++)
542 | optimizedData.Add(_data[attribPtr + j]);
543 | }
544 | else
545 | {
546 | optimizedData[start + i] = optimizedData.Count;
547 | RebuildBranch(_data[referenceBranchPtr + i]);
548 | }
549 | }
550 | }
551 |
552 | if (_data[0] == 1 << 31)
553 | {
554 | optimizedData.Add(1 << 31);
555 | }
556 | else if ((_data[0] >> 31 & 1) == 1)
557 | {
558 | optimizedData.Add(1 << 31 | (optimizedData.Count + 1));
559 | var attribPtr = _data[0] & 0x7FFFFFFF;
560 | var c = (_data[attribPtr] >> 24) & 0xFF;
561 | for(var j = 0; j < c; j++)
562 | optimizedData.Add(_data[attribPtr + j]);
563 | }
564 | else
565 | {
566 | optimizedData.Add(optimizedData.Count + 1);
567 | RebuildBranch(_data[0]);
568 | }
569 |
570 | _data = optimizedData;
571 | _ptrStackDepth = 0;
572 | _ptrStackPos = Vector3.one;
573 | _ptrStack = new int[24];
574 | _freeAttributeMemory.Clear();
575 | _freeStructureMemory.Clear();
576 | _lastApply = new ulong[2048];
577 | for (var i = 0; i < _lastApply.Length; i++)
578 | _lastApply[i] = ulong.MaxValue;
579 | }
580 |
581 | private void RecordUpdate(int idx)
582 | {
583 | _updateCount[idx >> 16]++;
584 | }
585 |
586 | public void Dispose()
587 | {
588 | Object.Destroy(Data);
589 | }
590 | }
591 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Octree.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 08ab78164bfc45c6b33c8e2fb412a0f2
3 | timeCreated: 1598449629
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/RayHit.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using UnityEngine;
20 |
21 | namespace SVO
22 | {
23 | public struct RayHit
24 | {
25 | public Color color;
26 | public Vector3 voxelObjPos;
27 | public float voxelObjSize;
28 | public Vector3 objPos;
29 | public Vector3 worldPos;
30 | public int attributesPtr;
31 | public Vector3 faceNormal;
32 | }
33 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/RayHit.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4be5e994ef994ccf97de3fd389ab6f78
3 | timeCreated: 1599173624
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4b2ff9f679754a7b98cd4e583d6476f9
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/GeometryRayCast.hlsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #define POINTER_TYPE 0
20 | #define VOXEL_TYPE 1
21 |
22 | #define GET_TYPE(structure_data) (structure_data >> 31 & 1)
23 | #define GET_ATTRIBUTES_HEAD_PTR(structure_data) (structure_data & 0x7FFFFFFF)
24 | #define IS_EMPTY_VOXEL(structure_data) (structure_data == (1 << 31))
25 |
26 | #include "Util.hlsl"
27 |
28 | int sample_data(Texture3D tex, uint idx)
29 | {
30 | uint z = idx >> 16;
31 | uint y = idx >> 8 & 0xFF;
32 | uint x = idx & 0xFF;
33 | return tex[uint3(x, y, z)];
34 | }
35 |
36 | /* Casts a ray into an octree.
37 | * If a voxel is hit, will return true and output variables will be set.
38 | * otherwise, false will be returned and output variables will be undefined.
39 | *
40 | * All inputs and outputs are in object space.
41 | *
42 | * Note: ray.direction does not have to be normalized.
43 | */
44 | bool cast_ray(ray ray,
45 | Texture3D volume,
46 | out float4 color,
47 | out float3 hit_voxel_pos,
48 | out float hit_voxel_size,
49 | out float3 hit_pos,
50 | out int attributes_ptr,
51 | out float3 face_normal,
52 | out int loops)
53 | {
54 | // Calculations assume octree is in [1, 2) but object is in [-.5, .5]. This corrects that.
55 | ray.origin += 1.5;
56 |
57 | static const int max_depth = 23;
58 | static const float epsilon = exp2(-max_depth);
59 |
60 | // Mirror coordinate system such that all ray direction components are negative.
61 | int sign_mask = 0;
62 | if(ray.dir.x > 0.f) sign_mask ^= 4, ray.origin.x = 3.f - ray.origin.x;
63 | if(ray.dir.y > 0.f) sign_mask ^= 2, ray.origin.y = 3.f - ray.origin.y;
64 | if(ray.dir.z > 0.f) sign_mask ^= 1, ray.origin.z = 3.f - ray.origin.z;
65 |
66 | ray.dir = -abs(ray.dir);
67 | ray.inv_dir = -abs(1 / ray.dir);
68 |
69 | // Get intersections of octree. Near distance >= far distance when not hit.
70 | const float3 root_near_plane_distances = (2.f - ray.origin) * ray.inv_dir;
71 | const float root_near_distance = max(max(max(root_near_plane_distances.x, root_near_plane_distances.y), root_near_plane_distances.z), 0);
72 |
73 | // We can assume the octree is hit, because otherwise the fragment shader would never be called.
74 | // const float3 root_far_plane_distances = (1.f - ray.origin) * ray.inv_dir;
75 | // const float root_far_distance = min(min(root_far_plane_distances.x, root_far_plane_distances.y), root_far_plane_distances.z);
76 | // if(root_far_distance < 0 || root_near_distance >= root_far_distance) return false;
77 |
78 | // Get the face of the octree we initially move through
79 | // TODO: Figure out why the sign mask has to be checked here, should be done once a voxel is hit,
80 | // but that only seems to work on voxel with depth > 0
81 | if(root_near_distance == root_near_plane_distances.x)
82 | {
83 | face_normal = float3(1, 0, 0);
84 | if(sign_mask >> 2 != 0)
85 | face_normal.x = -face_normal.x;
86 | }
87 | else if(root_near_distance == root_near_plane_distances.y)
88 | {
89 | face_normal = float3(0, 1, 0);
90 | if(sign_mask >> 1 & 1 != 0)
91 | face_normal.y = -face_normal.y;
92 | }
93 | else
94 | {
95 | face_normal = float3(0, 0, 1);
96 | if(sign_mask & 1 != 0)
97 | face_normal.z = -face_normal.z;
98 | }
99 |
100 | // Path of next voxel to move to
101 | float3 next_path = clamp(ray.origin + ray.dir * root_near_distance, 1.f, asfloat(0x3fffffff));
102 |
103 | int stack[max_depth + 1];
104 | stack[0] = 0;
105 | int stack_depth = 0;
106 | float3 stack_path = float3(1, 1, 1);
107 | loops = 0;
108 | do
109 | {
110 | loops++;
111 |
112 | // Recall deepest shared branch
113 | int differing_bits = asint(stack_path.x) ^ asint(next_path.x);
114 | differing_bits |= asint(stack_path.y) ^ asint(next_path.y);
115 | differing_bits |= asint(stack_path.z) ^ asint(next_path.z);
116 | const int first_set = 23 - firstbithigh(differing_bits);
117 | int depth = min(first_set - 1, stack_depth);
118 | int ptr = stack[depth];
119 |
120 | // Step down to next voxel
121 | int data = sample_data(volume, ptr);
122 | int type = GET_TYPE(data);
123 | while(type == POINTER_TYPE)
124 | {
125 | ptr = data;
126 | depth++;
127 | const int xm = (asint(next_path.x) >> 23 - depth) & 1; // 1 or 0 for sign of movement in x direction
128 | const int ym = (asint(next_path.y) >> 23 - depth) & 1; // 1 or 0 for sign of movement in y direction
129 | const int zm = (asint(next_path.z) >> 23 - depth) & 1; // 1 or 0 for sign of movement in z direction
130 | int child_index = (xm << 2) + (ym << 1) + zm;
131 | child_index ^= sign_mask;
132 | ptr += child_index;
133 | stack[depth] = ptr;
134 | data = sample_data(volume, ptr); // Follow ptr
135 | type = GET_TYPE(data);
136 | }
137 | stack_depth = depth;
138 | stack_path = asfloat(asint(next_path) & ~((1 << 23 - depth) - 1)); // Remove unused bits
139 |
140 | // Return hit if voxel is solid
141 | if(type == VOXEL_TYPE && !IS_EMPTY_VOXEL(data))
142 | {
143 | const int attributes_head_ptr = GET_ATTRIBUTES_HEAD_PTR(data);
144 |
145 | const int color_data = sample_data(volume, attributes_head_ptr);
146 | attributes_ptr = attributes_head_ptr + 1;
147 | color = float4((color_data >> 16 & 0xFF) / 255.f, (color_data >> 8 & 0xFF) / 255.f, (color_data & 0xFF) / 255.f, (color_data >> 24 & 0xFF) / 255.f);
148 |
149 | // Undo coordinate mirroring
150 | float3 mirrored_path = next_path;
151 | hit_voxel_size = exp2(-depth);
152 | if(sign_mask >> 2 != 0)
153 | {
154 | face_normal.x = -face_normal.x;
155 | mirrored_path.x = 3.f - next_path.x;
156 | }
157 | if(sign_mask >> 1 & 1 != 0)
158 | {
159 | face_normal.y = -face_normal.y;
160 | mirrored_path.y = 3.f - next_path.y;
161 | }
162 | if(sign_mask & 1 != 0)
163 | {
164 | face_normal.z = -face_normal.z;
165 | mirrored_path.z = 3.f - next_path.z;
166 | }
167 | hit_pos = mirrored_path - 1.5f;
168 | hit_voxel_pos = asfloat(asint(mirrored_path) & ~((1 << 23 - depth) - 1)) - 1.5f;
169 |
170 | return true;
171 | }
172 |
173 | // Step to the next voxel by moving along the normal on the far side of the voxel that was hit.
174 | const float3 t_max = (stack_path - ray.origin) * ray.inv_dir;
175 | const float min_t_max = min(t_max);
176 | next_path = clamp(ray.origin + ray.dir * min_t_max, stack_path, asfloat(asint(stack_path) + (1 << 23 - depth) - 1));
177 |
178 | // Update next path to adjacent voxel and set face normal
179 | if(t_max.x == min_t_max)
180 | {
181 | face_normal = float3(1, 0, 0);
182 | next_path.x = stack_path.x - epsilon;
183 | }
184 | else if(t_max.y == min_t_max)
185 | {
186 | face_normal = float3(0, 1, 0);
187 | next_path.y = stack_path.y - epsilon;
188 | }
189 | else
190 | {
191 | face_normal = float3(0, 0, 1);
192 | next_path.z = stack_path.z - epsilon;
193 | }
194 | }
195 | while(all(next_path >= 1 && next_path < 2) &&
196 | loops <= 1000);
197 |
198 | return false;
199 | }
200 |
201 | float3 decode_normal(int encoded_normal)
202 | {
203 | const int sign_bit = encoded_normal >> 22 & 1;
204 | const int axis = encoded_normal >> 20 & 3;
205 | const int comp2 = encoded_normal >> 10 & 0x3FF;
206 | const int comp1 = encoded_normal & 0x3FF;
207 |
208 | float3 normal = float3(0, 0, 0);
209 | switch(axis)
210 | {
211 | case 0:
212 | normal.x = sign_bit * 2.f - 1;
213 | normal.y = comp2 / 1023.f * 2.f - 1;
214 | normal.z = comp1 / 1023.f * 2.f - 1;
215 | break;
216 | case 1:
217 | normal.x = comp2 / 1023.f * 2.f - 1;
218 | normal.y = sign_bit * 2.f - 1;
219 | normal.z = comp1 / 1023.f * 2.f - 1;
220 | break;
221 | case 2:
222 | normal.x = comp2 / 1023.f * 2.f - 1;
223 | normal.y = comp1 / 1023.f * 2.f - 1;
224 | normal.z = sign_bit * 2.f - 1;
225 | break;
226 | default: break; // normal has invalid axis
227 | }
228 | normal = normalize(normal);
229 | return normal;
230 | }
231 |
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/GeometryRayCast.hlsl.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bc700630ae5a419c82dda797903e0078
3 | timeCreated: 1598029946
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/OctreeBase.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | Shader "Octree/OctreeBase"
20 | {
21 | Properties
22 | {
23 | _Shininess ("Shininess", Range(0, 1))=1
24 | [MainTexture] [NoScaleOffset] _Volume ("OctreeVolume", 3D) = "" {}
25 | }
26 | SubShader
27 | {
28 | Tags { "Queue"="AlphaTest" }
29 |
30 | Cull Front
31 |
32 | Pass
33 | {
34 | Tags {
35 | "RenderType"="AlphaTest"
36 | }
37 |
38 | ZWrite On
39 |
40 | HLSLPROGRAM
41 |
42 | #include "UnityCG.cginc"
43 | #include "GeometryRayCast.hlsl"
44 | #include "AutoLight.cginc"
45 |
46 | #pragma vertex vert
47 | #pragma fragment frag
48 |
49 | uniform Texture2D hit_pos;
50 |
51 | float _Shininess;
52 | Texture3D _Volume;
53 | sampler2D _CameraDepthTexture;
54 |
55 | struct v2f
56 | {
57 | float4 pos : SV_POSITION;
58 | float3 world_pos : TEXCOORD0;
59 | float4 screen_pos : TEXCOORD1;
60 | float3 ray_origin : TEXCOORD2;
61 | float3 ray_direction : TEXCOORD3;
62 | };
63 |
64 | struct frag_out
65 | {
66 | half4 color : SV_Target0;
67 | float depth : SV_Depth;
68 | };
69 |
70 | v2f vert(appdata_base v)
71 | {
72 | v2f o;
73 | o.world_pos = mul(unity_ObjectToWorld, v.vertex).xyz;
74 | o.pos = mul(unity_MatrixVP, float4(o.world_pos, 1));
75 | o.screen_pos = ComputeScreenPos(o.pos);
76 | if(UNITY_MATRIX_P[3][3] == 1.f)
77 | {
78 | const float3 cam_dir = unity_CameraToWorld._m02_m12_m22;
79 | const float3 obj_scale = unity_ObjectToWorld._m00_m11_m22;
80 | o.ray_direction = mul(unity_WorldToObject, float4(cam_dir, 0));
81 | o.ray_origin = v.vertex - o.ray_direction * 2 * max(obj_scale);
82 | }
83 | else
84 | {
85 | o.ray_origin = mul(unity_WorldToObject, _WorldSpaceCameraPos);
86 | o.ray_direction = v.vertex - o.ray_origin;
87 | }
88 |
89 | return o;
90 | }
91 |
92 | frag_out frag(v2f i)
93 | {
94 | frag_out o;
95 |
96 | int x, y, z;
97 | _Volume.GetDimensions(x, y, z);
98 | if(x != 256 || y != 256)
99 | {
100 | // Invalid volume
101 | clip(-1);
102 | return o;
103 | }
104 |
105 | //const float2 frag_pos = i.screen_pos.xy / i.screen_pos.w;
106 | //float real_depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, frag_pos);
107 | //real_depth = Linear01Depth(real_depth) * (_ProjectionParams.z - _ProjectionParams.y) + _ProjectionParams.y;
108 |
109 | ray ray;
110 | ray.dir = i.ray_direction;
111 | ray.origin = i.ray_origin;
112 | // Not necessary. Will be overriden during raycast anyways.
113 | // ray.inv_dir = 1 / ray.dir
114 |
115 | float4 color;
116 | float3 voxel_obj_pos;
117 | float voxel_size;
118 | float3 hit_obj_pos;
119 | int attributes_ptr;
120 | float3 face_normal;
121 | int loops;
122 | if(cast_ray(ray, _Volume, color, voxel_obj_pos, voxel_size,
123 | hit_obj_pos, attributes_ptr, face_normal, loops))
124 | {
125 | // BEGIN LIGHTING CODE
126 | const float3 hit_world_pos = mul(unity_ObjectToWorld, hit_obj_pos);
127 | float3 normal = face_normal;
128 | normal = UnityObjectToWorldNormal(normal);
129 | const half light0_strength = max(0.25, dot(normal, _WorldSpaceLightPos0.xyz));
130 |
131 | const float3 world_view_dir = normalize(UnityWorldSpaceViewDir(hit_world_pos));
132 | const float3 world_refl = reflect(-world_view_dir, normal);
133 | const half3 spec = float3(1.f, 1.f, 1.f) * _Shininess * pow(max(0, dot(world_refl, _WorldSpaceLightPos0.xyz)), 32);
134 |
135 | o.color = color * light0_strength;
136 | o.color.rgb += ShadeSH3Order(half4(normal, 1));
137 | o.color.rgb += spec;
138 | // END LIGHTING CODE
139 |
140 | const float4 clip_pos = UnityWorldToClipPos(hit_world_pos);
141 | o.depth = clip_pos.z / clip_pos.w;
142 | #if defined(SHADER_API_GLCORE) || defined(SHADER_API_OPENGL) || \
143 | defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
144 | o.depth = (o.depth + 1.0) * 0.5;
145 | #endif
146 |
147 | return o;
148 | }
149 | clip(-1.f);
150 | return o;
151 | }
152 |
153 |
154 | ENDHLSL
155 | }
156 |
157 | Pass
158 | {
159 | Tags {
160 | "LightMode" = "ShadowCaster"
161 | }
162 | CGPROGRAM
163 |
164 | #include "AutoLight.cginc"
165 | #include "UnityCG.cginc"
166 | #include "GeometryRayCast.hlsl"
167 |
168 | float _Shininess;
169 | Texture3D _Volume;
170 | sampler2D _CameraDepthTexture;
171 |
172 | struct appdata
173 | {
174 | float4 vertex : POSITION;
175 | float3 normal : NORMAL;
176 | float2 uv : TEXCOORD0;
177 | };
178 |
179 | struct v2f
180 | {
181 | V2F_SHADOW_CASTER;
182 | float3 world_pos : TEXCOORD0;
183 | float4 screen_pos : TEXCOORD1;
184 | float3 ray_origin : TEXCOORD2;
185 | float3 ray_direction : TEXCOORD3;
186 | };
187 |
188 | v2f Vert(appdata v)
189 | {
190 | v2f o;
191 | o.world_pos = mul(unity_ObjectToWorld, v.vertex).xyz;
192 |
193 | o.pos = UnityObjectToClipPos(v.vertex);
194 | #ifdef DISABLE_VIEW_CULLING
195 | o.pos.z = 1;
196 | #endif
197 |
198 | o.screen_pos = ComputeScreenPos(o.pos);
199 | if(UNITY_MATRIX_P[3][3] == 1.f)
200 | {
201 | const float3 cam_dir = unity_CameraToWorld._m02_m12_m22;
202 | const float3 obj_scale = unity_ObjectToWorld._m00_m11_m22;
203 | o.ray_direction = mul(unity_WorldToObject, float4(cam_dir, 0));
204 | o.ray_origin = v.vertex - o.ray_direction * 2 * max(obj_scale);
205 | }
206 | else
207 | {
208 | o.ray_origin = mul(unity_WorldToObject, _WorldSpaceCameraPos);
209 | o.ray_direction = v.vertex - o.ray_origin;
210 | }
211 |
212 | return o;
213 | }
214 |
215 | float4 Frag(v2f i) : SV_Target
216 | {
217 | ray r;
218 | r.dir = i.ray_direction;
219 | r.origin = i.ray_origin;
220 |
221 | float4 color;
222 | float3 voxel_obj_pos;
223 | float voxel_size;
224 | float3 hit_obj_pos;
225 | int attributes_ptr;
226 | float3 face_normal;
227 | int loops;
228 | if(cast_ray(r, _Volume, color, voxel_obj_pos, voxel_size,
229 | hit_obj_pos, attributes_ptr, face_normal, loops))
230 | discard;
231 | SHADOW_CASTER_FRAGMENT(i);
232 | }
233 |
234 | ENDCG
235 | }
236 | }
237 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/OctreeBase.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1d83b7f417db45379038f53f5ab515b0
3 | timeCreated: 1625534915
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/Util.hlsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | struct aabb
20 | {
21 | float3 center;
22 | float radius;
23 | float inv_radius;
24 | };
25 |
26 | struct ray
27 | {
28 | float3 origin;
29 | float3 dir;
30 | float3 inv_dir;
31 | };
32 |
33 | float max(float3 v)
34 | {
35 | return max(max(v.x, v.y), v.z);
36 | }
37 |
38 | float min(float3 v)
39 | {
40 | return min(min(v.x, v.y), v.z);
41 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Shaders/Util.hlsl.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5afa62c79f654cc39bdb109b2157d127
3 | timeCreated: 1614736891
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/ShadowRenderer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using System.Collections.Generic;
20 | using UnityEngine;
21 | using UnityEngine.Rendering;
22 | using UnityEngine.Rendering.Universal;
23 |
24 | namespace SVO
25 | {
26 | public class OctreeRendererFeature : ScriptableRendererFeature
27 | {
28 | private class OctreeRenderPass : ScriptableRenderPass
29 | {
30 | ///
31 | /// Prepare for execution. Called before render pass executes.
32 | ///
33 | public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { }
34 |
35 | ///
36 | /// Executes the render pass.
37 | ///
38 | public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
39 | {
40 | var cmd = CommandBufferPool.Get();
41 | var volumeId = Shader.PropertyToID("OctreeVolume");
42 |
43 | foreach (var renderer in FindObjectsOfType())
44 | {
45 | if (renderer.shadowCastingMode == ShadowCastingMode.Off)
46 | continue;
47 |
48 | foreach (var material in renderer.materials)
49 | {
50 | var v = material.GetTexture(volumeId) as Texture3D;
51 | if (v == null) continue;
52 | }
53 | }
54 |
55 | // execution
56 | context.ExecuteCommandBuffer(cmd);
57 | CommandBufferPool.Release(cmd);
58 | }
59 |
60 | ///
61 | /// Cleanup any allocated resources that were created during the execution of this render pass.
62 | ///
63 | public override void FrameCleanup(CommandBuffer cmd) { }
64 | }
65 |
66 | private OctreeRenderPass _renderPass;
67 |
68 | public override void Create()
69 | {
70 | _renderPass = new OctreeRenderPass
71 | {
72 | renderPassEvent = RenderPassEvent.AfterRenderingOpaques
73 | };
74 | }
75 |
76 | ///
77 | /// Inject render pass into camera. Called once per camera.
78 | ///
79 | public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
80 | {
81 | renderingData.cameraData.requiresDepthTexture = true;
82 | renderer.EnqueuePass(_renderPass);
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/ShadowRenderer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 09505b1cedd04941a3ae504dee692619
3 | timeCreated: 1625695148
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/TriBoxOverlap.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using UnityEngine;
20 |
21 | namespace SVO
22 | {
23 | public static class TriBoxOverlap
24 | {
25 | ///
26 | /// Performs an intersection test between a triangle and a box.
27 | ///
28 | /// Code was initially retrieved from and ported to use unity classes.
29 | /// https://stackoverflow.com/questions/17458562/efficient-aabb-triangle-intersection-in-c-sharp
30 | ///
31 | /// Method from
32 | /// Tomas Akenine-Moller. (2001, March). Fast 3D Triangle-Box Overlap Testing.
33 | /// Retrieved from https://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/tribox_tam.pdf
34 | ///
35 | ///
36 | ///
37 | ///
38 | public static bool IsIntersecting(Bounds box, Vector3[] triangle)
39 | {
40 | float triangleMin, triangleMax;
41 |
42 | // Test the box normals (x, y and z axes)
43 | var boxNormals = new[] {
44 | new Vector3(1,0,0),
45 | new Vector3(0,1,0),
46 | new Vector3(0,0,1)
47 | };
48 | for (int i = 0; i < 3; i++)
49 | {
50 | Project(triangle, boxNormals[i], out triangleMin, out triangleMax);
51 | if (triangleMax < box.min[i] || triangleMin > box.max[i])
52 | return false; // No intersection possible.
53 | }
54 |
55 | // Test the triangle normal
56 | var boxVertices = new Vector3[8];
57 | for(var i = 0; i < 8; i++)
58 | boxVertices[i] = box.min;
59 | for (var i = 0; i < 8; i++)
60 | {
61 | if ((i & 4) > 0) boxVertices[i].x += box.size.x;
62 | if ((i & 2) > 0) boxVertices[i].y += box.size.y;
63 | if ((i & 1) > 0) boxVertices[i].z += box.size.z;
64 | }
65 | var triangleNorm = Vector3.Cross(triangle[0] - triangle[1], triangle[2] - triangle[1]);
66 | float triangleOffset = Vector3.Dot(triangleNorm, triangle[0]);
67 | Project(boxVertices, triangleNorm, out var boxMin, out var boxMax);
68 | if (boxMax < triangleOffset || boxMin > triangleOffset)
69 | return false; // No intersection possible.
70 |
71 | // Test the nine edge cross-products
72 | Vector3[] triangleEdges = {
73 | triangle[0] - triangle[1],
74 | triangle[1] - triangle[2],
75 | triangle[2] - triangle[0]
76 | };
77 | for (var i = 0; i < 3; i++)
78 | {
79 | for (var j = 0; j < 3; j++)
80 | {
81 | // The box normals are the same as it's edge tangents
82 | var axis = Vector3.Cross(triangleEdges[i], boxNormals[j]);
83 | Project(boxVertices, axis, out boxMin, out boxMax);
84 | Project(triangle, axis, out triangleMin, out triangleMax);
85 | if (boxMax < triangleMin || boxMin > triangleMax)
86 | return false; // No intersection possible
87 | }
88 | }
89 |
90 | // No separating axis found.
91 | return true;
92 | }
93 |
94 | private static void Project(Vector3[] points, Vector3 axis, out float min, out float max)
95 | {
96 | min = float.PositiveInfinity;
97 | max = float.NegativeInfinity;
98 | foreach (var p in points)
99 | {
100 | var val = Vector3.Dot(axis, p);
101 | if (val < min) min = val;
102 | if (val > max) max = val;
103 | }
104 | }
105 | }
106 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/TriBoxOverlap.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 80791628eb1745d0b688cae6ab8eec64
3 | timeCreated: 1598728531
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Utils.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a0a543010b5f47b0b1bea8a6c820b5b8
3 | timeCreated: 1604361239
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Utils/OctreeMath.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Unity Sparse Voxel Octrees
3 | * Copyright (C) 2021 Alexander Goslin
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | using System;
20 | using UnityEngine;
21 |
22 | namespace SVO
23 | {
24 | public static class OctreeMath
25 | {
26 | public static Vector3 ToBarycentricCoordinates(Vector3 point, Vector3 p1, Vector3 p2, Vector3 p3)
27 | {
28 | var norm = Vector3.Cross(p2 - p1, p3 - p1);
29 | var pointProj = point - (Vector3.Dot(point - p1, norm) / norm.sqrMagnitude * norm);
30 |
31 |
32 | var a1 = CalculateTriangleArea(pointProj, p2, p3);
33 | var a2 = CalculateTriangleArea(p1, pointProj, p3);
34 | var a3 = CalculateTriangleArea(p1, p2, pointProj);
35 | return new Vector3(a1, a2, a3) / (a1 + a2 + a3);
36 | }
37 |
38 | public static float CalculateTriangleArea(Vector3 p1, Vector3 p2, Vector3 p3)
39 | {
40 | return Vector3.Cross(p2 - p1, p3 - p1).magnitude / 2;
41 | }
42 |
43 | public static float EstimateDerivative(float x, float dx, Func f)
44 | => (f(x + dx) - f(x)) / dx;
45 | }
46 | }
--------------------------------------------------------------------------------
/Assets/Scripts/SVO/Utils/OctreeMath.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b248f973648349e789d012c8f76c21d8
3 | timeCreated: 1604157306
--------------------------------------------------------------------------------
/Assets/Scripts/VoxelPlacer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Sparse Voxel Octrees Demo
3 | Copyright (C) 2021 Alexander Goslin
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program. If not, see .
17 | */
18 |
19 | using System;
20 | using System.IO;
21 | using SVO;
22 | using UnityEngine;
23 |
24 | namespace UnityTemplateProjects
25 | {
26 | public class VoxelPlacer : MonoBehaviour
27 | {
28 | public bool quickPlace = false;
29 | [Range(5, 12)]
30 | public int initialDepth = 5;
31 | public GameObject octreeObj;
32 | public GameObject selectionCube;
33 | public Material material;
34 | private Octree _octree;
35 | private RayHit? lastHit = null;
36 | private float depth = 5;
37 |
38 | // Start is called before the first frame update
39 | void Start()
40 | {
41 | _octree = new Octree();
42 | for (var x = -0.5f; x < 0.5f; x += 1 / Mathf.Pow(2f, initialDepth))
43 | {
44 | for (var z = -0.5f; z < 0.5f; z += 1 / Mathf.Pow(2f, initialDepth))
45 | {
46 | _octree.SetVoxel(new Vector3(x, Mathf.PerlinNoise(x + 1000f, z + 100f) - 0.5f, z), initialDepth, Color.white, new int[0]);
47 | }
48 | }
49 | material.mainTexture = _octree.Apply();
50 |
51 | Cursor.visible = false;
52 | Cursor.lockState = CursorLockMode.Locked;
53 | }
54 |
55 | private void Update()
56 | {
57 | if (Input.GetKeyDown(KeyCode.T))
58 | {
59 | _octree.Rebuild();
60 | octreeObj.GetComponent().material.mainTexture = _octree.Apply();
61 | }
62 |
63 | if (Input.GetKeyDown(KeyCode.G))
64 | quickPlace = !quickPlace;
65 |
66 | if (Input.GetKeyDown(KeyCode.Q))
67 | depth++;
68 | if (Input.GetKeyDown(KeyCode.E))
69 | depth--;
70 | depth = Mathf.Clamp(depth, 0, 21);
71 |
72 | var depthInt = Mathf.RoundToInt(depth);
73 | var size = 1f / Mathf.ClosestPowerOfTwo(Mathf.RoundToInt(Mathf.Exp(Mathf.Log(2) * depth)));
74 |
75 | var ray = new Ray(transform.position, transform.forward);
76 | if (_octree.CastRay(ray, octreeObj.transform, out var hit))
77 | {
78 | var p = (hit.objPos + Vector3.one * 0.5f + hit.faceNormal * 4.76837158203125e-7f) / size;
79 | p = new Vector3(Mathf.Floor(p.x) + 1, Mathf.Floor(p.y), Mathf.Floor(p.z)) * size - Vector3.one * 0.5f;
80 | selectionCube.transform.position =
81 | octreeObj.transform.localToWorldMatrix * new Vector4(p.x, p.y, p.z, 1);
82 | selectionCube.transform.localScale = Vector3.one * (size * 256f);
83 | lastHit = hit;
84 |
85 | if (quickPlace ? Input.GetMouseButton(0) : Input.GetMouseButtonDown(0))
86 | {
87 | _octree.SetVoxel(hit.objPos + hit.faceNormal * 4.76837158203125e-7f, depthInt, Color.white, new int[0]);
88 | octreeObj.GetComponent().material.mainTexture = _octree.Apply();
89 | }
90 |
91 | if (quickPlace ? Input.GetMouseButton(2) : Input.GetMouseButtonDown(2))
92 | {
93 | _octree.SetVoxel(hit.objPos - hit.faceNormal * 4.76837158203125e-7f, depthInt, Color.clear, new int[0]);
94 | octreeObj.GetComponent().material.mainTexture = _octree.Apply();
95 | }
96 | }
97 | else
98 | {
99 | lastHit = null;
100 | }
101 | }
102 |
103 | private void OnDrawGizmos()
104 | {
105 | if (lastHit != null)
106 | {
107 | Gizmos.DrawRay(lastHit.Value.worldPos, lastHit.Value.faceNormal);
108 | var pos = lastHit.Value.voxelObjPos + Vector3.one * lastHit.Value.voxelObjSize / 2;
109 | Gizmos.DrawWireCube(octreeObj.transform.localToWorldMatrix * new Vector4(pos.x, pos.y, pos.z, 1),
110 | octreeObj.transform.lossyScale * lastHit.Value.voxelObjSize);
111 | }
112 | }
113 | }
114 | }
--------------------------------------------------------------------------------
/Assets/Scripts/VoxelPlacer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8534589ed591a3c4c8905011ebc912a6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Assets/Settings.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0735c275001a2c84dafdb30deced5d8d
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/ForwardRenderer.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-578499426721177604
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 6b3d386ba5cd94485973aee1479b272e, type: 3}
13 | m_Name: OctreeRenderer
14 | m_EditorClassIdentifier:
15 | m_Active: 1
16 | settings:
17 | passTag: OctreeRenderer
18 | Event: 300
19 | filterSettings:
20 | RenderQueueType: 0
21 | LayerMask:
22 | serializedVersion: 2
23 | m_Bits: 256
24 | PassNames: []
25 | overrideMaterial: {fileID: 0}
26 | overrideMaterialPassIndex: 0
27 | overrideDepthState: 1
28 | depthCompareFunction: 4
29 | enableWrite: 1
30 | stencilSettings:
31 | overrideStencilState: 0
32 | stencilReference: 0
33 | stencilCompareFunction: 8
34 | passOperation: 0
35 | failOperation: 0
36 | zFailOperation: 0
37 | cameraSettings:
38 | overrideCamera: 0
39 | restoreCamera: 1
40 | offset: {x: 0, y: 0, z: 0, w: 0}
41 | cameraFieldOfView: 60
42 | --- !u!114 &11400000
43 | MonoBehaviour:
44 | m_ObjectHideFlags: 0
45 | m_CorrespondingSourceObject: {fileID: 0}
46 | m_PrefabInstance: {fileID: 0}
47 | m_PrefabAsset: {fileID: 0}
48 | m_GameObject: {fileID: 0}
49 | m_Enabled: 1
50 | m_EditorHideFlags: 0
51 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3}
52 | m_Name: ForwardRenderer
53 | m_EditorClassIdentifier:
54 | m_RendererFeatures: []
55 | m_RendererFeatureMap:
56 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
57 | shaders:
58 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3}
59 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3}
60 | screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd,
61 | type: 3}
62 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
63 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
64 | m_OpaqueLayerMask:
65 | serializedVersion: 2
66 | m_Bits: 4294967295
67 | m_TransparentLayerMask:
68 | serializedVersion: 2
69 | m_Bits: 4294967295
70 | m_DefaultStencilState:
71 | overrideStencilState: 0
72 | stencilReference: 0
73 | stencilCompareFunction: 8
74 | passOperation: 0
75 | failOperation: 0
76 | zFailOperation: 0
77 | m_ShadowTransparentReceive: 1
78 |
--------------------------------------------------------------------------------
/Assets/Settings/ForwardRenderer.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4a8e21d5c33334b11b34a596161b9360
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleSceneProfile.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &-7893295128165547882
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 3
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
13 | m_Name: Bloom
14 | m_EditorClassIdentifier:
15 | active: 1
16 | m_AdvancedMode: 0
17 | threshold:
18 | m_OverrideState: 1
19 | m_Value: 1
20 | min: 0
21 | intensity:
22 | m_OverrideState: 1
23 | m_Value: 1
24 | min: 0
25 | scatter:
26 | m_OverrideState: 0
27 | m_Value: 0.7
28 | min: 0
29 | max: 1
30 | clamp:
31 | m_OverrideState: 0
32 | m_Value: 65472
33 | min: 0
34 | tint:
35 | m_OverrideState: 0
36 | m_Value: {r: 1, g: 1, b: 1, a: 1}
37 | hdr: 0
38 | showAlpha: 0
39 | showEyeDropper: 1
40 | highQualityFiltering:
41 | m_OverrideState: 0
42 | m_Value: 0
43 | dirtTexture:
44 | m_OverrideState: 0
45 | m_Value: {fileID: 0}
46 | dirtIntensity:
47 | m_OverrideState: 0
48 | m_Value: 0
49 | min: 0
50 | --- !u!114 &-7011558710299706105
51 | MonoBehaviour:
52 | m_ObjectHideFlags: 3
53 | m_CorrespondingSourceObject: {fileID: 0}
54 | m_PrefabInstance: {fileID: 0}
55 | m_PrefabAsset: {fileID: 0}
56 | m_GameObject: {fileID: 0}
57 | m_Enabled: 1
58 | m_EditorHideFlags: 0
59 | m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3}
60 | m_Name: Vignette
61 | m_EditorClassIdentifier:
62 | active: 1
63 | m_AdvancedMode: 0
64 | color:
65 | m_OverrideState: 0
66 | m_Value: {r: 0, g: 0, b: 0, a: 1}
67 | hdr: 0
68 | showAlpha: 0
69 | showEyeDropper: 1
70 | center:
71 | m_OverrideState: 0
72 | m_Value: {x: 0.5, y: 0.5}
73 | intensity:
74 | m_OverrideState: 1
75 | m_Value: 0.25
76 | min: 0
77 | max: 1
78 | smoothness:
79 | m_OverrideState: 1
80 | m_Value: 0.4
81 | min: 0.01
82 | max: 1
83 | rounded:
84 | m_OverrideState: 0
85 | m_Value: 0
86 | --- !u!114 &11400000
87 | MonoBehaviour:
88 | m_ObjectHideFlags: 0
89 | m_CorrespondingSourceObject: {fileID: 0}
90 | m_PrefabInstance: {fileID: 0}
91 | m_PrefabAsset: {fileID: 0}
92 | m_GameObject: {fileID: 0}
93 | m_Enabled: 1
94 | m_EditorHideFlags: 0
95 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
96 | m_Name: SampleSceneProfile
97 | m_EditorClassIdentifier:
98 | components:
99 | - {fileID: 849379129802519247}
100 | - {fileID: -7893295128165547882}
101 | - {fileID: -7011558710299706105}
102 | --- !u!114 &849379129802519247
103 | MonoBehaviour:
104 | m_ObjectHideFlags: 3
105 | m_CorrespondingSourceObject: {fileID: 0}
106 | m_PrefabInstance: {fileID: 0}
107 | m_PrefabAsset: {fileID: 0}
108 | m_GameObject: {fileID: 0}
109 | m_Enabled: 1
110 | m_EditorHideFlags: 0
111 | m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
112 | m_Name: Tonemapping
113 | m_EditorClassIdentifier:
114 | active: 1
115 | m_AdvancedMode: 0
116 | mode:
117 | m_OverrideState: 1
118 | m_Value: 2
119 |
--------------------------------------------------------------------------------
/Assets/Settings/SampleSceneProfile.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 10fc4df2da32a41aaa32d77bc913491c
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-HighQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-HighQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 5
16 | k_AssetPreviousVersion: 5
17 | m_RendererType: 1
18 | m_RendererData: {fileID: 0}
19 | m_RendererDataList:
20 | - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2}
21 | m_DefaultRendererIndex: 0
22 | m_RequireDepthTexture: 0
23 | m_RequireOpaqueTexture: 0
24 | m_OpaqueDownsampling: 1
25 | m_SupportsTerrainHoles: 1
26 | m_SupportsHDR: 1
27 | m_MSAA: 2
28 | m_RenderScale: 1
29 | m_MainLightRenderingMode: 1
30 | m_MainLightShadowsSupported: 1
31 | m_MainLightShadowmapResolution: 4096
32 | m_AdditionalLightsRenderingMode: 1
33 | m_AdditionalLightsPerObjectLimit: 4
34 | m_AdditionalLightShadowsSupported: 1
35 | m_AdditionalLightsShadowmapResolution: 512
36 | m_ShadowDistance: 50
37 | m_ShadowCascades: 2
38 | m_Cascade2Split: 0.25
39 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
40 | m_ShadowDepthBias: 1
41 | m_ShadowNormalBias: 1
42 | m_SoftShadowsSupported: 0
43 | m_UseSRPBatcher: 1
44 | m_SupportsDynamicBatching: 0
45 | m_MixedLightingSupported: 1
46 | m_DebugLevel: 0
47 | m_UseAdaptivePerformance: 0
48 | m_PostProcessingFeatureSet: 0
49 | m_ColorGradingMode: 0
50 | m_ColorGradingLutSize: 32
51 | m_ShadowType: 1
52 | m_LocalShadowsSupported: 0
53 | m_LocalShadowsAtlasResolution: 256
54 | m_MaxPixelLights: 0
55 | m_ShadowAtlasResolution: 256
56 | m_ShaderVariantLogLevel: 0
57 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-HighQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 19ba41d7c0026c3459d37c2fe90c55a0
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-LowQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-LowQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 5
16 | k_AssetPreviousVersion: 5
17 | m_RendererType: 1
18 | m_RendererData: {fileID: 0}
19 | m_RendererDataList:
20 | - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2}
21 | m_DefaultRendererIndex: 0
22 | m_RequireDepthTexture: 0
23 | m_RequireOpaqueTexture: 0
24 | m_OpaqueDownsampling: 1
25 | m_SupportsHDR: 0
26 | m_MSAA: 1
27 | m_RenderScale: 1
28 | m_MainLightRenderingMode: 1
29 | m_MainLightShadowsSupported: 0
30 | m_MainLightShadowmapResolution: 2048
31 | m_AdditionalLightsRenderingMode: 0
32 | m_AdditionalLightsPerObjectLimit: 4
33 | m_AdditionalLightShadowsSupported: 0
34 | m_AdditionalLightsShadowmapResolution: 512
35 | m_ShadowDistance: 50
36 | m_ShadowCascades: 0
37 | m_Cascade2Split: 0.25
38 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
39 | m_ShadowDepthBias: 1
40 | m_ShadowNormalBias: 1
41 | m_SoftShadowsSupported: 0
42 | m_UseSRPBatcher: 1
43 | m_SupportsDynamicBatching: 0
44 | m_MixedLightingSupported: 1
45 | m_DebugLevel: 0
46 | m_ColorGradingMode: 0
47 | m_ColorGradingLutSize: 16
48 | m_ShadowType: 1
49 | m_LocalShadowsSupported: 0
50 | m_LocalShadowsAtlasResolution: 256
51 | m_MaxPixelLights: 0
52 | m_ShadowAtlasResolution: 256
53 | m_ShaderVariantLogLevel: 0
54 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-LowQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a31e9f9f9c9d4b9429ed0d1234e22103
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-MediumQuality.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
13 | m_Name: UniversalRP-MediumQuality
14 | m_EditorClassIdentifier:
15 | k_AssetVersion: 5
16 | k_AssetPreviousVersion: 5
17 | m_RendererType: 1
18 | m_RendererData: {fileID: 0}
19 | m_RendererDataList:
20 | - {fileID: 11400000, guid: 4a8e21d5c33334b11b34a596161b9360, type: 2}
21 | m_DefaultRendererIndex: 0
22 | m_RequireDepthTexture: 0
23 | m_RequireOpaqueTexture: 0
24 | m_OpaqueDownsampling: 1
25 | m_SupportsTerrainHoles: 1
26 | m_SupportsHDR: 0
27 | m_MSAA: 1
28 | m_RenderScale: 1
29 | m_MainLightRenderingMode: 1
30 | m_MainLightShadowsSupported: 1
31 | m_MainLightShadowmapResolution: 2048
32 | m_AdditionalLightsRenderingMode: 1
33 | m_AdditionalLightsPerObjectLimit: 4
34 | m_AdditionalLightShadowsSupported: 0
35 | m_AdditionalLightsShadowmapResolution: 512
36 | m_ShadowDistance: 50
37 | m_ShadowCascades: 1
38 | m_Cascade2Split: 0.25
39 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467}
40 | m_ShadowDepthBias: 1
41 | m_ShadowNormalBias: 1
42 | m_SoftShadowsSupported: 0
43 | m_UseSRPBatcher: 1
44 | m_SupportsDynamicBatching: 0
45 | m_MixedLightingSupported: 1
46 | m_DebugLevel: 0
47 | m_UseAdaptivePerformance: 0
48 | m_PostProcessingFeatureSet: 0
49 | m_ColorGradingMode: 0
50 | m_ColorGradingLutSize: 32
51 | m_ShadowType: 1
52 | m_LocalShadowsSupported: 0
53 | m_LocalShadowsAtlasResolution: 256
54 | m_MaxPixelLights: 0
55 | m_ShadowAtlasResolution: 256
56 | m_ShaderVariantLogLevel: 0
57 |
--------------------------------------------------------------------------------
/Assets/Settings/UniversalRP-MediumQuality.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d847b876476d3d6468f5dfcd34266f96
3 | NativeFormatImporter:
4 | externalObjects: {}
5 | mainObjectFileID: 0
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Packages/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.collab-proxy": "1.2.16",
4 | "com.unity.ide.rider": "1.1.4",
5 | "com.unity.ide.vscode": "1.2.3",
6 | "com.unity.render-pipelines.universal": "7.5.3",
7 | "com.unity.test-framework": "1.1.22",
8 | "com.unity.textmeshpro": "2.1.1",
9 | "com.unity.timeline": "1.2.18",
10 | "com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.20-preview",
11 | "com.unity.ugui": "1.0.0",
12 | "com.unity.modules.ai": "1.0.0",
13 | "com.unity.modules.androidjni": "1.0.0",
14 | "com.unity.modules.animation": "1.0.0",
15 | "com.unity.modules.assetbundle": "1.0.0",
16 | "com.unity.modules.audio": "1.0.0",
17 | "com.unity.modules.cloth": "1.0.0",
18 | "com.unity.modules.director": "1.0.0",
19 | "com.unity.modules.imageconversion": "1.0.0",
20 | "com.unity.modules.imgui": "1.0.0",
21 | "com.unity.modules.jsonserialize": "1.0.0",
22 | "com.unity.modules.particlesystem": "1.0.0",
23 | "com.unity.modules.physics": "1.0.0",
24 | "com.unity.modules.physics2d": "1.0.0",
25 | "com.unity.modules.screencapture": "1.0.0",
26 | "com.unity.modules.terrain": "1.0.0",
27 | "com.unity.modules.terrainphysics": "1.0.0",
28 | "com.unity.modules.tilemap": "1.0.0",
29 | "com.unity.modules.ui": "1.0.0",
30 | "com.unity.modules.uielements": "1.0.0",
31 | "com.unity.modules.umbra": "1.0.0",
32 | "com.unity.modules.unityanalytics": "1.0.0",
33 | "com.unity.modules.unitywebrequest": "1.0.0",
34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
35 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
36 | "com.unity.modules.unitywebrequesttexture": "1.0.0",
37 | "com.unity.modules.unitywebrequestwww": "1.0.0",
38 | "com.unity.modules.vehicles": "1.0.0",
39 | "com.unity.modules.video": "1.0.0",
40 | "com.unity.modules.vr": "1.0.0",
41 | "com.unity.modules.wind": "1.0.0",
42 | "com.unity.modules.xr": "1.0.0"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Packages/packages-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "com.unity.collab-proxy": {
4 | "version": "1.2.16",
5 | "depth": 0,
6 | "source": "registry",
7 | "dependencies": {},
8 | "url": "https://packages.unity.com"
9 | },
10 | "com.unity.ext.nunit": {
11 | "version": "1.0.6",
12 | "depth": 1,
13 | "source": "registry",
14 | "dependencies": {},
15 | "url": "https://packages.unity.com"
16 | },
17 | "com.unity.ide.rider": {
18 | "version": "1.1.4",
19 | "depth": 0,
20 | "source": "registry",
21 | "dependencies": {
22 | "com.unity.test-framework": "1.1.1"
23 | },
24 | "url": "https://packages.unity.com"
25 | },
26 | "com.unity.ide.vscode": {
27 | "version": "1.2.3",
28 | "depth": 0,
29 | "source": "registry",
30 | "dependencies": {},
31 | "url": "https://packages.unity.com"
32 | },
33 | "com.unity.render-pipelines.core": {
34 | "version": "7.5.3",
35 | "depth": 1,
36 | "source": "registry",
37 | "dependencies": {
38 | "com.unity.ugui": "1.0.0",
39 | "com.unity.modules.physics": "1.0.0"
40 | },
41 | "url": "https://packages.unity.com"
42 | },
43 | "com.unity.render-pipelines.universal": {
44 | "version": "7.5.3",
45 | "depth": 0,
46 | "source": "registry",
47 | "dependencies": {
48 | "com.unity.render-pipelines.core": "7.5.3",
49 | "com.unity.shadergraph": "7.5.3"
50 | },
51 | "url": "https://packages.unity.com"
52 | },
53 | "com.unity.shadergraph": {
54 | "version": "7.5.3",
55 | "depth": 1,
56 | "source": "registry",
57 | "dependencies": {
58 | "com.unity.render-pipelines.core": "7.5.3"
59 | },
60 | "url": "https://packages.unity.com"
61 | },
62 | "com.unity.sysroot": {
63 | "version": "0.1.19-preview",
64 | "depth": 1,
65 | "source": "registry",
66 | "dependencies": {},
67 | "url": "https://packages.unity.com"
68 | },
69 | "com.unity.sysroot.linux-x86_64": {
70 | "version": "0.1.14-preview",
71 | "depth": 1,
72 | "source": "registry",
73 | "dependencies": {
74 | "com.unity.sysroot": "0.1.18-preview"
75 | },
76 | "url": "https://packages.unity.com"
77 | },
78 | "com.unity.test-framework": {
79 | "version": "1.1.22",
80 | "depth": 0,
81 | "source": "registry",
82 | "dependencies": {
83 | "com.unity.ext.nunit": "1.0.6",
84 | "com.unity.modules.imgui": "1.0.0",
85 | "com.unity.modules.jsonserialize": "1.0.0"
86 | },
87 | "url": "https://packages.unity.com"
88 | },
89 | "com.unity.textmeshpro": {
90 | "version": "2.1.1",
91 | "depth": 0,
92 | "source": "registry",
93 | "dependencies": {
94 | "com.unity.ugui": "1.0.0"
95 | },
96 | "url": "https://packages.unity.com"
97 | },
98 | "com.unity.timeline": {
99 | "version": "1.2.18",
100 | "depth": 0,
101 | "source": "registry",
102 | "dependencies": {
103 | "com.unity.modules.director": "1.0.0",
104 | "com.unity.modules.animation": "1.0.0",
105 | "com.unity.modules.audio": "1.0.0",
106 | "com.unity.modules.particlesystem": "1.0.0"
107 | },
108 | "url": "https://packages.unity.com"
109 | },
110 | "com.unity.toolchain.win-x86_64-linux-x86_64": {
111 | "version": "0.1.20-preview",
112 | "depth": 0,
113 | "source": "registry",
114 | "dependencies": {
115 | "com.unity.sysroot": "0.1.19-preview",
116 | "com.unity.sysroot.linux-x86_64": "0.1.14-preview"
117 | },
118 | "url": "https://packages.unity.com"
119 | },
120 | "com.unity.ugui": {
121 | "version": "1.0.0",
122 | "depth": 0,
123 | "source": "builtin",
124 | "dependencies": {
125 | "com.unity.modules.ui": "1.0.0",
126 | "com.unity.modules.imgui": "1.0.0"
127 | }
128 | },
129 | "com.unity.modules.ai": {
130 | "version": "1.0.0",
131 | "depth": 0,
132 | "source": "builtin",
133 | "dependencies": {}
134 | },
135 | "com.unity.modules.androidjni": {
136 | "version": "1.0.0",
137 | "depth": 0,
138 | "source": "builtin",
139 | "dependencies": {}
140 | },
141 | "com.unity.modules.animation": {
142 | "version": "1.0.0",
143 | "depth": 0,
144 | "source": "builtin",
145 | "dependencies": {}
146 | },
147 | "com.unity.modules.assetbundle": {
148 | "version": "1.0.0",
149 | "depth": 0,
150 | "source": "builtin",
151 | "dependencies": {}
152 | },
153 | "com.unity.modules.audio": {
154 | "version": "1.0.0",
155 | "depth": 0,
156 | "source": "builtin",
157 | "dependencies": {}
158 | },
159 | "com.unity.modules.cloth": {
160 | "version": "1.0.0",
161 | "depth": 0,
162 | "source": "builtin",
163 | "dependencies": {
164 | "com.unity.modules.physics": "1.0.0"
165 | }
166 | },
167 | "com.unity.modules.director": {
168 | "version": "1.0.0",
169 | "depth": 0,
170 | "source": "builtin",
171 | "dependencies": {
172 | "com.unity.modules.audio": "1.0.0",
173 | "com.unity.modules.animation": "1.0.0"
174 | }
175 | },
176 | "com.unity.modules.imageconversion": {
177 | "version": "1.0.0",
178 | "depth": 0,
179 | "source": "builtin",
180 | "dependencies": {}
181 | },
182 | "com.unity.modules.imgui": {
183 | "version": "1.0.0",
184 | "depth": 0,
185 | "source": "builtin",
186 | "dependencies": {}
187 | },
188 | "com.unity.modules.jsonserialize": {
189 | "version": "1.0.0",
190 | "depth": 0,
191 | "source": "builtin",
192 | "dependencies": {}
193 | },
194 | "com.unity.modules.particlesystem": {
195 | "version": "1.0.0",
196 | "depth": 0,
197 | "source": "builtin",
198 | "dependencies": {}
199 | },
200 | "com.unity.modules.physics": {
201 | "version": "1.0.0",
202 | "depth": 0,
203 | "source": "builtin",
204 | "dependencies": {}
205 | },
206 | "com.unity.modules.physics2d": {
207 | "version": "1.0.0",
208 | "depth": 0,
209 | "source": "builtin",
210 | "dependencies": {}
211 | },
212 | "com.unity.modules.screencapture": {
213 | "version": "1.0.0",
214 | "depth": 0,
215 | "source": "builtin",
216 | "dependencies": {
217 | "com.unity.modules.imageconversion": "1.0.0"
218 | }
219 | },
220 | "com.unity.modules.subsystems": {
221 | "version": "1.0.0",
222 | "depth": 1,
223 | "source": "builtin",
224 | "dependencies": {
225 | "com.unity.modules.jsonserialize": "1.0.0"
226 | }
227 | },
228 | "com.unity.modules.terrain": {
229 | "version": "1.0.0",
230 | "depth": 0,
231 | "source": "builtin",
232 | "dependencies": {}
233 | },
234 | "com.unity.modules.terrainphysics": {
235 | "version": "1.0.0",
236 | "depth": 0,
237 | "source": "builtin",
238 | "dependencies": {
239 | "com.unity.modules.physics": "1.0.0",
240 | "com.unity.modules.terrain": "1.0.0"
241 | }
242 | },
243 | "com.unity.modules.tilemap": {
244 | "version": "1.0.0",
245 | "depth": 0,
246 | "source": "builtin",
247 | "dependencies": {
248 | "com.unity.modules.physics2d": "1.0.0"
249 | }
250 | },
251 | "com.unity.modules.ui": {
252 | "version": "1.0.0",
253 | "depth": 0,
254 | "source": "builtin",
255 | "dependencies": {}
256 | },
257 | "com.unity.modules.uielements": {
258 | "version": "1.0.0",
259 | "depth": 0,
260 | "source": "builtin",
261 | "dependencies": {
262 | "com.unity.modules.imgui": "1.0.0",
263 | "com.unity.modules.jsonserialize": "1.0.0"
264 | }
265 | },
266 | "com.unity.modules.umbra": {
267 | "version": "1.0.0",
268 | "depth": 0,
269 | "source": "builtin",
270 | "dependencies": {}
271 | },
272 | "com.unity.modules.unityanalytics": {
273 | "version": "1.0.0",
274 | "depth": 0,
275 | "source": "builtin",
276 | "dependencies": {
277 | "com.unity.modules.unitywebrequest": "1.0.0",
278 | "com.unity.modules.jsonserialize": "1.0.0"
279 | }
280 | },
281 | "com.unity.modules.unitywebrequest": {
282 | "version": "1.0.0",
283 | "depth": 0,
284 | "source": "builtin",
285 | "dependencies": {}
286 | },
287 | "com.unity.modules.unitywebrequestassetbundle": {
288 | "version": "1.0.0",
289 | "depth": 0,
290 | "source": "builtin",
291 | "dependencies": {
292 | "com.unity.modules.assetbundle": "1.0.0",
293 | "com.unity.modules.unitywebrequest": "1.0.0"
294 | }
295 | },
296 | "com.unity.modules.unitywebrequestaudio": {
297 | "version": "1.0.0",
298 | "depth": 0,
299 | "source": "builtin",
300 | "dependencies": {
301 | "com.unity.modules.unitywebrequest": "1.0.0",
302 | "com.unity.modules.audio": "1.0.0"
303 | }
304 | },
305 | "com.unity.modules.unitywebrequesttexture": {
306 | "version": "1.0.0",
307 | "depth": 0,
308 | "source": "builtin",
309 | "dependencies": {
310 | "com.unity.modules.unitywebrequest": "1.0.0",
311 | "com.unity.modules.imageconversion": "1.0.0"
312 | }
313 | },
314 | "com.unity.modules.unitywebrequestwww": {
315 | "version": "1.0.0",
316 | "depth": 0,
317 | "source": "builtin",
318 | "dependencies": {
319 | "com.unity.modules.unitywebrequest": "1.0.0",
320 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
321 | "com.unity.modules.unitywebrequestaudio": "1.0.0",
322 | "com.unity.modules.audio": "1.0.0",
323 | "com.unity.modules.assetbundle": "1.0.0",
324 | "com.unity.modules.imageconversion": "1.0.0"
325 | }
326 | },
327 | "com.unity.modules.vehicles": {
328 | "version": "1.0.0",
329 | "depth": 0,
330 | "source": "builtin",
331 | "dependencies": {
332 | "com.unity.modules.physics": "1.0.0"
333 | }
334 | },
335 | "com.unity.modules.video": {
336 | "version": "1.0.0",
337 | "depth": 0,
338 | "source": "builtin",
339 | "dependencies": {
340 | "com.unity.modules.audio": "1.0.0",
341 | "com.unity.modules.ui": "1.0.0",
342 | "com.unity.modules.unitywebrequest": "1.0.0"
343 | }
344 | },
345 | "com.unity.modules.vr": {
346 | "version": "1.0.0",
347 | "depth": 0,
348 | "source": "builtin",
349 | "dependencies": {
350 | "com.unity.modules.jsonserialize": "1.0.0",
351 | "com.unity.modules.physics": "1.0.0",
352 | "com.unity.modules.xr": "1.0.0"
353 | }
354 | },
355 | "com.unity.modules.wind": {
356 | "version": "1.0.0",
357 | "depth": 0,
358 | "source": "builtin",
359 | "dependencies": {}
360 | },
361 | "com.unity.modules.xr": {
362 | "version": "1.0.0",
363 | "depth": 0,
364 | "source": "builtin",
365 | "dependencies": {
366 | "com.unity.modules.physics": "1.0.0",
367 | "com.unity.modules.jsonserialize": "1.0.0",
368 | "com.unity.modules.subsystems": "1.0.0"
369 | }
370 | }
371 | }
372 | }
373 |
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!11 &1
4 | AudioManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Volume: 1
8 | Rolloff Scale: 1
9 | Doppler Factor: 1
10 | Default Speaker Mode: 2
11 | m_SampleRate: 0
12 | m_DSPBufferSize: 1024
13 | m_VirtualVoiceCount: 512
14 | m_RealVoiceCount: 32
15 | m_SpatializerPlugin:
16 | m_AmbisonicDecoderPlugin:
17 | m_DisableAudio: 0
18 | m_VirtualizeEffects: 1
19 | m_RequestedDSPBufferSize: 0
20 |
--------------------------------------------------------------------------------
/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!236 &1
4 | ClusterInputManager:
5 | m_ObjectHideFlags: 0
6 | m_Inputs: []
7 |
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!55 &1
4 | PhysicsManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 13
7 | m_Gravity: {x: 0, y: -9.81, z: 0}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_BounceThreshold: 2
10 | m_SleepThreshold: 0.005
11 | m_DefaultContactOffset: 0.01
12 | m_DefaultSolverIterations: 6
13 | m_DefaultSolverVelocityIterations: 1
14 | m_QueriesHitBackfaces: 0
15 | m_QueriesHitTriggers: 1
16 | m_EnableAdaptiveForce: 0
17 | m_ClothInterCollisionDistance: 0.1
18 | m_ClothInterCollisionStiffness: 0.2
19 | m_ContactsGeneration: 1
20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 | m_AutoSimulation: 1
22 | m_AutoSyncTransforms: 0
23 | m_ReuseCollisionCallbacks: 1
24 | m_ClothInterCollisionSettingsToggle: 0
25 | m_ClothGravity: {x: 0, y: -9.81, z: 0}
26 | m_ContactPairsMode: 0
27 | m_BroadphaseType: 0
28 | m_WorldBounds:
29 | m_Center: {x: 0, y: 0, z: 0}
30 | m_Extent: {x: 250, y: 250, z: 250}
31 | m_WorldSubdivisions: 8
32 | m_FrictionType: 0
33 | m_EnableEnhancedDeterminism: 0
34 | m_EnableUnifiedHeightmaps: 1
35 | m_SolverType: 0
36 | m_DefaultMaxAngularSpeed: 7
37 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1045 &1
4 | EditorBuildSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Scenes:
8 | - enabled: 0
9 | path:
10 | guid: 00000000000000000000000000000000
11 | - enabled: 0
12 | path:
13 | guid: 00000000000000000000000000000000
14 | - enabled: 1
15 | path: Assets/Scenes/SVO.unity
16 | guid: 799223979bdce2e4bb68c5aa162b02af
17 | m_configObjects: {}
18 |
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!159 &1
4 | EditorSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 9
7 | m_ExternalVersionControlSupport: Visible Meta Files
8 | m_SerializationMode: 2
9 | m_LineEndingsForNewScripts: 0
10 | m_DefaultBehaviorMode: 0
11 | m_PrefabRegularEnvironment: {fileID: 0}
12 | m_PrefabUIEnvironment: {fileID: 0}
13 | m_SpritePackerMode: 0
14 | m_SpritePackerPaddingPower: 1
15 | m_EtcTextureCompressorBehavior: 1
16 | m_EtcTextureFastCompressor: 1
17 | m_EtcTextureNormalCompressor: 2
18 | m_EtcTextureBestCompressor: 4
19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp
20 | m_ProjectGenerationRootNamespace:
21 | m_CollabEditorSettings:
22 | inProgressEnabled: 1
23 | m_EnableTextureStreamingInEditMode: 1
24 | m_EnableTextureStreamingInPlayMode: 1
25 | m_AsyncShaderCompilation: 1
26 | m_EnterPlayModeOptionsEnabled: 0
27 | m_EnterPlayModeOptions: 3
28 | m_ShowLightmapResolutionOverlay: 1
29 | m_UseLegacyProbeSampleCount: 0
30 | m_AssetPipelineMode: 1
31 | m_CacheServerMode: 0
32 | m_CacheServerEndpoint:
33 | m_CacheServerNamespacePrefix: default
34 | m_CacheServerEnableDownload: 1
35 | m_CacheServerEnableUpload: 1
36 |
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!30 &1
4 | GraphicsSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 13
7 | m_Deferred:
8 | m_Mode: 1
9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 | m_DeferredReflections:
11 | m_Mode: 1
12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 | m_ScreenSpaceShadows:
14 | m_Mode: 1
15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 | m_LegacyDeferred:
17 | m_Mode: 1
18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 | m_DepthNormals:
20 | m_Mode: 1
21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 | m_MotionVectors:
23 | m_Mode: 1
24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 | m_LightHalo:
26 | m_Mode: 1
27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 | m_LensFlare:
29 | m_Mode: 1
30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 | m_AlwaysIncludedShaders:
32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
41 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
42 | m_PreloadedShaders: []
43 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
44 | type: 0}
45 | m_CustomRenderPipeline: {fileID: 11400000, guid: 19ba41d7c0026c3459d37c2fe90c55a0,
46 | type: 2}
47 | m_TransparencySortMode: 0
48 | m_TransparencySortAxis: {x: 0, y: 0, z: 1}
49 | m_DefaultRenderingPath: 1
50 | m_DefaultMobileRenderingPath: 1
51 | m_TierSettings: []
52 | m_LightmapStripping: 0
53 | m_FogStripping: 0
54 | m_InstancingStripping: 0
55 | m_LightmapKeepPlain: 1
56 | m_LightmapKeepDirCombined: 1
57 | m_LightmapKeepDynamicPlain: 1
58 | m_LightmapKeepDynamicDirCombined: 1
59 | m_LightmapKeepShadowMask: 1
60 | m_LightmapKeepSubtractive: 1
61 | m_FogKeepLinear: 1
62 | m_FogKeepExp: 1
63 | m_FogKeepExp2: 1
64 | m_AlbedoSwatchInfos: []
65 | m_LightsUseLinearIntensity: 1
66 | m_LightsUseColorTemperature: 0
67 | m_LogWhenShaderIsCompiled: 0
68 | m_AllowEnlightenSupportForUpgradedProject: 1
69 |
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!13 &1
4 | InputManager:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | m_Axes:
8 | - serializedVersion: 3
9 | m_Name: Horizontal
10 | descriptiveName:
11 | descriptiveNegativeName:
12 | negativeButton: left
13 | positiveButton: right
14 | altNegativeButton: a
15 | altPositiveButton: d
16 | gravity: 3
17 | dead: 0.001
18 | sensitivity: 3
19 | snap: 1
20 | invert: 0
21 | type: 0
22 | axis: 0
23 | joyNum: 0
24 | - serializedVersion: 3
25 | m_Name: Vertical
26 | descriptiveName:
27 | descriptiveNegativeName:
28 | negativeButton: down
29 | positiveButton: up
30 | altNegativeButton: s
31 | altPositiveButton: w
32 | gravity: 3
33 | dead: 0.001
34 | sensitivity: 3
35 | snap: 1
36 | invert: 0
37 | type: 0
38 | axis: 0
39 | joyNum: 0
40 | - serializedVersion: 3
41 | m_Name: Fire1
42 | descriptiveName:
43 | descriptiveNegativeName:
44 | negativeButton:
45 | positiveButton: left ctrl
46 | altNegativeButton:
47 | altPositiveButton: mouse 0
48 | gravity: 1000
49 | dead: 0.001
50 | sensitivity: 1000
51 | snap: 0
52 | invert: 0
53 | type: 0
54 | axis: 0
55 | joyNum: 0
56 | - serializedVersion: 3
57 | m_Name: Fire2
58 | descriptiveName:
59 | descriptiveNegativeName:
60 | negativeButton:
61 | positiveButton: left alt
62 | altNegativeButton:
63 | altPositiveButton: mouse 1
64 | gravity: 1000
65 | dead: 0.001
66 | sensitivity: 1000
67 | snap: 0
68 | invert: 0
69 | type: 0
70 | axis: 0
71 | joyNum: 0
72 | - serializedVersion: 3
73 | m_Name: Fire3
74 | descriptiveName:
75 | descriptiveNegativeName:
76 | negativeButton:
77 | positiveButton: left shift
78 | altNegativeButton:
79 | altPositiveButton: mouse 2
80 | gravity: 1000
81 | dead: 0.001
82 | sensitivity: 1000
83 | snap: 0
84 | invert: 0
85 | type: 0
86 | axis: 0
87 | joyNum: 0
88 | - serializedVersion: 3
89 | m_Name: Jump
90 | descriptiveName:
91 | descriptiveNegativeName:
92 | negativeButton:
93 | positiveButton: space
94 | altNegativeButton:
95 | altPositiveButton:
96 | gravity: 1000
97 | dead: 0.001
98 | sensitivity: 1000
99 | snap: 0
100 | invert: 0
101 | type: 0
102 | axis: 0
103 | joyNum: 0
104 | - serializedVersion: 3
105 | m_Name: Mouse X
106 | descriptiveName:
107 | descriptiveNegativeName:
108 | negativeButton:
109 | positiveButton:
110 | altNegativeButton:
111 | altPositiveButton:
112 | gravity: 0
113 | dead: 0
114 | sensitivity: 0.1
115 | snap: 0
116 | invert: 0
117 | type: 1
118 | axis: 0
119 | joyNum: 0
120 | - serializedVersion: 3
121 | m_Name: Mouse Y
122 | descriptiveName:
123 | descriptiveNegativeName:
124 | negativeButton:
125 | positiveButton:
126 | altNegativeButton:
127 | altPositiveButton:
128 | gravity: 0
129 | dead: 0
130 | sensitivity: 0.1
131 | snap: 0
132 | invert: 0
133 | type: 1
134 | axis: 1
135 | joyNum: 0
136 | - serializedVersion: 3
137 | m_Name: Mouse ScrollWheel
138 | descriptiveName:
139 | descriptiveNegativeName:
140 | negativeButton:
141 | positiveButton:
142 | altNegativeButton:
143 | altPositiveButton:
144 | gravity: 0
145 | dead: 0
146 | sensitivity: 0.1
147 | snap: 0
148 | invert: 0
149 | type: 1
150 | axis: 2
151 | joyNum: 0
152 | - serializedVersion: 3
153 | m_Name: Horizontal
154 | descriptiveName:
155 | descriptiveNegativeName:
156 | negativeButton:
157 | positiveButton:
158 | altNegativeButton:
159 | altPositiveButton:
160 | gravity: 0
161 | dead: 0.19
162 | sensitivity: 1
163 | snap: 0
164 | invert: 0
165 | type: 2
166 | axis: 0
167 | joyNum: 0
168 | - serializedVersion: 3
169 | m_Name: Vertical
170 | descriptiveName:
171 | descriptiveNegativeName:
172 | negativeButton:
173 | positiveButton:
174 | altNegativeButton:
175 | altPositiveButton:
176 | gravity: 0
177 | dead: 0.19
178 | sensitivity: 1
179 | snap: 0
180 | invert: 1
181 | type: 2
182 | axis: 1
183 | joyNum: 0
184 | - serializedVersion: 3
185 | m_Name: Fire1
186 | descriptiveName:
187 | descriptiveNegativeName:
188 | negativeButton:
189 | positiveButton: joystick button 0
190 | altNegativeButton:
191 | altPositiveButton:
192 | gravity: 1000
193 | dead: 0.001
194 | sensitivity: 1000
195 | snap: 0
196 | invert: 0
197 | type: 0
198 | axis: 0
199 | joyNum: 0
200 | - serializedVersion: 3
201 | m_Name: Fire2
202 | descriptiveName:
203 | descriptiveNegativeName:
204 | negativeButton:
205 | positiveButton: joystick button 1
206 | altNegativeButton:
207 | altPositiveButton:
208 | gravity: 1000
209 | dead: 0.001
210 | sensitivity: 1000
211 | snap: 0
212 | invert: 0
213 | type: 0
214 | axis: 0
215 | joyNum: 0
216 | - serializedVersion: 3
217 | m_Name: Fire3
218 | descriptiveName:
219 | descriptiveNegativeName:
220 | negativeButton:
221 | positiveButton: joystick button 2
222 | altNegativeButton:
223 | altPositiveButton:
224 | gravity: 1000
225 | dead: 0.001
226 | sensitivity: 1000
227 | snap: 0
228 | invert: 0
229 | type: 0
230 | axis: 0
231 | joyNum: 0
232 | - serializedVersion: 3
233 | m_Name: Jump
234 | descriptiveName:
235 | descriptiveNegativeName:
236 | negativeButton:
237 | positiveButton: joystick button 3
238 | altNegativeButton:
239 | altPositiveButton:
240 | gravity: 1000
241 | dead: 0.001
242 | sensitivity: 1000
243 | snap: 0
244 | invert: 0
245 | type: 0
246 | axis: 0
247 | joyNum: 0
248 | - serializedVersion: 3
249 | m_Name: Submit
250 | descriptiveName:
251 | descriptiveNegativeName:
252 | negativeButton:
253 | positiveButton: return
254 | altNegativeButton:
255 | altPositiveButton: joystick button 0
256 | gravity: 1000
257 | dead: 0.001
258 | sensitivity: 1000
259 | snap: 0
260 | invert: 0
261 | type: 0
262 | axis: 0
263 | joyNum: 0
264 | - serializedVersion: 3
265 | m_Name: Submit
266 | descriptiveName:
267 | descriptiveNegativeName:
268 | negativeButton:
269 | positiveButton: enter
270 | altNegativeButton:
271 | altPositiveButton: space
272 | gravity: 1000
273 | dead: 0.001
274 | sensitivity: 1000
275 | snap: 0
276 | invert: 0
277 | type: 0
278 | axis: 0
279 | joyNum: 0
280 | - serializedVersion: 3
281 | m_Name: Cancel
282 | descriptiveName:
283 | descriptiveNegativeName:
284 | negativeButton:
285 | positiveButton: escape
286 | altNegativeButton:
287 | altPositiveButton: joystick button 1
288 | gravity: 1000
289 | dead: 0.001
290 | sensitivity: 1000
291 | snap: 0
292 | invert: 0
293 | type: 0
294 | axis: 0
295 | joyNum: 0
296 | - serializedVersion: 3
297 | m_Name: Enable Debug Button 1
298 | descriptiveName:
299 | descriptiveNegativeName:
300 | negativeButton:
301 | positiveButton: left ctrl
302 | altNegativeButton:
303 | altPositiveButton: joystick button 8
304 | gravity: 0
305 | dead: 0
306 | sensitivity: 0
307 | snap: 0
308 | invert: 0
309 | type: 0
310 | axis: 0
311 | joyNum: 0
312 | - serializedVersion: 3
313 | m_Name: Enable Debug Button 2
314 | descriptiveName:
315 | descriptiveNegativeName:
316 | negativeButton:
317 | positiveButton: backspace
318 | altNegativeButton:
319 | altPositiveButton: joystick button 9
320 | gravity: 0
321 | dead: 0
322 | sensitivity: 0
323 | snap: 0
324 | invert: 0
325 | type: 0
326 | axis: 0
327 | joyNum: 0
328 | - serializedVersion: 3
329 | m_Name: Debug Reset
330 | descriptiveName:
331 | descriptiveNegativeName:
332 | negativeButton:
333 | positiveButton: left alt
334 | altNegativeButton:
335 | altPositiveButton: joystick button 1
336 | gravity: 0
337 | dead: 0
338 | sensitivity: 0
339 | snap: 0
340 | invert: 0
341 | type: 0
342 | axis: 0
343 | joyNum: 0
344 | - serializedVersion: 3
345 | m_Name: Debug Next
346 | descriptiveName:
347 | descriptiveNegativeName:
348 | negativeButton:
349 | positiveButton: page down
350 | altNegativeButton:
351 | altPositiveButton: joystick button 5
352 | gravity: 0
353 | dead: 0
354 | sensitivity: 0
355 | snap: 0
356 | invert: 0
357 | type: 0
358 | axis: 0
359 | joyNum: 0
360 | - serializedVersion: 3
361 | m_Name: Debug Previous
362 | descriptiveName:
363 | descriptiveNegativeName:
364 | negativeButton:
365 | positiveButton: page up
366 | altNegativeButton:
367 | altPositiveButton: joystick button 4
368 | gravity: 0
369 | dead: 0
370 | sensitivity: 0
371 | snap: 0
372 | invert: 0
373 | type: 0
374 | axis: 0
375 | joyNum: 0
376 | - serializedVersion: 3
377 | m_Name: Debug Validate
378 | descriptiveName:
379 | descriptiveNegativeName:
380 | negativeButton:
381 | positiveButton: return
382 | altNegativeButton:
383 | altPositiveButton: joystick button 0
384 | gravity: 0
385 | dead: 0
386 | sensitivity: 0
387 | snap: 0
388 | invert: 0
389 | type: 0
390 | axis: 0
391 | joyNum: 0
392 | - serializedVersion: 3
393 | m_Name: Debug Persistent
394 | descriptiveName:
395 | descriptiveNegativeName:
396 | negativeButton:
397 | positiveButton: right shift
398 | altNegativeButton:
399 | altPositiveButton: joystick button 2
400 | gravity: 0
401 | dead: 0
402 | sensitivity: 0
403 | snap: 0
404 | invert: 0
405 | type: 0
406 | axis: 0
407 | joyNum: 0
408 | - serializedVersion: 3
409 | m_Name: Debug Multiplier
410 | descriptiveName:
411 | descriptiveNegativeName:
412 | negativeButton:
413 | positiveButton: left shift
414 | altNegativeButton:
415 | altPositiveButton: joystick button 3
416 | gravity: 0
417 | dead: 0
418 | sensitivity: 0
419 | snap: 0
420 | invert: 0
421 | type: 0
422 | axis: 0
423 | joyNum: 0
424 | - serializedVersion: 3
425 | m_Name: Debug Horizontal
426 | descriptiveName:
427 | descriptiveNegativeName:
428 | negativeButton: left
429 | positiveButton: right
430 | altNegativeButton:
431 | altPositiveButton:
432 | gravity: 1000
433 | dead: 0.001
434 | sensitivity: 1000
435 | snap: 0
436 | invert: 0
437 | type: 0
438 | axis: 0
439 | joyNum: 0
440 | - serializedVersion: 3
441 | m_Name: Debug Vertical
442 | descriptiveName:
443 | descriptiveNegativeName:
444 | negativeButton: down
445 | positiveButton: up
446 | altNegativeButton:
447 | altPositiveButton:
448 | gravity: 1000
449 | dead: 0.001
450 | sensitivity: 1000
451 | snap: 0
452 | invert: 0
453 | type: 0
454 | axis: 0
455 | joyNum: 0
456 | - serializedVersion: 3
457 | m_Name: Debug Vertical
458 | descriptiveName:
459 | descriptiveNegativeName:
460 | negativeButton: down
461 | positiveButton: up
462 | altNegativeButton:
463 | altPositiveButton:
464 | gravity: 1000
465 | dead: 0.001
466 | sensitivity: 1000
467 | snap: 0
468 | invert: 0
469 | type: 2
470 | axis: 6
471 | joyNum: 0
472 | - serializedVersion: 3
473 | m_Name: Debug Horizontal
474 | descriptiveName:
475 | descriptiveNegativeName:
476 | negativeButton: left
477 | positiveButton: right
478 | altNegativeButton:
479 | altPositiveButton:
480 | gravity: 1000
481 | dead: 0.001
482 | sensitivity: 1000
483 | snap: 0
484 | invert: 0
485 | type: 2
486 | axis: 5
487 | joyNum: 0
488 |
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!126 &1
4 | NavMeshProjectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 2
7 | areas:
8 | - name: Walkable
9 | cost: 1
10 | - name: Not Walkable
11 | cost: 1
12 | - name: Jump
13 | cost: 2
14 | - name:
15 | cost: 1
16 | - name:
17 | cost: 1
18 | - name:
19 | cost: 1
20 | - name:
21 | cost: 1
22 | - name:
23 | cost: 1
24 | - name:
25 | cost: 1
26 | - name:
27 | cost: 1
28 | - name:
29 | cost: 1
30 | - name:
31 | cost: 1
32 | - name:
33 | cost: 1
34 | - name:
35 | cost: 1
36 | - name:
37 | cost: 1
38 | - name:
39 | cost: 1
40 | - name:
41 | cost: 1
42 | - name:
43 | cost: 1
44 | - name:
45 | cost: 1
46 | - name:
47 | cost: 1
48 | - name:
49 | cost: 1
50 | - name:
51 | cost: 1
52 | - name:
53 | cost: 1
54 | - name:
55 | cost: 1
56 | - name:
57 | cost: 1
58 | - name:
59 | cost: 1
60 | - name:
61 | cost: 1
62 | - name:
63 | cost: 1
64 | - name:
65 | cost: 1
66 | - name:
67 | cost: 1
68 | - name:
69 | cost: 1
70 | - name:
71 | cost: 1
72 | m_LastAgentTypeID: -887442657
73 | m_Settings:
74 | - serializedVersion: 2
75 | agentTypeID: 0
76 | agentRadius: 0.5
77 | agentHeight: 2
78 | agentSlope: 45
79 | agentClimb: 0.75
80 | ledgeDropHeight: 0
81 | maxJumpAcrossDistance: 0
82 | minRegionArea: 2
83 | manualCellSize: 0
84 | cellSize: 0.16666667
85 | manualTileSize: 0
86 | tileSize: 256
87 | accuratePlacement: 0
88 | debug:
89 | m_Flags: 0
90 | m_SettingNames:
91 | - Humanoid
92 |
--------------------------------------------------------------------------------
/ProjectSettings/PackageManagerSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 13960, guid: 0000000000000000e000000000000000, type: 0}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_ScopedRegistriesSettingsExpanded: 1
16 | oneTimeWarningShown: 0
17 | m_Registries:
18 | - m_Id: main
19 | m_Name:
20 | m_Url: https://packages.unity.com
21 | m_Scopes: []
22 | m_IsDefault: 1
23 | m_UserSelectedRegistryName:
24 | m_UserAddingNewScopedRegistry: 0
25 | m_RegistryInfoDraft:
26 | m_ErrorMessage:
27 | m_Original:
28 | m_Id:
29 | m_Name:
30 | m_Url:
31 | m_Scopes: []
32 | m_IsDefault: 0
33 | m_Modified: 0
34 | m_Name:
35 | m_Url:
36 | m_Scopes:
37 | -
38 | m_SelectedScopeIndex: 0
39 |
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!19 &1
4 | Physics2DSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 4
7 | m_Gravity: {x: 0, y: -9.81}
8 | m_DefaultMaterial: {fileID: 0}
9 | m_VelocityIterations: 8
10 | m_PositionIterations: 3
11 | m_VelocityThreshold: 1
12 | m_MaxLinearCorrection: 0.2
13 | m_MaxAngularCorrection: 8
14 | m_MaxTranslationSpeed: 100
15 | m_MaxRotationSpeed: 360
16 | m_BaumgarteScale: 0.2
17 | m_BaumgarteTimeOfImpactScale: 0.75
18 | m_TimeToSleep: 0.5
19 | m_LinearSleepTolerance: 0.01
20 | m_AngularSleepTolerance: 2
21 | m_DefaultContactOffset: 0.01
22 | m_JobOptions:
23 | serializedVersion: 2
24 | useMultithreading: 0
25 | useConsistencySorting: 0
26 | m_InterpolationPosesPerJob: 100
27 | m_NewContactsPerJob: 30
28 | m_CollideContactsPerJob: 100
29 | m_ClearFlagsPerJob: 200
30 | m_ClearBodyForcesPerJob: 200
31 | m_SyncDiscreteFixturesPerJob: 50
32 | m_SyncContinuousFixturesPerJob: 50
33 | m_FindNearestContactsPerJob: 100
34 | m_UpdateTriggerContactsPerJob: 100
35 | m_IslandSolverCostThreshold: 100
36 | m_IslandSolverBodyCostScale: 1
37 | m_IslandSolverContactCostScale: 10
38 | m_IslandSolverJointCostScale: 10
39 | m_IslandSolverBodiesPerJob: 50
40 | m_IslandSolverContactsPerJob: 50
41 | m_AutoSimulation: 1
42 | m_QueriesHitTriggers: 1
43 | m_QueriesStartInColliders: 1
44 | m_CallbacksOnDisable: 1
45 | m_ReuseCollisionCallbacks: 1
46 | m_AutoSyncTransforms: 0
47 | m_AlwaysShowColliders: 0
48 | m_ShowColliderSleep: 1
49 | m_ShowColliderContacts: 0
50 | m_ShowColliderAABB: 0
51 | m_ContactArrowScale: 0.2
52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
57 |
--------------------------------------------------------------------------------
/ProjectSettings/PresetManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1386491679 &1
4 | PresetManager:
5 | m_ObjectHideFlags: 0
6 | m_DefaultList:
7 | - type:
8 | m_NativeTypeID: 108
9 | m_ManagedTypePPtr: {fileID: 0}
10 | m_ManagedTypeFallback:
11 | defaultPresets:
12 | - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43,
13 | type: 2}
14 | - type:
15 | m_NativeTypeID: 1020
16 | m_ManagedTypePPtr: {fileID: 0}
17 | m_ManagedTypeFallback:
18 | defaultPresets:
19 | - m_Preset: {fileID: 2655988077585873504, guid: e7689051185d12f4298e1ebb2693a29f,
20 | type: 2}
21 | - type:
22 | m_NativeTypeID: 1006
23 | m_ManagedTypePPtr: {fileID: 0}
24 | m_ManagedTypeFallback:
25 | defaultPresets:
26 | - m_Preset: {fileID: 2655988077585873504, guid: e8537455c6c08bd4e8bf0be3707da685,
27 | type: 2}
28 |
--------------------------------------------------------------------------------
/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!129 &1
4 | PlayerSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 20
7 | productGUID: 1a156ce9a317aef4ca34bdee6805b15f
8 | AndroidProfiler: 0
9 | AndroidFilterTouchesWhenObscured: 0
10 | AndroidEnableSustainedPerformanceMode: 0
11 | defaultScreenOrientation: 4
12 | targetDevice: 2
13 | useOnDemandResources: 0
14 | accelerometerFrequency: 60
15 | companyName: DefaultCompany
16 | productName: Microblocks
17 | defaultCursor: {fileID: 0}
18 | cursorHotspot: {x: 0, y: 0}
19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
20 | m_ShowUnitySplashScreen: 1
21 | m_ShowUnitySplashLogo: 1
22 | m_SplashScreenOverlayOpacity: 1
23 | m_SplashScreenAnimation: 1
24 | m_SplashScreenLogoStyle: 1
25 | m_SplashScreenDrawMode: 0
26 | m_SplashScreenBackgroundAnimationZoom: 1
27 | m_SplashScreenLogoAnimationZoom: 1
28 | m_SplashScreenBackgroundLandscapeAspect: 1
29 | m_SplashScreenBackgroundPortraitAspect: 1
30 | m_SplashScreenBackgroundLandscapeUvs:
31 | serializedVersion: 2
32 | x: 0
33 | y: 0
34 | width: 1
35 | height: 1
36 | m_SplashScreenBackgroundPortraitUvs:
37 | serializedVersion: 2
38 | x: 0
39 | y: 0
40 | width: 1
41 | height: 1
42 | m_SplashScreenLogos: []
43 | m_VirtualRealitySplashScreen: {fileID: 0}
44 | m_HolographicTrackingLossScreen: {fileID: 0}
45 | defaultScreenWidth: 1920
46 | defaultScreenHeight: 1080
47 | defaultScreenWidthWeb: 960
48 | defaultScreenHeightWeb: 600
49 | m_StereoRenderingPath: 0
50 | m_ActiveColorSpace: 1
51 | m_MTRendering: 1
52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000
53 | iosShowActivityIndicatorOnLoading: -1
54 | androidShowActivityIndicatorOnLoading: -1
55 | iosUseCustomAppBackgroundBehavior: 0
56 | iosAllowHTTPDownload: 1
57 | allowedAutorotateToPortrait: 1
58 | allowedAutorotateToPortraitUpsideDown: 1
59 | allowedAutorotateToLandscapeRight: 1
60 | allowedAutorotateToLandscapeLeft: 1
61 | useOSAutorotation: 1
62 | use32BitDisplayBuffer: 1
63 | preserveFramebufferAlpha: 0
64 | disableDepthAndStencilBuffers: 0
65 | androidStartInFullscreen: 1
66 | androidRenderOutsideSafeArea: 0
67 | androidUseSwappy: 0
68 | androidBlitType: 1
69 | defaultIsNativeResolution: 1
70 | macRetinaSupport: 1
71 | runInBackground: 1
72 | captureSingleScreen: 0
73 | muteOtherAudioSources: 0
74 | Prepare IOS For Recording: 0
75 | Force IOS Speakers When Recording: 0
76 | deferSystemGesturesMode: 0
77 | hideHomeButton: 0
78 | submitAnalytics: 1
79 | usePlayerLog: 1
80 | bakeCollisionMeshes: 0
81 | forceSingleInstance: 0
82 | useFlipModelSwapchain: 1
83 | resizableWindow: 0
84 | useMacAppStoreValidation: 0
85 | macAppStoreCategory: public.app-category.games
86 | gpuSkinning: 1
87 | xboxPIXTextureCapture: 0
88 | xboxEnableAvatar: 0
89 | xboxEnableKinect: 0
90 | xboxEnableKinectAutoTracking: 0
91 | xboxEnableFitness: 0
92 | visibleInBackground: 1
93 | allowFullscreenSwitch: 1
94 | fullscreenMode: 1
95 | xboxSpeechDB: 0
96 | xboxEnableHeadOrientation: 0
97 | xboxEnableGuest: 0
98 | xboxEnablePIXSampling: 0
99 | metalFramebufferOnly: 0
100 | xboxOneResolution: 0
101 | xboxOneSResolution: 0
102 | xboxOneXResolution: 3
103 | xboxOneMonoLoggingLevel: 0
104 | xboxOneLoggingLevel: 1
105 | xboxOneDisableEsram: 0
106 | xboxOneEnableTypeOptimization: 0
107 | xboxOnePresentImmediateThreshold: 0
108 | switchQueueCommandMemory: 0
109 | switchQueueControlMemory: 0
110 | switchQueueComputeMemory: 262144
111 | switchNVNShaderPoolsGranularity: 33554432
112 | switchNVNDefaultPoolsGranularity: 16777216
113 | switchNVNOtherPoolsGranularity: 16777216
114 | switchNVNMaxPublicTextureIDCount: 0
115 | switchNVNMaxPublicSamplerIDCount: 0
116 | stadiaPresentMode: 0
117 | stadiaTargetFramerate: 0
118 | vulkanNumSwapchainBuffers: 3
119 | vulkanEnableSetSRGBWrite: 0
120 | vulkanEnableLateAcquireNextImage: 0
121 | m_SupportedAspectRatios:
122 | 4:3: 1
123 | 5:4: 1
124 | 16:10: 1
125 | 16:9: 1
126 | Others: 1
127 | bundleVersion: 0.1
128 | preloadedAssets: []
129 | metroInputSource: 0
130 | wsaTransparentSwapchain: 0
131 | m_HolographicPauseOnTrackingLoss: 1
132 | xboxOneDisableKinectGpuReservation: 1
133 | xboxOneEnable7thCore: 1
134 | vrSettings:
135 | cardboard:
136 | depthFormat: 0
137 | enableTransitionView: 0
138 | daydream:
139 | depthFormat: 0
140 | useSustainedPerformanceMode: 0
141 | enableVideoLayer: 0
142 | useProtectedVideoMemory: 0
143 | minimumSupportedHeadTracking: 0
144 | maximumSupportedHeadTracking: 1
145 | hololens:
146 | depthFormat: 1
147 | depthBufferSharingEnabled: 1
148 | lumin:
149 | depthFormat: 0
150 | frameTiming: 2
151 | enableGLCache: 0
152 | glCacheMaxBlobSize: 524288
153 | glCacheMaxFileSize: 8388608
154 | oculus:
155 | sharedDepthBuffer: 1
156 | dashSupport: 1
157 | lowOverheadMode: 0
158 | protectedContext: 0
159 | v2Signing: 1
160 | enable360StereoCapture: 0
161 | isWsaHolographicRemotingEnabled: 0
162 | enableFrameTimingStats: 0
163 | useHDRDisplay: 0
164 | D3DHDRBitDepth: 0
165 | m_ColorGamuts: 0000000003000000
166 | targetPixelDensity: 30
167 | resolutionScalingMode: 0
168 | androidSupportedAspectRatio: 1
169 | androidMaxAspectRatio: 2.1
170 | applicationIdentifier: {}
171 | buildNumber: {}
172 | AndroidBundleVersionCode: 1
173 | AndroidMinSdkVersion: 19
174 | AndroidTargetSdkVersion: 0
175 | AndroidPreferredInstallLocation: 1
176 | aotOptions:
177 | stripEngineCode: 1
178 | iPhoneStrippingLevel: 0
179 | iPhoneScriptCallOptimization: 0
180 | ForceInternetPermission: 0
181 | ForceSDCardPermission: 0
182 | CreateWallpaper: 0
183 | APKExpansionFiles: 0
184 | keepLoadedShadersAlive: 0
185 | StripUnusedMeshComponents: 0
186 | VertexChannelCompressionMask: 4054
187 | iPhoneSdkVersion: 988
188 | iOSTargetOSVersionString: 10.0
189 | tvOSSdkVersion: 0
190 | tvOSRequireExtendedGameController: 0
191 | tvOSTargetOSVersionString: 10.0
192 | uIPrerenderedIcon: 0
193 | uIRequiresPersistentWiFi: 0
194 | uIRequiresFullScreen: 1
195 | uIStatusBarHidden: 1
196 | uIExitOnSuspend: 0
197 | uIStatusBarStyle: 0
198 | appleTVSplashScreen: {fileID: 0}
199 | appleTVSplashScreen2x: {fileID: 0}
200 | tvOSSmallIconLayers: []
201 | tvOSSmallIconLayers2x: []
202 | tvOSLargeIconLayers: []
203 | tvOSLargeIconLayers2x: []
204 | tvOSTopShelfImageLayers: []
205 | tvOSTopShelfImageLayers2x: []
206 | tvOSTopShelfImageWideLayers: []
207 | tvOSTopShelfImageWideLayers2x: []
208 | iOSLaunchScreenType: 0
209 | iOSLaunchScreenPortrait: {fileID: 0}
210 | iOSLaunchScreenLandscape: {fileID: 0}
211 | iOSLaunchScreenBackgroundColor:
212 | serializedVersion: 2
213 | rgba: 0
214 | iOSLaunchScreenFillPct: 100
215 | iOSLaunchScreenSize: 100
216 | iOSLaunchScreenCustomXibPath:
217 | iOSLaunchScreeniPadType: 0
218 | iOSLaunchScreeniPadImage: {fileID: 0}
219 | iOSLaunchScreeniPadBackgroundColor:
220 | serializedVersion: 2
221 | rgba: 0
222 | iOSLaunchScreeniPadFillPct: 100
223 | iOSLaunchScreeniPadSize: 100
224 | iOSLaunchScreeniPadCustomXibPath:
225 | iOSUseLaunchScreenStoryboard: 0
226 | iOSLaunchScreenCustomStoryboardPath:
227 | iOSDeviceRequirements: []
228 | iOSURLSchemes: []
229 | iOSBackgroundModes: 0
230 | iOSMetalForceHardShadows: 0
231 | metalEditorSupport: 1
232 | metalAPIValidation: 1
233 | iOSRenderExtraFrameOnPause: 0
234 | iosCopyPluginsCodeInsteadOfSymlink: 0
235 | appleDeveloperTeamID:
236 | iOSManualSigningProvisioningProfileID:
237 | tvOSManualSigningProvisioningProfileID:
238 | iOSManualSigningProvisioningProfileType: 0
239 | tvOSManualSigningProvisioningProfileType: 0
240 | appleEnableAutomaticSigning: 0
241 | iOSRequireARKit: 0
242 | iOSAutomaticallyDetectAndAddCapabilities: 1
243 | appleEnableProMotion: 0
244 | clonedFromGUID: 9870af204204ab84596f8a656f2f2ce6
245 | templatePackageId: com.unity.template.universal@7.5.2
246 | templateDefaultScene: Assets/Scenes/SampleScene.unity
247 | AndroidTargetArchitectures: 1
248 | AndroidSplashScreenScale: 0
249 | androidSplashScreen: {fileID: 0}
250 | AndroidKeystoreName:
251 | AndroidKeyaliasName:
252 | AndroidBuildApkPerCpuArchitecture: 0
253 | AndroidTVCompatibility: 0
254 | AndroidIsGame: 1
255 | AndroidEnableTango: 0
256 | androidEnableBanner: 1
257 | androidUseLowAccuracyLocation: 0
258 | androidUseCustomKeystore: 0
259 | m_AndroidBanners:
260 | - width: 320
261 | height: 180
262 | banner: {fileID: 0}
263 | androidGamepadSupportLevel: 0
264 | AndroidValidateAppBundleSize: 1
265 | AndroidAppBundleSizeToValidate: 100
266 | m_BuildTargetIcons: []
267 | m_BuildTargetPlatformIcons: []
268 | m_BuildTargetBatching:
269 | - m_BuildTarget: Standalone
270 | m_StaticBatching: 1
271 | m_DynamicBatching: 0
272 | - m_BuildTarget: tvOS
273 | m_StaticBatching: 1
274 | m_DynamicBatching: 0
275 | - m_BuildTarget: iPhone
276 | m_StaticBatching: 1
277 | m_DynamicBatching: 0
278 | - m_BuildTarget: Android
279 | m_StaticBatching: 1
280 | m_DynamicBatching: 0
281 | - m_BuildTarget: WebGL
282 | m_StaticBatching: 0
283 | m_DynamicBatching: 0
284 | m_BuildTargetGraphicsJobs:
285 | - m_BuildTarget: MacStandaloneSupport
286 | m_GraphicsJobs: 0
287 | - m_BuildTarget: Switch
288 | m_GraphicsJobs: 1
289 | - m_BuildTarget: MetroSupport
290 | m_GraphicsJobs: 1
291 | - m_BuildTarget: AppleTVSupport
292 | m_GraphicsJobs: 0
293 | - m_BuildTarget: BJMSupport
294 | m_GraphicsJobs: 1
295 | - m_BuildTarget: LinuxStandaloneSupport
296 | m_GraphicsJobs: 1
297 | - m_BuildTarget: PS4Player
298 | m_GraphicsJobs: 1
299 | - m_BuildTarget: iOSSupport
300 | m_GraphicsJobs: 0
301 | - m_BuildTarget: WindowsStandaloneSupport
302 | m_GraphicsJobs: 1
303 | - m_BuildTarget: XboxOnePlayer
304 | m_GraphicsJobs: 1
305 | - m_BuildTarget: LuminSupport
306 | m_GraphicsJobs: 0
307 | - m_BuildTarget: AndroidPlayer
308 | m_GraphicsJobs: 0
309 | - m_BuildTarget: WebGLSupport
310 | m_GraphicsJobs: 0
311 | m_BuildTargetGraphicsJobMode:
312 | - m_BuildTarget: PS4Player
313 | m_GraphicsJobMode: 0
314 | - m_BuildTarget: XboxOnePlayer
315 | m_GraphicsJobMode: 0
316 | m_BuildTargetGraphicsAPIs:
317 | - m_BuildTarget: iOSSupport
318 | m_APIs: 10000000
319 | m_Automatic: 0
320 | - m_BuildTarget: AppleTVSupport
321 | m_APIs: 10000000
322 | m_Automatic: 0
323 | - m_BuildTarget: AndroidPlayer
324 | m_APIs: 150000000b000000
325 | m_Automatic: 0
326 | - m_BuildTarget: WebGLSupport
327 | m_APIs: 0b000000
328 | m_Automatic: 0
329 | m_BuildTargetVRSettings: []
330 | openGLRequireES31: 0
331 | openGLRequireES31AEP: 0
332 | openGLRequireES32: 0
333 | m_TemplateCustomTags: {}
334 | mobileMTRendering:
335 | Android: 1
336 | iPhone: 1
337 | tvOS: 1
338 | m_BuildTargetGroupLightmapEncodingQuality:
339 | - m_BuildTarget: Standalone
340 | m_EncodingQuality: 1
341 | m_BuildTargetGroupLightmapSettings: []
342 | playModeTestRunnerEnabled: 0
343 | runPlayModeTestAsEditModeTest: 0
344 | actionOnDotNetUnhandledException: 1
345 | enableInternalProfiler: 0
346 | logObjCUncaughtExceptions: 1
347 | enableCrashReportAPI: 0
348 | cameraUsageDescription:
349 | locationUsageDescription:
350 | microphoneUsageDescription:
351 | switchNetLibKey:
352 | switchSocketMemoryPoolSize: 6144
353 | switchSocketAllocatorPoolSize: 128
354 | switchSocketConcurrencyLimit: 14
355 | switchScreenResolutionBehavior: 2
356 | switchUseCPUProfiler: 0
357 | switchApplicationID: 0x01004b9000490000
358 | switchNSODependencies:
359 | switchTitleNames_0:
360 | switchTitleNames_1:
361 | switchTitleNames_2:
362 | switchTitleNames_3:
363 | switchTitleNames_4:
364 | switchTitleNames_5:
365 | switchTitleNames_6:
366 | switchTitleNames_7:
367 | switchTitleNames_8:
368 | switchTitleNames_9:
369 | switchTitleNames_10:
370 | switchTitleNames_11:
371 | switchTitleNames_12:
372 | switchTitleNames_13:
373 | switchTitleNames_14:
374 | switchPublisherNames_0:
375 | switchPublisherNames_1:
376 | switchPublisherNames_2:
377 | switchPublisherNames_3:
378 | switchPublisherNames_4:
379 | switchPublisherNames_5:
380 | switchPublisherNames_6:
381 | switchPublisherNames_7:
382 | switchPublisherNames_8:
383 | switchPublisherNames_9:
384 | switchPublisherNames_10:
385 | switchPublisherNames_11:
386 | switchPublisherNames_12:
387 | switchPublisherNames_13:
388 | switchPublisherNames_14:
389 | switchIcons_0: {fileID: 0}
390 | switchIcons_1: {fileID: 0}
391 | switchIcons_2: {fileID: 0}
392 | switchIcons_3: {fileID: 0}
393 | switchIcons_4: {fileID: 0}
394 | switchIcons_5: {fileID: 0}
395 | switchIcons_6: {fileID: 0}
396 | switchIcons_7: {fileID: 0}
397 | switchIcons_8: {fileID: 0}
398 | switchIcons_9: {fileID: 0}
399 | switchIcons_10: {fileID: 0}
400 | switchIcons_11: {fileID: 0}
401 | switchIcons_12: {fileID: 0}
402 | switchIcons_13: {fileID: 0}
403 | switchIcons_14: {fileID: 0}
404 | switchSmallIcons_0: {fileID: 0}
405 | switchSmallIcons_1: {fileID: 0}
406 | switchSmallIcons_2: {fileID: 0}
407 | switchSmallIcons_3: {fileID: 0}
408 | switchSmallIcons_4: {fileID: 0}
409 | switchSmallIcons_5: {fileID: 0}
410 | switchSmallIcons_6: {fileID: 0}
411 | switchSmallIcons_7: {fileID: 0}
412 | switchSmallIcons_8: {fileID: 0}
413 | switchSmallIcons_9: {fileID: 0}
414 | switchSmallIcons_10: {fileID: 0}
415 | switchSmallIcons_11: {fileID: 0}
416 | switchSmallIcons_12: {fileID: 0}
417 | switchSmallIcons_13: {fileID: 0}
418 | switchSmallIcons_14: {fileID: 0}
419 | switchManualHTML:
420 | switchAccessibleURLs:
421 | switchLegalInformation:
422 | switchMainThreadStackSize: 1048576
423 | switchPresenceGroupId:
424 | switchLogoHandling: 0
425 | switchReleaseVersion: 0
426 | switchDisplayVersion: 1.0.0
427 | switchStartupUserAccount: 0
428 | switchTouchScreenUsage: 0
429 | switchSupportedLanguagesMask: 0
430 | switchLogoType: 0
431 | switchApplicationErrorCodeCategory:
432 | switchUserAccountSaveDataSize: 0
433 | switchUserAccountSaveDataJournalSize: 0
434 | switchApplicationAttribute: 0
435 | switchCardSpecSize: -1
436 | switchCardSpecClock: -1
437 | switchRatingsMask: 0
438 | switchRatingsInt_0: 0
439 | switchRatingsInt_1: 0
440 | switchRatingsInt_2: 0
441 | switchRatingsInt_3: 0
442 | switchRatingsInt_4: 0
443 | switchRatingsInt_5: 0
444 | switchRatingsInt_6: 0
445 | switchRatingsInt_7: 0
446 | switchRatingsInt_8: 0
447 | switchRatingsInt_9: 0
448 | switchRatingsInt_10: 0
449 | switchRatingsInt_11: 0
450 | switchRatingsInt_12: 0
451 | switchLocalCommunicationIds_0:
452 | switchLocalCommunicationIds_1:
453 | switchLocalCommunicationIds_2:
454 | switchLocalCommunicationIds_3:
455 | switchLocalCommunicationIds_4:
456 | switchLocalCommunicationIds_5:
457 | switchLocalCommunicationIds_6:
458 | switchLocalCommunicationIds_7:
459 | switchParentalControl: 0
460 | switchAllowsScreenshot: 1
461 | switchAllowsVideoCapturing: 1
462 | switchAllowsRuntimeAddOnContentInstall: 0
463 | switchDataLossConfirmation: 0
464 | switchUserAccountLockEnabled: 0
465 | switchSystemResourceMemory: 16777216
466 | switchSupportedNpadStyles: 22
467 | switchNativeFsCacheSize: 32
468 | switchIsHoldTypeHorizontal: 0
469 | switchSupportedNpadCount: 8
470 | switchSocketConfigEnabled: 0
471 | switchTcpInitialSendBufferSize: 32
472 | switchTcpInitialReceiveBufferSize: 64
473 | switchTcpAutoSendBufferSizeMax: 256
474 | switchTcpAutoReceiveBufferSizeMax: 256
475 | switchUdpSendBufferSize: 9
476 | switchUdpReceiveBufferSize: 42
477 | switchSocketBufferEfficiency: 4
478 | switchSocketInitializeEnabled: 1
479 | switchNetworkInterfaceManagerInitializeEnabled: 1
480 | switchPlayerConnectionEnabled: 1
481 | ps4NPAgeRating: 12
482 | ps4NPTitleSecret:
483 | ps4NPTrophyPackPath:
484 | ps4ParentalLevel: 11
485 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000
486 | ps4Category: 0
487 | ps4MasterVersion: 01.00
488 | ps4AppVersion: 01.00
489 | ps4AppType: 0
490 | ps4ParamSfxPath:
491 | ps4VideoOutPixelFormat: 0
492 | ps4VideoOutInitialWidth: 1920
493 | ps4VideoOutBaseModeInitialWidth: 1920
494 | ps4VideoOutReprojectionRate: 60
495 | ps4PronunciationXMLPath:
496 | ps4PronunciationSIGPath:
497 | ps4BackgroundImagePath:
498 | ps4StartupImagePath:
499 | ps4StartupImagesFolder:
500 | ps4IconImagesFolder:
501 | ps4SaveDataImagePath:
502 | ps4SdkOverride:
503 | ps4BGMPath:
504 | ps4ShareFilePath:
505 | ps4ShareOverlayImagePath:
506 | ps4PrivacyGuardImagePath:
507 | ps4ExtraSceSysFile:
508 | ps4NPtitleDatPath:
509 | ps4RemotePlayKeyAssignment: -1
510 | ps4RemotePlayKeyMappingDir:
511 | ps4PlayTogetherPlayerCount: 0
512 | ps4EnterButtonAssignment: 1
513 | ps4ApplicationParam1: 0
514 | ps4ApplicationParam2: 0
515 | ps4ApplicationParam3: 0
516 | ps4ApplicationParam4: 0
517 | ps4DownloadDataSize: 0
518 | ps4GarlicHeapSize: 2048
519 | ps4ProGarlicHeapSize: 2560
520 | playerPrefsMaxSize: 32768
521 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
522 | ps4pnSessions: 1
523 | ps4pnPresence: 1
524 | ps4pnFriends: 1
525 | ps4pnGameCustomData: 1
526 | playerPrefsSupport: 0
527 | enableApplicationExit: 0
528 | resetTempFolder: 1
529 | restrictedAudioUsageRights: 0
530 | ps4UseResolutionFallback: 0
531 | ps4ReprojectionSupport: 0
532 | ps4UseAudio3dBackend: 0
533 | ps4UseLowGarlicFragmentationMode: 1
534 | ps4SocialScreenEnabled: 0
535 | ps4ScriptOptimizationLevel: 0
536 | ps4Audio3dVirtualSpeakerCount: 14
537 | ps4attribCpuUsage: 0
538 | ps4PatchPkgPath:
539 | ps4PatchLatestPkgPath:
540 | ps4PatchChangeinfoPath:
541 | ps4PatchDayOne: 0
542 | ps4attribUserManagement: 0
543 | ps4attribMoveSupport: 0
544 | ps4attrib3DSupport: 0
545 | ps4attribShareSupport: 0
546 | ps4attribExclusiveVR: 0
547 | ps4disableAutoHideSplash: 0
548 | ps4videoRecordingFeaturesUsed: 0
549 | ps4contentSearchFeaturesUsed: 0
550 | ps4CompatibilityPS5: 0
551 | ps4GPU800MHz: 1
552 | ps4attribEyeToEyeDistanceSettingVR: 0
553 | ps4IncludedModules:
554 | - libc.prx
555 | - libSceAudioLatencyEstimation.prx
556 | - libSceFace.prx
557 | - libSceFaceTracker.prx
558 | - libSceFios2.prx
559 | - libSceHand.prx
560 | - libSceHandTracker.prx
561 | - libSceHeadTracker.prx
562 | - libSceJobManager.prx
563 | - libSceNpToolkit2.prx
564 | - libSceS3DConversion.prx
565 | ps4attribVROutputEnabled: 0
566 | monoEnv:
567 | splashScreenBackgroundSourceLandscape: {fileID: 0}
568 | splashScreenBackgroundSourcePortrait: {fileID: 0}
569 | blurSplashScreenBackground: 1
570 | spritePackerPolicy:
571 | webGLMemorySize: 16
572 | webGLExceptionSupport: 1
573 | webGLNameFilesAsHashes: 0
574 | webGLDataCaching: 1
575 | webGLDebugSymbols: 0
576 | webGLEmscriptenArgs:
577 | webGLModulesDirectory:
578 | webGLTemplate: APPLICATION:Default
579 | webGLAnalyzeBuildSize: 0
580 | webGLUseEmbeddedResources: 0
581 | webGLCompressionFormat: 1
582 | webGLLinkerTarget: 1
583 | webGLThreadsSupport: 0
584 | webGLWasmStreaming: 0
585 | scriptingDefineSymbols: {}
586 | platformArchitecture: {}
587 | scriptingBackend:
588 | Standalone: 1
589 | il2cppCompilerConfiguration: {}
590 | managedStrippingLevel: {}
591 | incrementalIl2cppBuild: {}
592 | allowUnsafeCode: 1
593 | additionalIl2CppArgs:
594 | scriptingRuntimeVersion: 1
595 | gcIncremental: 0
596 | assemblyVersionValidation: 1
597 | gcWBarrierValidation: 0
598 | apiCompatibilityLevelPerPlatform:
599 | Standalone: 3
600 | WebGL: 3
601 | m_RenderingPath: 1
602 | m_MobileRenderingPath: 1
603 | metroPackageName: Template_Lightweight
604 | metroPackageVersion:
605 | metroCertificatePath:
606 | metroCertificatePassword:
607 | metroCertificateSubject:
608 | metroCertificateIssuer:
609 | metroCertificateNotAfter: 0000000000000000
610 | metroApplicationDescription: Template_Lightweight
611 | wsaImages: {}
612 | metroTileShortName:
613 | metroTileShowName: 0
614 | metroMediumTileShowName: 0
615 | metroLargeTileShowName: 0
616 | metroWideTileShowName: 0
617 | metroSupportStreamingInstall: 0
618 | metroLastRequiredScene: 0
619 | metroDefaultTileSize: 1
620 | metroTileForegroundText: 2
621 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
622 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
623 | a: 1}
624 | metroSplashScreenUseBackgroundColor: 0
625 | platformCapabilities: {}
626 | metroTargetDeviceFamilies: {}
627 | metroFTAName:
628 | metroFTAFileTypes: []
629 | metroProtocolName:
630 | XboxOneProductId:
631 | XboxOneUpdateKey:
632 | XboxOneSandboxId:
633 | XboxOneContentId:
634 | XboxOneTitleId:
635 | XboxOneSCId:
636 | XboxOneGameOsOverridePath:
637 | XboxOnePackagingOverridePath:
638 | XboxOneAppManifestOverridePath:
639 | XboxOneVersion: 1.0.0.0
640 | XboxOnePackageEncryption: 0
641 | XboxOnePackageUpdateGranularity: 2
642 | XboxOneDescription:
643 | XboxOneLanguage:
644 | - enus
645 | XboxOneCapability: []
646 | XboxOneGameRating: {}
647 | XboxOneIsContentPackage: 0
648 | XboxOneEnhancedXboxCompatibilityMode: 0
649 | XboxOneEnableGPUVariability: 1
650 | XboxOneSockets: {}
651 | XboxOneSplashScreen: {fileID: 0}
652 | XboxOneAllowedProductIds: []
653 | XboxOnePersistentLocalStorageSize: 0
654 | XboxOneXTitleMemory: 8
655 | XboxOneOverrideIdentityName:
656 | XboxOneOverrideIdentityPublisher:
657 | vrEditorSettings:
658 | daydream:
659 | daydreamIconForeground: {fileID: 0}
660 | daydreamIconBackground: {fileID: 0}
661 | cloudServicesEnabled:
662 | UNet: 1
663 | luminIcon:
664 | m_Name:
665 | m_ModelFolderPath:
666 | m_PortalFolderPath:
667 | luminCert:
668 | m_CertPath:
669 | m_SignPackage: 1
670 | luminIsChannelApp: 0
671 | luminVersion:
672 | m_VersionCode: 1
673 | m_VersionName:
674 | apiCompatibilityLevel: 6
675 | cloudProjectId:
676 | framebufferDepthMemorylessMode: 0
677 | projectName:
678 | organizationId:
679 | cloudEnabled: 0
680 | enableNativePlatformBackendsForNewInputSystem: 0
681 | disableOldInputManagerSupport: 0
682 | legacyClampBlendShapeWeights: 0
683 |
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2019.4.21f1
2 | m_EditorVersionWithRevision: 2019.4.21f1 (b76dac84db26)
3 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!47 &1
4 | QualitySettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 5
7 | m_CurrentQuality: 2
8 | m_QualitySettings:
9 | - serializedVersion: 2
10 | name: Low
11 | pixelLightCount: 0
12 | shadows: 0
13 | shadowResolution: 0
14 | shadowProjection: 1
15 | shadowCascades: 1
16 | shadowDistance: 20
17 | shadowNearPlaneOffset: 3
18 | shadowCascade2Split: 0.33333334
19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 | shadowmaskMode: 0
21 | skinWeights: 2
22 | textureQuality: 0
23 | anisotropicTextures: 0
24 | antiAliasing: 0
25 | softParticles: 0
26 | softVegetation: 0
27 | realtimeReflectionProbes: 0
28 | billboardsFaceCameraPosition: 0
29 | vSyncCount: 0
30 | lodBias: 0.4
31 | maximumLODLevel: 0
32 | streamingMipmapsActive: 0
33 | streamingMipmapsAddAllCameras: 1
34 | streamingMipmapsMemoryBudget: 512
35 | streamingMipmapsRenderersPerFrame: 512
36 | streamingMipmapsMaxLevelReduction: 2
37 | streamingMipmapsMaxFileIORequests: 1024
38 | particleRaycastBudget: 16
39 | asyncUploadTimeSlice: 2
40 | asyncUploadBufferSize: 16
41 | asyncUploadPersistentBuffer: 1
42 | resolutionScalingFixedDPIFactor: 1
43 | customRenderPipeline: {fileID: 11400000, guid: a31e9f9f9c9d4b9429ed0d1234e22103,
44 | type: 2}
45 | excludedTargetPlatforms: []
46 | - serializedVersion: 2
47 | name: Medium
48 | pixelLightCount: 1
49 | shadows: 1
50 | shadowResolution: 0
51 | shadowProjection: 1
52 | shadowCascades: 1
53 | shadowDistance: 20
54 | shadowNearPlaneOffset: 3
55 | shadowCascade2Split: 0.33333334
56 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
57 | shadowmaskMode: 0
58 | skinWeights: 2
59 | textureQuality: 0
60 | anisotropicTextures: 1
61 | antiAliasing: 0
62 | softParticles: 0
63 | softVegetation: 0
64 | realtimeReflectionProbes: 0
65 | billboardsFaceCameraPosition: 0
66 | vSyncCount: 1
67 | lodBias: 0.7
68 | maximumLODLevel: 0
69 | streamingMipmapsActive: 0
70 | streamingMipmapsAddAllCameras: 1
71 | streamingMipmapsMemoryBudget: 512
72 | streamingMipmapsRenderersPerFrame: 512
73 | streamingMipmapsMaxLevelReduction: 2
74 | streamingMipmapsMaxFileIORequests: 1024
75 | particleRaycastBudget: 64
76 | asyncUploadTimeSlice: 2
77 | asyncUploadBufferSize: 16
78 | asyncUploadPersistentBuffer: 1
79 | resolutionScalingFixedDPIFactor: 1
80 | customRenderPipeline: {fileID: 11400000, guid: d847b876476d3d6468f5dfcd34266f96,
81 | type: 2}
82 | excludedTargetPlatforms: []
83 | - serializedVersion: 2
84 | name: High
85 | pixelLightCount: 2
86 | shadows: 2
87 | shadowResolution: 1
88 | shadowProjection: 1
89 | shadowCascades: 2
90 | shadowDistance: 40
91 | shadowNearPlaneOffset: 3
92 | shadowCascade2Split: 0.33333334
93 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
94 | shadowmaskMode: 1
95 | skinWeights: 2
96 | textureQuality: 0
97 | anisotropicTextures: 1
98 | antiAliasing: 2
99 | softParticles: 0
100 | softVegetation: 1
101 | realtimeReflectionProbes: 1
102 | billboardsFaceCameraPosition: 1
103 | vSyncCount: 1
104 | lodBias: 1
105 | maximumLODLevel: 0
106 | streamingMipmapsActive: 0
107 | streamingMipmapsAddAllCameras: 1
108 | streamingMipmapsMemoryBudget: 512
109 | streamingMipmapsRenderersPerFrame: 512
110 | streamingMipmapsMaxLevelReduction: 2
111 | streamingMipmapsMaxFileIORequests: 1024
112 | particleRaycastBudget: 256
113 | asyncUploadTimeSlice: 2
114 | asyncUploadBufferSize: 16
115 | asyncUploadPersistentBuffer: 1
116 | resolutionScalingFixedDPIFactor: 1
117 | customRenderPipeline: {fileID: 11400000, guid: 19ba41d7c0026c3459d37c2fe90c55a0,
118 | type: 2}
119 | excludedTargetPlatforms: []
120 | m_PerPlatformDefaultQuality:
121 | Android: 1
122 | Lumin: 2
123 | Nintendo Switch: 2
124 | PS4: 2
125 | Stadia: 2
126 | Standalone: 2
127 | WebGL: 1
128 | Windows Store Apps: 2
129 | XboxOne: 2
130 | iPhone: 1
131 | tvOS: 1
132 |
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!78 &1
4 | TagManager:
5 | serializedVersion: 2
6 | tags: []
7 | layers:
8 | - Default
9 | - TransparentFX
10 | - Ignore Raycast
11 | -
12 | - Water
13 | - UI
14 | -
15 | -
16 | - Octree
17 | -
18 | -
19 | -
20 | -
21 | -
22 | -
23 | -
24 | -
25 | -
26 | -
27 | -
28 | -
29 | -
30 | -
31 | -
32 | -
33 | -
34 | -
35 | -
36 | -
37 | -
38 | -
39 | -
40 | m_SortingLayers:
41 | - name: Default
42 | uniqueID: 0
43 | locked: 0
44 |
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!5 &1
4 | TimeManager:
5 | m_ObjectHideFlags: 0
6 | Fixed Timestep: 0.02
7 | Maximum Allowed Timestep: 0.1
8 | m_TimeScale: 1
9 | Maximum Particle Timestep: 0.03
10 |
--------------------------------------------------------------------------------
/ProjectSettings/URPProjectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &1
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 61
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3}
13 | m_Name:
14 | m_EditorClassIdentifier:
15 | m_LastMaterialVersion: 2
16 |
--------------------------------------------------------------------------------
/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!310 &1
4 | UnityConnectSettings:
5 | m_ObjectHideFlags: 0
6 | serializedVersion: 1
7 | m_Enabled: 0
8 | m_TestMode: 0
9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com
12 | m_TestInitMode: 0
13 | CrashReportingSettings:
14 | m_EventUrl: https://perf-events.cloud.unity3d.com
15 | m_Enabled: 0
16 | m_LogBufferSize: 10
17 | m_CaptureEditorExceptions: 1
18 | UnityPurchasingSettings:
19 | m_Enabled: 0
20 | m_TestMode: 0
21 | UnityAnalyticsSettings:
22 | m_Enabled: 0
23 | m_TestMode: 0
24 | m_InitializeOnStartup: 1
25 | UnityAdsSettings:
26 | m_Enabled: 0
27 | m_InitializeOnStartup: 1
28 | m_TestMode: 0
29 | m_IosGameId:
30 | m_AndroidGameId:
31 | m_GameIds: {}
32 | m_GameId:
33 | PerformanceReportingSettings:
34 | m_Enabled: 0
35 |
--------------------------------------------------------------------------------
/ProjectSettings/VFXManager.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!937362698 &1
4 | VFXManager:
5 | m_ObjectHideFlags: 0
6 | m_IndirectShader: {fileID: 0}
7 | m_CopyBufferShader: {fileID: 0}
8 | m_SortShader: {fileID: 0}
9 | m_RenderPipeSettingsPath:
10 | m_FixedTimeStep: 0.016666668
11 | m_MaxDeltaTime: 0.05
12 |
--------------------------------------------------------------------------------
/ProjectSettings/XRSettings.asset:
--------------------------------------------------------------------------------
1 | {
2 | "m_SettingKeys": [
3 | "VR Device Disabled",
4 | "VR Device User Alert"
5 | ],
6 | "m_SettingValues": [
7 | "False",
8 | "False"
9 | ]
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unity SVO Demo
2 |
3 | Demo of [unity-sparse-voxel-octrees](https://github.com/BudgetToaster/unity-sparse-voxel-octrees).
4 | Install by opening folder as unity project.
5 |
6 | ## Controls
7 |
8 | WASD - Movement
9 |
10 | Left click: Place voxel
11 |
12 | Middle click: Remove voxel
13 |
14 | G: Turn on quick-place
15 |
16 | Q/E: Change voxel size
17 |
18 | T: Rebuild octree (Lower memory usage)
19 |
--------------------------------------------------------------------------------