├── ProjectSettings ├── boot.config ├── ProjectVersion.txt ├── XRPackageSettings.asset ├── CommonBurstAotSettings.json ├── ClusterInputManager.asset ├── PresetManager.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── URPProjectSettings.asset ├── BurstAotSettings_StandaloneWindows.json ├── AudioManager.asset ├── ShaderGraphSettings.asset ├── EditorBuildSettings.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── PackageManagerSettings.asset ├── MemorySettings.asset ├── DynamicsManager.asset ├── EditorSettings.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── QualitySettings.asset ├── SceneTemplateSettings.json └── InputManager.asset ├── Assets ├── Shaders │ ├── BRDF.hlsl.meta │ ├── Lighting.hlsl.meta │ ├── LitInput.hlsl.meta │ ├── LitForwardPass.hlsl.meta │ ├── OpenSimplex2.hlsl.meta │ ├── SimplexNoise.hlsl.meta │ ├── Core.hlsl.meta │ ├── Input.hlsl.meta │ ├── DiffractionLit.shader.meta │ ├── OpenSimplex2.hlsl │ ├── Input.hlsl │ ├── LitForwardPass.hlsl │ ├── Core.hlsl │ ├── LitInput.hlsl │ └── Lighting.hlsl ├── Editor │ ├── CustomLitMaterial.meta │ └── CustomLitMaterial │ │ ├── DiffractionLitGUI.cs.meta │ │ ├── DiffractionLitDetailGUI.cs.meta │ │ ├── DiffractionLitShader.cs.meta │ │ ├── DiffractionLitDetailGUI.cs │ │ └── DiffractionLitShader.cs ├── Settings │ ├── URP-Balanced.asset.meta │ ├── URP-HighFidelity.asset.meta │ ├── URP-Performant.asset.meta │ ├── URP-Balanced-Renderer.asset.meta │ ├── URP-HighFidelity-Renderer.asset.meta │ ├── URP-Performant-Renderer.asset.meta │ ├── URP-Performant-Renderer.asset │ ├── URP-Performant.asset │ ├── URP-HighFidelity.asset │ ├── URP-Balanced.asset │ ├── URP-Balanced-Renderer.asset │ └── URP-HighFidelity-Renderer.asset └── Materials │ ├── AluBar1_CT.mat │ ├── AluBar2_CT.mat │ ├── AluBar3_CT.mat │ ├── AluBar4_CT.mat │ ├── AluBar65_CT.mat │ ├── AluBar1_CTDP.mat │ ├── AluBar2_CTDP.mat │ ├── AluBar65_CTDP.mat │ ├── AluBar3_CTDP.mat │ └── AluBar4_CTDP.mat ├── LICENSE ├── README.md ├── .gitignore └── Packages ├── manifest.json └── packages-lock.json /ProjectSettings/boot.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.6f1 2 | m_EditorVersionWithRevision: 2021.3.6f1 (7da38d85baf6) 3 | -------------------------------------------------------------------------------- /ProjectSettings/XRPackageSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_Settings": [ 3 | "RemoveLegacyInputHelpersForReload" 4 | ] 5 | } -------------------------------------------------------------------------------- /ProjectSettings/CommonBurstAotSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "DisabledWarnings": "" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /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/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/Shaders/BRDF.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e36bd986186b4144497191d6dc465b14 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Shaders/Lighting.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c879ac323df43740a062df75bb8314f 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Shaders/LitInput.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f5a585a888b00b499f734deac6bea8b 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Shaders/LitForwardPass.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9947a2f2f70371b4c8a7b154f3ce8d5e 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Shaders/OpenSimplex2.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5e614e433f44d5488371cec61b7a197 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Shaders/SimplexNoise.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f3894b184a1cb744833d1c0783bc07f 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8a1a87ba5f33ee42a9852dd44b50cff 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Balanced.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1260c1148f6143b28bae5ace5e9c5d1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-HighFidelity.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b7fd9122c28c4d15b667c7040e3b3fd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Performant.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0e2fc18fe036412f8223b3b3d9ad574 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Balanced-Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e634585d5c4544dd297acaee93dc2beb 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-HighFidelity-Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c40be3174f62c4acf8c1216858c64956 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Performant-Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 707360a9c581a4bd7aa53bfeb1429f71 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Shaders/Core.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 434fa4d930eff274d9b2a80de6520fb7 3 | timeCreated: 1488965025 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/Input.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f58523110b59b341910b17322cfb634 3 | timeCreated: 1488965025 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Shaders/DiffractionLit.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54bb6a1c988ba594293fe5a1d41a15d5 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial/DiffractionLitGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 327d25e2a53deba419302eb7dad4d047 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial/DiffractionLitDetailGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bcb170f27d1c7c449d949c1dffdc799 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial/DiffractionLitShader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0bfe5002339a86458223af093951de6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /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_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /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: 5 16 | -------------------------------------------------------------------------------- /ProjectSettings/BurstAotSettings_StandaloneWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "UsePlatformSDKLinker": false, 9 | "CpuMinTargetX32": 0, 10 | "CpuMaxTargetX32": 0, 11 | "CpuMinTargetX64": 0, 12 | "CpuMaxTargetX64": 0, 13 | "CpuTargetsX32": 6, 14 | "CpuTargetsX64": 72, 15 | "OptimizeFor": 0 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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/ShaderGraphSettings.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: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /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: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: 12 | com.unity.xr.management.loader_settings: {fileID: 11400000, guid: beb835a2448a79046810d4ad9704c734, 13 | type: 2} 14 | com.unity.xr.openxr.settings4: {fileID: 11400000, guid: 45d087577e642154d8fc6ca14362b339, 15 | type: 2} 16 | -------------------------------------------------------------------------------- /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 | - 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/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_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Martin Misiak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Realtime-Diffraction-PBR 2 | 3 | A Unity implementation of a practical, diffraction-aware, material model presented in the publication "A Practical Real-Time Model for Diffraction on Rough Surfaces" - Clausen et al. 2024 4 | 5 | ![Github_Title](https://github.com/MartinMisiak/Realtime-Diffraction-PBR/assets/40168931/817850af-d196-463f-865a-d5219f63817c) 6 | 7 | Developed and tested with Unity 2021.3.6f1, Universal RP 12.1.7, OpenXR Plugin 1.4.2 8 | 9 | # Ultra Quick Start 10 | - Download repository and open as Unity project (tested on Unity 2021.3.6f1) 11 | - Import test scene package from Resources link 12 | - Open the test scene 13 | - For VR to work properly in the test scene, the "Starter Assets" from the xr.interaction.toolkit package have to be imported via the Unity package manager 14 | 15 | # Integration into existing project 16 | - The diffraction material implementation is based on the Universal Rendering Pipeline 12.1.7. We copied the minimum set of modified shaders into this repository. The rest of the shaders are assumed to come from your local URP 12.1.7 package. It may work on other URP versions as well, however we have not tested it, or validated the visual result 17 | - Simply assign the "CustomShaders/DiffractionLit" material to any object with an existing UV mapping 18 | 19 | # Resources 20 | Museum test scene with some materials 21 | 22 | https://1drv.ms/u/s!Ap1NX8WBfJHQg6wuDvZ5oTYSAKzumw 23 | -------------------------------------------------------------------------------- /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: 0 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: 50 37 | -------------------------------------------------------------------------------- /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: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_Bc7TextureCompressor: 0 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_EnableTextureStreamingInEditMode: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | m_AsyncShaderCompilation: 1 24 | m_CachingShaderPreprocessor: 1 25 | m_PrefabModeAllowAutoSave: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_GameObjectNamingDigits: 1 29 | m_GameObjectNamingScheme: 0 30 | m_AssetNamingUsesSpace: 1 31 | m_UseLegacyProbeSampleCount: 0 32 | m_SerializeInlineMappingsOnOneLine: 0 33 | m_DisableCookiesInLightmapper: 1 34 | m_AssetPipelineMode: 1 35 | m_RefreshImportMode: 0 36 | m_CacheServerMode: 0 37 | m_CacheServerEndpoint: 38 | m_CacheServerNamespacePrefix: default 39 | m_CacheServerEnableDownload: 1 40 | m_CacheServerEnableUpload: 1 41 | m_CacheServerEnableAuth: 0 42 | m_CacheServerEnableTls: 0 43 | -------------------------------------------------------------------------------- /.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/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* 73 | -------------------------------------------------------------------------------- /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/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: 0 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 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.7.5", 6 | "com.unity.analytics": "3.6.12", 7 | "com.unity.collab-proxy": "1.15.18", 8 | "com.unity.ide.rider": "3.0.15", 9 | "com.unity.ide.visualstudio": "2.0.16", 10 | "com.unity.ide.vscode": "1.2.5", 11 | "com.unity.purchasing": "4.1.5", 12 | "com.unity.render-pipelines.universal": "12.1.7", 13 | "com.unity.test-framework": "1.1.31", 14 | "com.unity.textmeshpro": "3.0.6", 15 | "com.unity.timeline": "1.6.4", 16 | "com.unity.ugui": "1.0.0", 17 | "com.unity.visualscripting": "1.7.8", 18 | "com.unity.xr.interaction.toolkit": "2.5.2", 19 | "com.unity.xr.management": "4.2.1", 20 | "com.unity.xr.openxr": "1.4.2", 21 | "com.unity.modules.ai": "1.0.0", 22 | "com.unity.modules.androidjni": "1.0.0", 23 | "com.unity.modules.animation": "1.0.0", 24 | "com.unity.modules.assetbundle": "1.0.0", 25 | "com.unity.modules.audio": "1.0.0", 26 | "com.unity.modules.cloth": "1.0.0", 27 | "com.unity.modules.director": "1.0.0", 28 | "com.unity.modules.imageconversion": "1.0.0", 29 | "com.unity.modules.imgui": "1.0.0", 30 | "com.unity.modules.jsonserialize": "1.0.0", 31 | "com.unity.modules.particlesystem": "1.0.0", 32 | "com.unity.modules.physics": "1.0.0", 33 | "com.unity.modules.physics2d": "1.0.0", 34 | "com.unity.modules.screencapture": "1.0.0", 35 | "com.unity.modules.terrain": "1.0.0", 36 | "com.unity.modules.terrainphysics": "1.0.0", 37 | "com.unity.modules.tilemap": "1.0.0", 38 | "com.unity.modules.ui": "1.0.0", 39 | "com.unity.modules.uielements": "1.0.0", 40 | "com.unity.modules.umbra": "1.0.0", 41 | "com.unity.modules.unityanalytics": "1.0.0", 42 | "com.unity.modules.unitywebrequest": "1.0.0", 43 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 44 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 45 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 46 | "com.unity.modules.unitywebrequestwww": "1.0.0", 47 | "com.unity.modules.vehicles": "1.0.0", 48 | "com.unity.modules.video": "1.0.0", 49 | "com.unity.modules.vr": "1.0.0", 50 | "com.unity.modules.wind": "1.0.0", 51 | "com.unity.modules.xr": "1.0.0" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Performant-Renderer.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: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 13 | m_Name: URP-Performant-Renderer 14 | m_EditorClassIdentifier: 15 | debugShaders: 16 | debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, 17 | type: 3} 18 | m_RendererFeatures: [] 19 | m_RendererFeatureMap: 20 | m_UseNativeRenderPass: 0 21 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 22 | shaders: 23 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 24 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 25 | screenSpaceShadowPS: {fileID: 0} 26 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 27 | stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} 28 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 29 | materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} 30 | coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} 31 | coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, 32 | type: 3} 33 | cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, 34 | type: 3} 35 | objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, 36 | type: 3} 37 | m_AssetVersion: 1 38 | m_OpaqueLayerMask: 39 | serializedVersion: 2 40 | m_Bits: 4294967295 41 | m_TransparentLayerMask: 42 | serializedVersion: 2 43 | m_Bits: 4294967295 44 | m_DefaultStencilState: 45 | overrideStencilState: 0 46 | stencilReference: 0 47 | stencilCompareFunction: 8 48 | passOperation: 2 49 | failOperation: 0 50 | zFailOperation: 0 51 | m_ShadowTransparentReceive: 1 52 | m_RenderingMode: 0 53 | m_DepthPrimingMode: 1 54 | m_AccurateGbufferNormals: 0 55 | m_ClusteredRendering: 0 56 | m_TileSize: 32 57 | m_IntermediateTextureMode: 0 58 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Performant.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: URP-Performant 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 9 16 | k_AssetPreviousVersion: 9 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: 707360a9c581a4bd7aa53bfeb1429f71, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 1 26 | m_StoreActionsOptimization: 0 27 | m_SupportsHDR: 0 28 | m_MSAA: 1 29 | m_RenderScale: 1 30 | m_MainLightRenderingMode: 1 31 | m_MainLightShadowsSupported: 0 32 | m_MainLightShadowmapResolution: 1024 33 | m_AdditionalLightsRenderingMode: 0 34 | m_AdditionalLightsPerObjectLimit: 4 35 | m_AdditionalLightShadowsSupported: 0 36 | m_AdditionalLightsShadowmapResolution: 512 37 | m_AdditionalLightsShadowResolutionTierLow: 128 38 | m_AdditionalLightsShadowResolutionTierMedium: 256 39 | m_AdditionalLightsShadowResolutionTierHigh: 512 40 | m_ReflectionProbeBlending: 0 41 | m_ReflectionProbeBoxProjection: 0 42 | m_ShadowDistance: 50 43 | m_ShadowCascadeCount: 1 44 | m_Cascade2Split: 0.25 45 | m_Cascade3Split: {x: 0.1, y: 0.3} 46 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 47 | m_CascadeBorder: 0.1 48 | m_ShadowDepthBias: 1 49 | m_ShadowNormalBias: 1 50 | m_SoftShadowsSupported: 0 51 | m_AdditionalLightsCookieResolution: 2048 52 | m_AdditionalLightsCookieFormat: 3 53 | m_UseSRPBatcher: 1 54 | m_SupportsDynamicBatching: 0 55 | m_MixedLightingSupported: 1 56 | m_SupportsLightLayers: 0 57 | m_DebugLevel: 0 58 | m_UseAdaptivePerformance: 1 59 | m_ColorGradingMode: 0 60 | m_ColorGradingLutSize: 16 61 | m_UseFastSRGBLinearConversion: 0 62 | m_ShadowType: 1 63 | m_LocalShadowsSupported: 0 64 | m_LocalShadowsAtlasResolution: 256 65 | m_MaxPixelLights: 0 66 | m_ShadowAtlasResolution: 256 67 | m_ShaderVariantLogLevel: 0 68 | m_VolumeFrameworkUpdateMode: 0 69 | m_ShadowCascades: 0 70 | -------------------------------------------------------------------------------- /Assets/Settings/URP-HighFidelity.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: URP-HighFidelity 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 9 16 | k_AssetPreviousVersion: 9 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: c40be3174f62c4acf8c1216858c64956, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 1 26 | m_StoreActionsOptimization: 0 27 | m_SupportsHDR: 1 28 | m_MSAA: 4 29 | m_RenderScale: 1 30 | m_MainLightRenderingMode: 1 31 | m_MainLightShadowsSupported: 1 32 | m_MainLightShadowmapResolution: 4096 33 | m_AdditionalLightsRenderingMode: 1 34 | m_AdditionalLightsPerObjectLimit: 8 35 | m_AdditionalLightShadowsSupported: 1 36 | m_AdditionalLightsShadowmapResolution: 4096 37 | m_AdditionalLightsShadowResolutionTierLow: 128 38 | m_AdditionalLightsShadowResolutionTierMedium: 256 39 | m_AdditionalLightsShadowResolutionTierHigh: 512 40 | m_ReflectionProbeBlending: 1 41 | m_ReflectionProbeBoxProjection: 1 42 | m_ShadowDistance: 150 43 | m_ShadowCascadeCount: 4 44 | m_Cascade2Split: 0.25 45 | m_Cascade3Split: {x: 0.1, y: 0.3} 46 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 47 | m_CascadeBorder: 0.1 48 | m_ShadowDepthBias: 1 49 | m_ShadowNormalBias: 1 50 | m_SoftShadowsSupported: 1 51 | m_AdditionalLightsCookieResolution: 4096 52 | m_AdditionalLightsCookieFormat: 4 53 | m_UseSRPBatcher: 1 54 | m_SupportsDynamicBatching: 0 55 | m_MixedLightingSupported: 1 56 | m_SupportsLightLayers: 0 57 | m_DebugLevel: 0 58 | m_UseAdaptivePerformance: 1 59 | m_ColorGradingMode: 0 60 | m_ColorGradingLutSize: 32 61 | m_UseFastSRGBLinearConversion: 0 62 | m_ShadowType: 1 63 | m_LocalShadowsSupported: 0 64 | m_LocalShadowsAtlasResolution: 256 65 | m_MaxPixelLights: 0 66 | m_ShadowAtlasResolution: 256 67 | m_ShaderVariantLogLevel: 0 68 | m_VolumeFrameworkUpdateMode: 0 69 | m_ShadowCascades: 1 70 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Balanced.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: URP-Balanced 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 9 16 | k_AssetPreviousVersion: 9 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: e634585d5c4544dd297acaee93dc2beb, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 1 26 | m_StoreActionsOptimization: 0 27 | m_SupportsHDR: 1 28 | m_MSAA: 1 29 | m_RenderScale: 1 30 | m_UpscalingFilter: 0 31 | m_FsrOverrideSharpness: 0 32 | m_FsrSharpness: 0.92 33 | m_MainLightRenderingMode: 1 34 | m_MainLightShadowsSupported: 1 35 | m_MainLightShadowmapResolution: 1024 36 | m_AdditionalLightsRenderingMode: 1 37 | m_AdditionalLightsPerObjectLimit: 2 38 | m_AdditionalLightShadowsSupported: 0 39 | m_AdditionalLightsShadowmapResolution: 512 40 | m_AdditionalLightsShadowResolutionTierLow: 128 41 | m_AdditionalLightsShadowResolutionTierMedium: 256 42 | m_AdditionalLightsShadowResolutionTierHigh: 512 43 | m_ReflectionProbeBlending: 0 44 | m_ReflectionProbeBoxProjection: 1 45 | m_ShadowDistance: 50 46 | m_ShadowCascadeCount: 1 47 | m_Cascade2Split: 0.25 48 | m_Cascade3Split: {x: 0.1, y: 0.3} 49 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 50 | m_CascadeBorder: 0.1 51 | m_ShadowDepthBias: 1 52 | m_ShadowNormalBias: 1 53 | m_SoftShadowsSupported: 1 54 | m_ConservativeEnclosingSphere: 0 55 | m_NumIterationsEnclosingSphere: 64 56 | m_AdditionalLightsCookieResolution: 512 57 | m_AdditionalLightsCookieFormat: 1 58 | m_UseSRPBatcher: 1 59 | m_SupportsDynamicBatching: 0 60 | m_MixedLightingSupported: 1 61 | m_SupportsLightLayers: 0 62 | m_DebugLevel: 0 63 | m_UseAdaptivePerformance: 1 64 | m_ColorGradingMode: 0 65 | m_ColorGradingLutSize: 32 66 | m_UseFastSRGBLinearConversion: 0 67 | m_ShadowType: 1 68 | m_LocalShadowsSupported: 0 69 | m_LocalShadowsAtlasResolution: 256 70 | m_MaxPixelLights: 0 71 | m_ShadowAtlasResolution: 256 72 | m_ShaderVariantLogLevel: 0 73 | m_VolumeFrameworkUpdateMode: 0 74 | m_ShadowCascades: 0 75 | -------------------------------------------------------------------------------- /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: 14 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_VideoShadersIncludeMode: 2 32 | m_AlwaysIncludedShaders: 33 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_PreloadShadersBatchTimeLimit: -1 42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 43 | type: 0} 44 | m_CustomRenderPipeline: {fileID: 11400000, guid: 7b7fd9122c28c4d15b667c7040e3b3fd, 45 | type: 2} 46 | m_TransparencySortMode: 0 47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 48 | m_DefaultRenderingPath: 1 49 | m_DefaultMobileRenderingPath: 1 50 | m_TierSettings: [] 51 | m_LightmapStripping: 0 52 | m_FogStripping: 0 53 | m_InstancingStripping: 0 54 | m_LightmapKeepPlain: 1 55 | m_LightmapKeepDirCombined: 1 56 | m_LightmapKeepDynamicPlain: 1 57 | m_LightmapKeepDynamicDirCombined: 1 58 | m_LightmapKeepShadowMask: 1 59 | m_LightmapKeepSubtractive: 1 60 | m_FogKeepLinear: 1 61 | m_FogKeepExp: 1 62 | m_FogKeepExp2: 1 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 1 65 | m_LightsUseColorTemperature: 1 66 | m_DefaultRenderingLayerMask: 1 67 | m_LogWhenShaderIsCompiled: 0 68 | m_SRPDefaultSettings: 69 | UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, 70 | type: 2} 71 | -------------------------------------------------------------------------------- /Assets/Settings/URP-Balanced-Renderer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-1878332245247344467 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: f62c9c65cf3354c93be831c8bc075510, type: 3} 13 | m_Name: SSAO 14 | m_EditorClassIdentifier: 15 | m_Active: 1 16 | m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3} 17 | m_Settings: 18 | Downsample: 1 19 | AfterOpaque: 0 20 | Source: 0 21 | NormalSamples: 0 22 | Intensity: 0.5 23 | DirectLightingStrength: 0.25 24 | Radius: 0.25 25 | SampleCount: 4 26 | --- !u!114 &11400000 27 | MonoBehaviour: 28 | m_ObjectHideFlags: 0 29 | m_CorrespondingSourceObject: {fileID: 0} 30 | m_PrefabInstance: {fileID: 0} 31 | m_PrefabAsset: {fileID: 0} 32 | m_GameObject: {fileID: 0} 33 | m_Enabled: 1 34 | m_EditorHideFlags: 0 35 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 36 | m_Name: URP-Balanced-Renderer 37 | m_EditorClassIdentifier: 38 | debugShaders: 39 | debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, 40 | type: 3} 41 | m_RendererFeatures: 42 | - {fileID: -1878332245247344467} 43 | m_RendererFeatureMap: adc0de57c6d2eee5 44 | m_UseNativeRenderPass: 0 45 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 46 | shaders: 47 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 48 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 49 | screenSpaceShadowPS: {fileID: 0} 50 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 51 | stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} 52 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 53 | materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} 54 | coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} 55 | coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, 56 | type: 3} 57 | cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, 58 | type: 3} 59 | objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, 60 | type: 3} 61 | m_AssetVersion: 1 62 | m_OpaqueLayerMask: 63 | serializedVersion: 2 64 | m_Bits: 4294967295 65 | m_TransparentLayerMask: 66 | serializedVersion: 2 67 | m_Bits: 4294967295 68 | m_DefaultStencilState: 69 | overrideStencilState: 0 70 | stencilReference: 0 71 | stencilCompareFunction: 8 72 | passOperation: 2 73 | failOperation: 0 74 | zFailOperation: 0 75 | m_ShadowTransparentReceive: 1 76 | m_RenderingMode: 0 77 | m_DepthPrimingMode: 1 78 | m_AccurateGbufferNormals: 0 79 | m_ClusteredRendering: 0 80 | m_TileSize: 32 81 | m_IntermediateTextureMode: 0 82 | -------------------------------------------------------------------------------- /Assets/Settings/URP-HighFidelity-Renderer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-1878332245247344467 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: f62c9c65cf3354c93be831c8bc075510, type: 3} 13 | m_Name: SSAO 14 | m_EditorClassIdentifier: 15 | m_Active: 1 16 | m_Shader: {fileID: 4800000, guid: 0849e84e3d62649e8882e9d6f056a017, type: 3} 17 | m_Settings: 18 | Downsample: 0 19 | AfterOpaque: 0 20 | Source: 1 21 | NormalSamples: 1 22 | Intensity: 0.5 23 | DirectLightingStrength: 0.25 24 | Radius: 0.25 25 | SampleCount: 12 26 | --- !u!114 &11400000 27 | MonoBehaviour: 28 | m_ObjectHideFlags: 0 29 | m_CorrespondingSourceObject: {fileID: 0} 30 | m_PrefabInstance: {fileID: 0} 31 | m_PrefabAsset: {fileID: 0} 32 | m_GameObject: {fileID: 0} 33 | m_Enabled: 1 34 | m_EditorHideFlags: 0 35 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 36 | m_Name: URP-HighFidelity-Renderer 37 | m_EditorClassIdentifier: 38 | debugShaders: 39 | debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, 40 | type: 3} 41 | m_RendererFeatures: 42 | - {fileID: -1878332245247344467} 43 | m_RendererFeatureMap: adc0de57c6d2eee5 44 | m_UseNativeRenderPass: 0 45 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 46 | shaders: 47 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 48 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 49 | screenSpaceShadowPS: {fileID: 0} 50 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 51 | stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} 52 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 53 | materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} 54 | coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} 55 | coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, 56 | type: 3} 57 | cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, 58 | type: 3} 59 | objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, 60 | type: 3} 61 | m_AssetVersion: 1 62 | m_OpaqueLayerMask: 63 | serializedVersion: 2 64 | m_Bits: 4294967295 65 | m_TransparentLayerMask: 66 | serializedVersion: 2 67 | m_Bits: 4294967295 68 | m_DefaultStencilState: 69 | overrideStencilState: 0 70 | stencilReference: 0 71 | stencilCompareFunction: 8 72 | passOperation: 2 73 | failOperation: 0 74 | zFailOperation: 0 75 | m_ShadowTransparentReceive: 1 76 | m_RenderingMode: 0 77 | m_DepthPrimingMode: 1 78 | m_AccurateGbufferNormals: 0 79 | m_ClusteredRendering: 0 80 | m_TileSize: 32 81 | m_IntermediateTextureMode: 0 82 | -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial/DiffractionLitDetailGUI.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Rendering; 3 | 4 | namespace UnityEditor.Rendering.Universal.ShaderGUI 5 | { 6 | internal class DiffractionLitDetailGUI 7 | { 8 | public static class Styles 9 | { 10 | public static readonly GUIContent detailInputs = EditorGUIUtility.TrTextContent("Detail Inputs", 11 | "These settings define the surface details by tiling and overlaying additional maps on the surface."); 12 | 13 | public static readonly GUIContent detailMaskText = EditorGUIUtility.TrTextContent("Mask", 14 | "Select a mask for the Detail map. The mask uses the alpha channel of the selected texture. The Tiling and Offset settings have no effect on the mask."); 15 | 16 | public static readonly GUIContent detailAlbedoMapText = EditorGUIUtility.TrTextContent("Base Map", 17 | "Select the surface detail texture.The alpha of your texture determines surface hue and intensity."); 18 | 19 | public static readonly GUIContent detailNormalMapText = EditorGUIUtility.TrTextContent("Normal Map", 20 | "Designates a Normal Map to create the illusion of bumps and dents in the details of this Material's surface."); 21 | 22 | public static readonly GUIContent detailAlbedoMapScaleInfo = EditorGUIUtility.TrTextContent("Setting the scaling factor to a value other than 1 results in a less performant shader variant."); 23 | } 24 | 25 | public struct LitProperties 26 | { 27 | public MaterialProperty detailMask; 28 | public MaterialProperty detailAlbedoMapScale; 29 | public MaterialProperty detailAlbedoMap; 30 | public MaterialProperty detailNormalMapScale; 31 | public MaterialProperty detailNormalMap; 32 | 33 | public LitProperties(MaterialProperty[] properties) 34 | { 35 | detailMask = BaseShaderGUI.FindProperty("_DetailMask", properties, false); 36 | detailAlbedoMapScale = BaseShaderGUI.FindProperty("_DetailAlbedoMapScale", properties, false); 37 | detailAlbedoMap = BaseShaderGUI.FindProperty("_DetailAlbedoMap", properties, false); 38 | detailNormalMapScale = BaseShaderGUI.FindProperty("_DetailNormalMapScale", properties, false); 39 | detailNormalMap = BaseShaderGUI.FindProperty("_DetailNormalMap", properties, false); 40 | } 41 | } 42 | 43 | public static void DoDetailArea(LitProperties properties, MaterialEditor materialEditor) 44 | { 45 | materialEditor.TexturePropertySingleLine(Styles.detailMaskText, properties.detailMask); 46 | materialEditor.TexturePropertySingleLine(Styles.detailAlbedoMapText, properties.detailAlbedoMap, 47 | properties.detailAlbedoMap.textureValue != null ? properties.detailAlbedoMapScale : null); 48 | if (properties.detailAlbedoMapScale.floatValue != 1.0f) 49 | { 50 | EditorGUILayout.HelpBox(Styles.detailAlbedoMapScaleInfo.text, MessageType.Info, true); 51 | } 52 | materialEditor.TexturePropertySingleLine(Styles.detailNormalMapText, properties.detailNormalMap, 53 | properties.detailNormalMap.textureValue != null ? properties.detailNormalMapScale : null); 54 | materialEditor.TextureScaleOffsetProperty(properties.detailAlbedoMap); 55 | } 56 | 57 | public static void SetMaterialKeywords(Material material) 58 | { 59 | if (material.HasProperty("_DetailAlbedoMap") && material.HasProperty("_DetailNormalMap") && material.HasProperty("_DetailAlbedoMapScale")) 60 | { 61 | bool isScaled = material.GetFloat("_DetailAlbedoMapScale") != 1.0f; 62 | bool hasDetailMap = material.GetTexture("_DetailAlbedoMap") || material.GetTexture("_DetailNormalMap"); 63 | CoreUtils.SetKeyword(material, "_DETAIL_MULX2", !isScaled && hasDetailMap); 64 | CoreUtils.SetKeyword(material, "_DETAIL_SCALED", isScaled && hasDetailMap); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /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: Performant 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: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 11400000, guid: d0e2fc18fe036412f8223b3b3d9ad574, 44 | type: 2} 45 | excludedTargetPlatforms: [] 46 | - serializedVersion: 2 47 | name: Balanced 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: 4 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: 1 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: e1260c1148f6143b28bae5ace5e9c5d1, 81 | type: 2} 82 | excludedTargetPlatforms: [] 83 | - serializedVersion: 2 84 | name: High Fidelity 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: 255 96 | textureQuality: 0 97 | anisotropicTextures: 2 98 | antiAliasing: 4 99 | softParticles: 0 100 | softVegetation: 1 101 | realtimeReflectionProbes: 1 102 | billboardsFaceCameraPosition: 1 103 | vSyncCount: 1 104 | lodBias: 2 105 | maximumLODLevel: 0 106 | streamingMipmapsActive: 0 107 | streamingMipmapsAddAllCameras: 1 108 | streamingMipmapsMemoryBudget: 512 109 | streamingMipmapsRenderersPerFrame: 512 110 | streamingMipmapsMaxLevelReduction: 2 111 | streamingMipmapsMaxFileIORequests: 1024 112 | particleRaycastBudget: 2048 113 | asyncUploadTimeSlice: 2 114 | asyncUploadBufferSize: 16 115 | asyncUploadPersistentBuffer: 1 116 | resolutionScalingFixedDPIFactor: 1 117 | customRenderPipeline: {fileID: 11400000, guid: 7b7fd9122c28c4d15b667c7040e3b3fd, 118 | type: 2} 119 | excludedTargetPlatforms: [] 120 | m_PerPlatformDefaultQuality: 121 | Android: 1 122 | CloudRendering: 2 123 | GameCoreScarlett: 2 124 | GameCoreXboxOne: 2 125 | Lumin: 2 126 | Nintendo Switch: 1 127 | PS4: 2 128 | PS5: 2 129 | Server: 0 130 | Stadia: 2 131 | Standalone: 2 132 | WebGL: 1 133 | Windows Store Apps: 2 134 | XboxOne: 2 135 | iPhone: 1 136 | tvOS: 1 137 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar1_CT.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar1_CT 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_COOK_TORRANCE 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _OcclusionMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _ParallaxMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _SpecGlossMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_Lightmaps: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_LightmapsInd: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_ShadowMasks: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | m_Ints: [] 92 | m_Floats: 93 | - _AlphaClip: 0 94 | - _AnalyticSpecularBRDFMode: 1 95 | - _Blend: 0 96 | - _BumpScale: 0 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DiffractionCovInit_Row_1: 1 104 | - _DiffractionCovInit_Row_2: 1 105 | - _DiffractionCovInit_Row_3: 1 106 | - _DiffractionCovar_GB: 0.00316949 107 | - _DiffractionCovar_RB: 0.00305712 108 | - _DiffractionCovar_RG: 0.00377288 109 | - _DiffractionHeight: 0.00102 110 | - _DiffractionPatternToggle: 1 111 | - _DiffractionStereoSpecularity: 0.5 112 | - _DiffractionUV_ScaleX: 190 113 | - _DiffractionUV_ScaleY: 190 114 | - _DiffractionVar_B: 0.00326149 115 | - _DiffractionVar_G: 0.00396111 116 | - _DiffractionVar_R: 0.00429577 117 | - _DiffractionWidth: 2.34 118 | - _DiffractionZW_Scale: 7 119 | - _DstBlend: 0 120 | - _EnableSSAO: 1 121 | - _EnvironmentReflectionMode: 1 122 | - _EnvironmentReflections: 1 123 | - _GlossMapScale: 0 124 | - _Glossiness: 0 125 | - _GlossyReflections: 0 126 | - _HighlightDisparity: 1 127 | - _Metallic: 1 128 | - _NoiseImplementationDiffraction: 1 129 | - _NumReflRayMult: 1 130 | - _OcclusionStrength: 1 131 | - _Parallax: 0.005 132 | - _QueueOffset: 0 133 | - _ReceiveShadows: 1 134 | - _Smoothness: 0.8593 135 | - _SmoothnessTextureChannel: 0 136 | - _SpecularHighlights: 1 137 | - _SrcBlend: 1 138 | - _Surface: 0 139 | - _WorkflowMode: 1 140 | - _ZWrite: 1 141 | m_Colors: 142 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 143 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 144 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 145 | - _Color: {r: 1, g: 1, b: 1, a: 1} 146 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 147 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 148 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 149 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 150 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 151 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 152 | - _SpecColor: {r: 0.1999999, g: 0.1999999, b: 0.1999999, a: 1} 153 | m_BuildTextureStacks: [] 154 | --- !u!114 &979046647209337217 155 | MonoBehaviour: 156 | m_ObjectHideFlags: 11 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 0} 161 | m_Enabled: 1 162 | m_EditorHideFlags: 0 163 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 164 | m_Name: 165 | m_EditorClassIdentifier: 166 | version: 5 167 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar2_CT.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar2_CT 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_COOK_TORRANCE 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _OcclusionMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _ParallaxMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _SpecGlossMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_Lightmaps: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_LightmapsInd: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_ShadowMasks: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | m_Ints: [] 92 | m_Floats: 93 | - _AlphaClip: 0 94 | - _AnalyticSpecularBRDFMode: 1 95 | - _Blend: 0 96 | - _BumpScale: 0 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DiffractionCovInit_Row_1: 1 104 | - _DiffractionCovInit_Row_2: 1 105 | - _DiffractionCovInit_Row_3: 1 106 | - _DiffractionCovar_GB: 0.00316949 107 | - _DiffractionCovar_RB: 0.00305712 108 | - _DiffractionCovar_RG: 0.00377288 109 | - _DiffractionHeight: 0.00102 110 | - _DiffractionPatternToggle: 1 111 | - _DiffractionStereoSpecularity: 0.5 112 | - _DiffractionUV_ScaleX: 190 113 | - _DiffractionUV_ScaleY: 190 114 | - _DiffractionVar_B: 0.00326149 115 | - _DiffractionVar_G: 0.00396111 116 | - _DiffractionVar_R: 0.00429577 117 | - _DiffractionWidth: 2.34 118 | - _DiffractionZW_Scale: 7 119 | - _DstBlend: 0 120 | - _EnableSSAO: 1 121 | - _EnvironmentReflectionMode: 1 122 | - _EnvironmentReflections: 1 123 | - _GlossMapScale: 0 124 | - _Glossiness: 0 125 | - _GlossyReflections: 0 126 | - _HighlightDisparity: 1 127 | - _Metallic: 1 128 | - _NoiseImplementationDiffraction: 1 129 | - _NumReflRayMult: 1 130 | - _OcclusionStrength: 1 131 | - _Parallax: 0.005 132 | - _QueueOffset: 0 133 | - _ReceiveShadows: 1 134 | - _Smoothness: 0.7787 135 | - _SmoothnessTextureChannel: 0 136 | - _SpecularHighlights: 1 137 | - _SrcBlend: 1 138 | - _Surface: 0 139 | - _WorkflowMode: 1 140 | - _ZWrite: 1 141 | m_Colors: 142 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 143 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 144 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 145 | - _Color: {r: 1, g: 1, b: 1, a: 1} 146 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 147 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 148 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 149 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 150 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 151 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 152 | - _SpecColor: {r: 0.1999999, g: 0.1999999, b: 0.1999999, a: 1} 153 | m_BuildTextureStacks: [] 154 | --- !u!114 &979046647209337217 155 | MonoBehaviour: 156 | m_ObjectHideFlags: 11 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 0} 161 | m_Enabled: 1 162 | m_EditorHideFlags: 0 163 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 164 | m_Name: 165 | m_EditorClassIdentifier: 166 | version: 5 167 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar3_CT.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar3_CT 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_COOK_TORRANCE 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _OcclusionMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _ParallaxMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _SpecGlossMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_Lightmaps: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_LightmapsInd: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_ShadowMasks: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | m_Ints: [] 92 | m_Floats: 93 | - _AlphaClip: 0 94 | - _AnalyticSpecularBRDFMode: 1 95 | - _Blend: 0 96 | - _BumpScale: 0 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DiffractionCovInit_Row_1: 1 104 | - _DiffractionCovInit_Row_2: 1 105 | - _DiffractionCovInit_Row_3: 1 106 | - _DiffractionCovar_GB: 0.00316949 107 | - _DiffractionCovar_RB: 0.00305712 108 | - _DiffractionCovar_RG: 0.00377288 109 | - _DiffractionHeight: 0.00102 110 | - _DiffractionPatternToggle: 1 111 | - _DiffractionStereoSpecularity: 0.5 112 | - _DiffractionUV_ScaleX: 190 113 | - _DiffractionUV_ScaleY: 190 114 | - _DiffractionVar_B: 0.00326149 115 | - _DiffractionVar_G: 0.00396111 116 | - _DiffractionVar_R: 0.00429577 117 | - _DiffractionWidth: 2.34 118 | - _DiffractionZW_Scale: 7 119 | - _DstBlend: 0 120 | - _EnableSSAO: 1 121 | - _EnvironmentReflectionMode: 1 122 | - _EnvironmentReflections: 1 123 | - _GlossMapScale: 0 124 | - _Glossiness: 0 125 | - _GlossyReflections: 0 126 | - _HighlightDisparity: 1 127 | - _Metallic: 1 128 | - _NoiseImplementationDiffraction: 1 129 | - _NumReflRayMult: 1 130 | - _OcclusionStrength: 1 131 | - _Parallax: 0.005 132 | - _QueueOffset: 0 133 | - _ReceiveShadows: 1 134 | - _Smoothness: 0.7563 135 | - _SmoothnessTextureChannel: 0 136 | - _SpecularHighlights: 1 137 | - _SrcBlend: 1 138 | - _Surface: 0 139 | - _WorkflowMode: 1 140 | - _ZWrite: 1 141 | m_Colors: 142 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 143 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 144 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 145 | - _Color: {r: 1, g: 1, b: 1, a: 1} 146 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 147 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 148 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 149 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 150 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 151 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 152 | - _SpecColor: {r: 0.1999999, g: 0.1999999, b: 0.1999999, a: 1} 153 | m_BuildTextureStacks: [] 154 | --- !u!114 &979046647209337217 155 | MonoBehaviour: 156 | m_ObjectHideFlags: 11 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 0} 161 | m_Enabled: 1 162 | m_EditorHideFlags: 0 163 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 164 | m_Name: 165 | m_EditorClassIdentifier: 166 | version: 5 167 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar4_CT.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar4_CT 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_COOK_TORRANCE 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _OcclusionMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _ParallaxMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _SpecGlossMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_Lightmaps: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_LightmapsInd: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_ShadowMasks: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | m_Ints: [] 92 | m_Floats: 93 | - _AlphaClip: 0 94 | - _AnalyticSpecularBRDFMode: 1 95 | - _Blend: 0 96 | - _BumpScale: 0 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DiffractionCovInit_Row_1: 1 104 | - _DiffractionCovInit_Row_2: 1 105 | - _DiffractionCovInit_Row_3: 1 106 | - _DiffractionCovar_GB: 0.00316949 107 | - _DiffractionCovar_RB: 0.00305712 108 | - _DiffractionCovar_RG: 0.00377288 109 | - _DiffractionHeight: 0.00102 110 | - _DiffractionPatternToggle: 1 111 | - _DiffractionStereoSpecularity: 0.5 112 | - _DiffractionUV_ScaleX: 190 113 | - _DiffractionUV_ScaleY: 190 114 | - _DiffractionVar_B: 0.00326149 115 | - _DiffractionVar_G: 0.00396111 116 | - _DiffractionVar_R: 0.00429577 117 | - _DiffractionWidth: 2.34 118 | - _DiffractionZW_Scale: 7 119 | - _DstBlend: 0 120 | - _EnableSSAO: 1 121 | - _EnvironmentReflectionMode: 1 122 | - _EnvironmentReflections: 1 123 | - _GlossMapScale: 0 124 | - _Glossiness: 0 125 | - _GlossyReflections: 0 126 | - _HighlightDisparity: 1 127 | - _Metallic: 1 128 | - _NoiseImplementationDiffraction: 1 129 | - _NumReflRayMult: 1 130 | - _OcclusionStrength: 1 131 | - _Parallax: 0.005 132 | - _QueueOffset: 0 133 | - _ReceiveShadows: 1 134 | - _Smoothness: 0.6961 135 | - _SmoothnessTextureChannel: 0 136 | - _SpecularHighlights: 1 137 | - _SrcBlend: 1 138 | - _Surface: 0 139 | - _WorkflowMode: 1 140 | - _ZWrite: 1 141 | m_Colors: 142 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 143 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 144 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 145 | - _Color: {r: 1, g: 1, b: 1, a: 1} 146 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 147 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 148 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 149 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 150 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 151 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 152 | - _SpecColor: {r: 0.1999999, g: 0.1999999, b: 0.1999999, a: 1} 153 | m_BuildTextureStacks: [] 154 | --- !u!114 &979046647209337217 155 | MonoBehaviour: 156 | m_ObjectHideFlags: 11 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 0} 161 | m_Enabled: 1 162 | m_EditorHideFlags: 0 163 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 164 | m_Name: 165 | m_EditorClassIdentifier: 166 | version: 5 167 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar65_CT.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar65_CT 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_COOK_TORRANCE 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _OcclusionMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _ParallaxMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _SpecGlossMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - unity_Lightmaps: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_LightmapsInd: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_ShadowMasks: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | m_Ints: [] 92 | m_Floats: 93 | - _AlphaClip: 0 94 | - _AnalyticSpecularBRDFMode: 1 95 | - _Blend: 0 96 | - _BumpScale: 0 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DiffractionCovInit_Row_1: 1 104 | - _DiffractionCovInit_Row_2: 1 105 | - _DiffractionCovInit_Row_3: 1 106 | - _DiffractionCovar_GB: 0.00316949 107 | - _DiffractionCovar_RB: 0.00305712 108 | - _DiffractionCovar_RG: 0.00377288 109 | - _DiffractionHeight: 0.00102 110 | - _DiffractionPatternToggle: 1 111 | - _DiffractionStereoSpecularity: 0.5 112 | - _DiffractionUV_ScaleX: 190 113 | - _DiffractionUV_ScaleY: 190 114 | - _DiffractionVar_B: 0.00326149 115 | - _DiffractionVar_G: 0.00396111 116 | - _DiffractionVar_R: 0.00429577 117 | - _DiffractionWidth: 2.34 118 | - _DiffractionZW_Scale: 7 119 | - _DstBlend: 0 120 | - _EnableSSAO: 1 121 | - _EnvironmentReflectionMode: 1 122 | - _EnvironmentReflections: 1 123 | - _GlossMapScale: 0 124 | - _Glossiness: 0 125 | - _GlossyReflections: 0 126 | - _HighlightDisparity: 1 127 | - _Metallic: 1 128 | - _NoiseImplementationDiffraction: 1 129 | - _NumReflRayMult: 1 130 | - _OcclusionStrength: 1 131 | - _Parallax: 0.005 132 | - _QueueOffset: 0 133 | - _ReceiveShadows: 1 134 | - _Smoothness: 0.6067 135 | - _SmoothnessTextureChannel: 0 136 | - _SpecularHighlights: 1 137 | - _SrcBlend: 1 138 | - _Surface: 0 139 | - _WorkflowMode: 1 140 | - _ZWrite: 1 141 | m_Colors: 142 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 143 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 144 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 145 | - _Color: {r: 1, g: 1, b: 1, a: 1} 146 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 147 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 148 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 149 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 150 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 151 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 152 | - _SpecColor: {r: 0.1999999, g: 0.1999999, b: 0.1999999, a: 1} 153 | m_BuildTextureStacks: [] 154 | --- !u!114 &979046647209337217 155 | MonoBehaviour: 156 | m_ObjectHideFlags: 11 157 | m_CorrespondingSourceObject: {fileID: 0} 158 | m_PrefabInstance: {fileID: 0} 159 | m_PrefabAsset: {fileID: 0} 160 | m_GameObject: {fileID: 0} 161 | m_Enabled: 1 162 | m_EditorHideFlags: 0 163 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 164 | m_Name: 165 | m_EditorClassIdentifier: 166 | version: 5 167 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Assets/Materials/AluBar1_CTDP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar1_CTDP 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_DIFFRACTION 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _NoiseTexture: 68 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - _AlphaClip: 0 98 | - _AnalyticSpecularBRDFMode: 2 99 | - _Blend: 0 100 | - _BumpScale: 0 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DiffractionCovInit_Row_1: 1 108 | - _DiffractionCovInit_Row_2: 1 109 | - _DiffractionCovInit_Row_3: 1 110 | - _DiffractionCovar_GB: 0.0038606 111 | - _DiffractionCovar_RB: 0.00365479 112 | - _DiffractionCovar_RG: 0.00459325 113 | - _DiffractionHeight: 0.000766 114 | - _DiffractionPatternToggle: 1 115 | - _DiffractionStereoSpecularity: 0.5 116 | - _DiffractionUV_ScaleX: 190 117 | - _DiffractionUV_ScaleY: 190 118 | - _DiffractionVar_B: 0.00384043 119 | - _DiffractionVar_G: 0.00486094 120 | - _DiffractionVar_R: 0.00495024 121 | - _DiffractionWidth: 6.4455 122 | - _DiffractionZW_Scale: 7 123 | - _DstBlend: 0 124 | - _EnableSSAO: 1 125 | - _EnvironmentReflectionMode: 1 126 | - _EnvironmentReflections: 1 127 | - _GlossMapScale: 0 128 | - _Glossiness: 0 129 | - _GlossyReflections: 0 130 | - _HighlightDisparity: 1 131 | - _Metallic: 1 132 | - _NoiseImplementationDiffraction: 1 133 | - _NumReflRayMult: 1 134 | - _OcclusionStrength: 1 135 | - _Parallax: 0.005 136 | - _QueueOffset: 0 137 | - _ReceiveShadows: 1 138 | - _Smoothness: 0.8597 139 | - _SmoothnessTextureChannel: 0 140 | - _SpecularHighlights: 1 141 | - _SrcBlend: 1 142 | - _Surface: 0 143 | - _WorkflowMode: 1 144 | - _ZWrite: 1 145 | m_Colors: 146 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 147 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 148 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 149 | - _Color: {r: 1, g: 1, b: 1, a: 1} 150 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 151 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 152 | - _DiffractionCovInit_Row_1: {r: 0.07035794, g: 0, b: 0, a: 0} 153 | - _DiffractionCovInit_Row_2: {r: 0.06528403, g: 0.024473157, b: 0, a: 0} 154 | - _DiffractionCovInit_Row_3: {r: 0.051945668, g: 0.019179279, b: 0.02782504, a: 0} 155 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 156 | - _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1} 157 | m_BuildTextureStacks: [] 158 | --- !u!114 &979046647209337217 159 | MonoBehaviour: 160 | m_ObjectHideFlags: 11 161 | m_CorrespondingSourceObject: {fileID: 0} 162 | m_PrefabInstance: {fileID: 0} 163 | m_PrefabAsset: {fileID: 0} 164 | m_GameObject: {fileID: 0} 165 | m_Enabled: 1 166 | m_EditorHideFlags: 0 167 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 168 | m_Name: 169 | m_EditorClassIdentifier: 170 | version: 5 171 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar2_CTDP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar2_CTDP 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_DIFFRACTION 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _NoiseTexture: 68 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - _AlphaClip: 0 98 | - _AnalyticSpecularBRDFMode: 2 99 | - _Blend: 0 100 | - _BumpScale: 0 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DiffractionCovInit_Row_1: 1 108 | - _DiffractionCovInit_Row_2: 1 109 | - _DiffractionCovInit_Row_3: 1 110 | - _DiffractionCovar_GB: 0.00392202 111 | - _DiffractionCovar_RB: 0.00372348 112 | - _DiffractionCovar_RG: 0.00481732 113 | - _DiffractionHeight: 0.000973 114 | - _DiffractionPatternToggle: 1 115 | - _DiffractionStereoSpecularity: 0.5 116 | - _DiffractionUV_ScaleX: 190 117 | - _DiffractionUV_ScaleY: 190 118 | - _DiffractionVar_B: 0.00397833 119 | - _DiffractionVar_G: 0.00511689 120 | - _DiffractionVar_R: 0.00549528 121 | - _DiffractionWidth: 4.059328 122 | - _DiffractionZW_Scale: 7 123 | - _DstBlend: 0 124 | - _EnableSSAO: 1 125 | - _EnvironmentReflectionMode: 1 126 | - _EnvironmentReflections: 1 127 | - _GlossMapScale: 0 128 | - _Glossiness: 0 129 | - _GlossyReflections: 0 130 | - _HighlightDisparity: 1 131 | - _Metallic: 1 132 | - _NoiseImplementationDiffraction: 1 133 | - _NumReflRayMult: 1 134 | - _OcclusionStrength: 1 135 | - _Parallax: 0.005 136 | - _QueueOffset: 0 137 | - _ReceiveShadows: 1 138 | - _Smoothness: 0.7794 139 | - _SmoothnessTextureChannel: 0 140 | - _SpecularHighlights: 1 141 | - _SrcBlend: 1 142 | - _Surface: 0 143 | - _WorkflowMode: 1 144 | - _ZWrite: 1 145 | m_Colors: 146 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 147 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 148 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 149 | - _Color: {r: 1, g: 1, b: 1, a: 1} 150 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 151 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 152 | - _DiffractionCovInit_Row_1: {r: 0.074130155, g: 0, b: 0, a: 0} 153 | - _DiffractionCovInit_Row_2: {r: 0.06498462, g: 0.029897984, b: 0, a: 0} 154 | - _DiffractionCovInit_Row_3: {r: 0.050228953, g: 0.022005185, b: 0.03116335, a: 0} 155 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 156 | - _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1} 157 | m_BuildTextureStacks: [] 158 | --- !u!114 &979046647209337217 159 | MonoBehaviour: 160 | m_ObjectHideFlags: 11 161 | m_CorrespondingSourceObject: {fileID: 0} 162 | m_PrefabInstance: {fileID: 0} 163 | m_PrefabAsset: {fileID: 0} 164 | m_GameObject: {fileID: 0} 165 | m_Enabled: 1 166 | m_EditorHideFlags: 0 167 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 168 | m_Name: 169 | m_EditorClassIdentifier: 170 | version: 5 171 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar65_CTDP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar65_CTDP 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_DIFFRACTION 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _NoiseTexture: 68 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - _AlphaClip: 0 98 | - _AnalyticSpecularBRDFMode: 2 99 | - _Blend: 0 100 | - _BumpScale: 0 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DiffractionCovInit_Row_1: 1 108 | - _DiffractionCovInit_Row_2: 1 109 | - _DiffractionCovInit_Row_3: 1 110 | - _DiffractionCovar_GB: 0.00316949 111 | - _DiffractionCovar_RB: 0.00305712 112 | - _DiffractionCovar_RG: 0.00377288 113 | - _DiffractionHeight: 0.00102538 114 | - _DiffractionPatternToggle: 1 115 | - _DiffractionStereoSpecularity: 0.5 116 | - _DiffractionUV_ScaleX: 190 117 | - _DiffractionUV_ScaleY: 190 118 | - _DiffractionVar_B: 0.00326149 119 | - _DiffractionVar_G: 0.00396111 120 | - _DiffractionVar_R: 0.00429577 121 | - _DiffractionWidth: 2.34 122 | - _DiffractionZW_Scale: 7 123 | - _DstBlend: 0 124 | - _EnableSSAO: 1 125 | - _EnvironmentReflectionMode: 1 126 | - _EnvironmentReflections: 1 127 | - _GlossMapScale: 0 128 | - _Glossiness: 0 129 | - _GlossyReflections: 0 130 | - _HighlightDisparity: 1 131 | - _Metallic: 1 132 | - _NoiseImplementationDiffraction: 1 133 | - _NumReflRayMult: 1 134 | - _OcclusionStrength: 1 135 | - _Parallax: 0.005 136 | - _QueueOffset: 0 137 | - _ReceiveShadows: 1 138 | - _Smoothness: 0.6078 139 | - _SmoothnessTextureChannel: 0 140 | - _SpecularHighlights: 1 141 | - _SrcBlend: 1 142 | - _Surface: 0 143 | - _WorkflowMode: 1 144 | - _ZWrite: 1 145 | m_Colors: 146 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 147 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 148 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 149 | - _Color: {r: 1, g: 1, b: 1, a: 1} 150 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 151 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 152 | - _DiffractionCovInit_Row_1: {r: 0.065542124, g: 0, b: 0, a: 0} 153 | - _DiffractionCovInit_Row_2: {r: 0.0575642, g: 0.02544549, b: 0, a: 0} 154 | - _DiffractionCovInit_Row_3: {r: 0.04664359, g: 0.019040275, b: 0.026894862, a: 0} 155 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 156 | - _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1} 157 | m_BuildTextureStacks: [] 158 | --- !u!114 &979046647209337217 159 | MonoBehaviour: 160 | m_ObjectHideFlags: 11 161 | m_CorrespondingSourceObject: {fileID: 0} 162 | m_PrefabInstance: {fileID: 0} 163 | m_PrefabAsset: {fileID: 0} 164 | m_GameObject: {fileID: 0} 165 | m_Enabled: 1 166 | m_EditorHideFlags: 0 167 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 168 | m_Name: 169 | m_EditorClassIdentifier: 170 | version: 5 171 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar3_CTDP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar3_CTDP 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_DIFFRACTION 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _NoiseTexture: 68 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - _AlphaClip: 0 98 | - _AnalyticSpecularBRDFMode: 2 99 | - _Blend: 0 100 | - _BumpScale: 0 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DiffractionCovInit_Row_1: 1 108 | - _DiffractionCovInit_Row_2: 1 109 | - _DiffractionCovInit_Row_3: 1 110 | - _DiffractionCovar_GB: 0.0048422 111 | - _DiffractionCovar_RB: 0.00451132 112 | - _DiffractionCovar_RG: 0.0058099 113 | - _DiffractionHeight: 0.00076 114 | - _DiffractionPatternToggle: 1 115 | - _DiffractionStereoSpecularity: 0.5 116 | - _DiffractionUV_ScaleX: 190 117 | - _DiffractionUV_ScaleY: 190 118 | - _DiffractionVar_B: 0.00534889 119 | - _DiffractionVar_G: 0.00631164 120 | - _DiffractionVar_R: 0.00658398 121 | - _DiffractionWidth: 3.554 122 | - _DiffractionZW_Scale: 7 123 | - _DstBlend: 0 124 | - _EnableSSAO: 1 125 | - _EnvironmentReflectionMode: 1 126 | - _EnvironmentReflections: 1 127 | - _GlossMapScale: 0 128 | - _Glossiness: 0 129 | - _GlossyReflections: 0 130 | - _HighlightDisparity: 1 131 | - _Metallic: 1 132 | - _NoiseImplementationDiffraction: 1 133 | - _NumReflRayMult: 1 134 | - _OcclusionStrength: 1 135 | - _Parallax: 0.005 136 | - _QueueOffset: 0 137 | - _ReceiveShadows: 1 138 | - _Smoothness: 0.7573 139 | - _SmoothnessTextureChannel: 0 140 | - _SpecularHighlights: 1 141 | - _SrcBlend: 1 142 | - _Surface: 0 143 | - _WorkflowMode: 1 144 | - _ZWrite: 1 145 | m_Colors: 146 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 147 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 148 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 149 | - _Color: {r: 1, g: 1, b: 1, a: 1} 150 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 151 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 152 | - _DiffractionCovInit_Row_1: {r: 0.081141725, g: 0, b: 0, a: 0} 153 | - _DiffractionCovInit_Row_2: {r: 0.071601875, g: 0.034421094, b: 0, a: 0} 154 | - _DiffractionCovInit_Row_3: {r: 0.055598028, g: 0.025021775, b: 0.040393814, 155 | a: 0} 156 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 157 | - _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1} 158 | m_BuildTextureStacks: [] 159 | --- !u!114 &979046647209337217 160 | MonoBehaviour: 161 | m_ObjectHideFlags: 11 162 | m_CorrespondingSourceObject: {fileID: 0} 163 | m_PrefabInstance: {fileID: 0} 164 | m_PrefabAsset: {fileID: 0} 165 | m_GameObject: {fileID: 0} 166 | m_Enabled: 1 167 | m_EditorHideFlags: 0 168 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 169 | m_Name: 170 | m_EditorClassIdentifier: 171 | version: 5 172 | -------------------------------------------------------------------------------- /Assets/Materials/AluBar4_CTDP.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AluBar4_CTDP 11 | m_Shader: {fileID: 4800000, guid: 54bb6a1c988ba594293fe5a1d41a15d5, type: 3} 12 | m_ValidKeywords: 13 | - _DIFFRACTION_PATTERN_OPEN_SIMPLEX_2 14 | - _DIRECT_LIGHT_BRDF_DIFFRACTION 15 | - _DIRECT_LIGHT_BRDF_DIFFRACTION_PATTERN 16 | m_InvalidKeywords: [] 17 | m_LightmapFlags: 4 18 | m_EnableInstancingVariants: 0 19 | m_DoubleSidedGI: 0 20 | m_CustomRenderQueue: -1 21 | stringTagMap: 22 | RenderType: Opaque 23 | disabledShaderPasses: [] 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _BaseMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BumpMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _CustomReflProbe: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _DetailAlbedoMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailMask: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailNormalMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DiffractionPatternTexture: 52 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _EmissionMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _MainTex: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _MetallicGlossMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _NoiseTexture: 68 | m_Texture: {fileID: 2800000, guid: c8f624bf620139a41acf3cabf643cebe, type: 3} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _OcclusionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _ParallaxMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _SpecGlossMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - unity_Lightmaps: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - unity_LightmapsInd: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - unity_ShadowMasks: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | m_Ints: [] 96 | m_Floats: 97 | - _AlphaClip: 0 98 | - _AnalyticSpecularBRDFMode: 2 99 | - _Blend: 0 100 | - _BumpScale: 0 101 | - _ClearCoatMask: 0 102 | - _ClearCoatSmoothness: 0 103 | - _Cull: 2 104 | - _Cutoff: 0.5 105 | - _DetailAlbedoMapScale: 1 106 | - _DetailNormalMapScale: 1 107 | - _DiffractionCovInit_Row_1: 1 108 | - _DiffractionCovInit_Row_2: 1 109 | - _DiffractionCovInit_Row_3: 1 110 | - _DiffractionCovar_GB: 0.0042031 111 | - _DiffractionCovar_RB: 0.00389503 112 | - _DiffractionCovar_RG: 0.00494862 113 | - _DiffractionHeight: 0.00071 114 | - _DiffractionPatternToggle: 1 115 | - _DiffractionStereoSpecularity: 0.5 116 | - _DiffractionUV_ScaleX: 190 117 | - _DiffractionUV_ScaleY: 190 118 | - _DiffractionVar_B: 0.00457381 119 | - _DiffractionVar_G: 0.005369 120 | - _DiffractionVar_R: 0.00565222 121 | - _DiffractionWidth: 2.792 122 | - _DiffractionZW_Scale: 7 123 | - _DstBlend: 0 124 | - _EnableSSAO: 1 125 | - _EnvironmentReflectionMode: 1 126 | - _EnvironmentReflections: 1 127 | - _GlossMapScale: 0 128 | - _Glossiness: 0 129 | - _GlossyReflections: 0 130 | - _HighlightDisparity: 1 131 | - _Metallic: 1 132 | - _NoiseImplementationDiffraction: 1 133 | - _NumReflRayMult: 1 134 | - _OcclusionStrength: 1 135 | - _Parallax: 0.005 136 | - _QueueOffset: 0 137 | - _ReceiveShadows: 1 138 | - _Smoothness: 0.6967 139 | - _SmoothnessTextureChannel: 0 140 | - _SpecularHighlights: 1 141 | - _SrcBlend: 1 142 | - _Surface: 0 143 | - _WorkflowMode: 1 144 | - _ZWrite: 1 145 | m_Colors: 146 | - _BakedReflLeftEye: {r: 0, g: 0, b: 0, a: 0} 147 | - _BakedReflRightEye: {r: 0, g: 0, b: 0, a: 0} 148 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 149 | - _Color: {r: 1, g: 1, b: 1, a: 1} 150 | - _CustomReflProbeExtent: {r: 0, g: 0, b: 0, a: 0} 151 | - _CustomReflProbePos: {r: 0, g: 0, b: 0, a: 0} 152 | - _DiffractionCovInit_Row_1: {r: 0.075181246, g: 0, b: 0, a: 0} 153 | - _DiffractionCovInit_Row_2: {r: 0.065822534, g: 0.032193072, b: 0, a: 0} 154 | - _DiffractionCovInit_Row_3: {r: 0.051808532, g: 0.024630494, b: 0.035819333, 155 | a: 0} 156 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 157 | - _SpecColor: {r: 0.19999993, g: 0.19999993, b: 0.19999993, a: 1} 158 | m_BuildTextureStacks: [] 159 | --- !u!114 &979046647209337217 160 | MonoBehaviour: 161 | m_ObjectHideFlags: 11 162 | m_CorrespondingSourceObject: {fileID: 0} 163 | m_PrefabInstance: {fileID: 0} 164 | m_PrefabAsset: {fileID: 0} 165 | m_GameObject: {fileID: 0} 166 | m_Enabled: 1 167 | m_EditorHideFlags: 0 168 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 169 | m_Name: 170 | m_EditorClassIdentifier: 171 | version: 5 172 | -------------------------------------------------------------------------------- /Assets/Shaders/OpenSimplex2.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef NOISE_SIMPLEX_FUNC 2 | #define NOISE_SIMPLEX_FUNC 3 | 4 | 5 | float _DiffractionDistanceEncodingA; 6 | float _DiffractionDistanceEncodingB; 7 | 8 | float4 _DiffractionCovInit_Row_1; 9 | float4 _DiffractionCovInit_Row_2; 10 | float4 _DiffractionCovInit_Row_3; 11 | 12 | float _DiffractionStereoSpecularity; 13 | float _DiffractionZW_Scale; 14 | float _DiffractionUV_ScaleX; 15 | float _DiffractionUV_ScaleY; 16 | float _DebuggingVariable; 17 | 18 | const static float2 MASK_2X2_GRID[4] = 19 | { 20 | float2(-0.25, 0.25), 21 | float2(0.25, 0.25), 22 | float2(-0.25, -0.25), 23 | float2(0.25, -0.25), 24 | }; 25 | 26 | 27 | /////////////// K.jpg's Simplex-like Re-oriented 4-Point BCC Noise /////////////// 28 | //////////////////// Output: float4(dF/dx, dF/dy, dF/dz, value) //////////////////// 29 | 30 | // Inspired by Stefan Gustavson's noise 31 | float4 permute(float4 t) 32 | { 33 | return t * (t * 34.0 + 133.0); 34 | } 35 | 36 | // https://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod 37 | float mod(float x, float y) 38 | { 39 | return x - y * floor(x / y); 40 | } 41 | 42 | float2 mod(float2 x, float2 y) 43 | { 44 | return x - y * floor(x / y); 45 | } 46 | 47 | float3 mod(float3 x, float3 y) 48 | { 49 | return x - y * floor(x / y); 50 | } 51 | 52 | float4 mod(float4 x, float4 y) 53 | { 54 | return x - y * floor(x / y); 55 | } 56 | 57 | // Gradient set is a normalized expanded rhombic dodecahedron 58 | float3 grad(float hash) 59 | { 60 | // Random vertex of a cube, +/- 1 each 61 | float3 cube = mod(floor(hash / float3(1.0, 2.0, 4.0)), 2.0) * 2.0 - 1.0; 62 | 63 | // Random edge of the three edges connected to that vertex 64 | // Also a cuboctahedral vertex 65 | // And corresponds to the face of its dual, the rhombic dodecahedron 66 | float3 cuboct = cube; 67 | 68 | int index = int(hash / 16.0); 69 | 70 | if (index == 0) 71 | cuboct.x = 0.0; 72 | else if (index == 1) 73 | cuboct.y = 0.0; 74 | else 75 | cuboct.z = 0.0; 76 | 77 | 78 | float type = mod(floor(hash / 8.0), 2.0); 79 | float3 rhomb = (1.0 - type) * cube + type * (cuboct + cross(cube, cuboct)); 80 | 81 | // Expand it so that the new edges are the same length 82 | // as the existing ones 83 | float3 grad = cuboct * 1.22474487139 + rhomb; 84 | 85 | // To make all gradients the same length, we only need to shorten the 86 | // second type of vector. We also put in the whole noise scale constant. 87 | // The compiler should reduce it into the existing floats. I think. 88 | grad *= (1.0 - 0.042942436724648037 * type) * 32.80201376986577; 89 | 90 | return grad; 91 | } 92 | 93 | // BCC lattice split up into 2 cube lattices 94 | float4 openSimplex2Base(float3 X) 95 | { 96 | // First half-lattice, closest edge 97 | float3 v1 = round(X); 98 | float3 d1 = X - v1; 99 | float3 score1 = abs(d1); 100 | float3 dir1 = step(max(score1.yzx, score1.zxy), score1); 101 | float3 v2 = v1 + dir1 * sign(d1); 102 | float3 d2 = X - v2; 103 | 104 | // Second half-lattice, closest edge 105 | float3 X2 = X + 144.5; 106 | float3 v3 = round(X2); 107 | float3 d3 = X2 - v3; 108 | float3 score2 = abs(d3); 109 | float3 dir2 = step(max(score2.yzx, score2.zxy), score2); 110 | float3 v4 = v3 + dir2 * sign(d3); 111 | float3 d4 = X2 - v4; 112 | 113 | // Gradient hashes for the four points, two from each half-lattice 114 | float4 hashes = permute(mod(float4(v1.x, v2.x, v3.x, v4.x), 289.0)); 115 | hashes = permute(mod(hashes + float4(v1.y, v2.y, v3.y, v4.y), 289.0)); 116 | hashes = mod(permute(mod(hashes + float4(v1.z, v2.z, v3.z, v4.z), 289.0)), 48.0); 117 | 118 | // Gradient extrapolations & kernel function 119 | float4 a = max(0.5 - float4(dot(d1, d1), dot(d2, d2), dot(d3, d3), dot(d4, d4)), 0.0); 120 | float4 aa = a * a; 121 | float4 aaaa = aa * aa; 122 | float3 g1 = grad(hashes.x); 123 | float3 g2 = grad(hashes.y); 124 | float3 g3 = grad(hashes.z); 125 | float3 g4 = grad(hashes.w); 126 | float4 extrapolations = float4(dot(d1, g1), dot(d2, g2), dot(d3, g3), dot(d4, g4)); 127 | 128 | float4x3 derivativeMatrix = { d1, d2, d3, d4 }; 129 | float4x3 gradientMatrix = { g1, g2, g3, g4 }; 130 | 131 | // Derivatives of the noise 132 | float3 derivative = -8.0 * mul(aa * a * extrapolations, derivativeMatrix) 133 | + mul(aaaa, gradientMatrix); 134 | 135 | // Return it all as a float4 136 | return float4(derivative, dot(aaaa, extrapolations)); 137 | } 138 | 139 | // Use this if you don't want Z to look different from X and Y 140 | float4 openSimplex2_Conventional(float3 X) 141 | { 142 | // Rotate around the main diagonal. Not a skew transform. 143 | float4 result = openSimplex2Base(dot(X, float3(2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0)) - X); 144 | return float4(dot(result.xyz, float3(2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0)) - result.xyz, result.w); 145 | } 146 | 147 | // Use this if you want to show X and Y in a plane, then use Z for time, vertical, etc. 148 | float4 openSimplex2_ImproveXY(float3 X) 149 | { 150 | // Rotate so Z points down the main diagonal. Not a skew transform. 151 | float3x3 orthonormalMap = 152 | { 153 | 0.788675134594813, -0.211324865405187, -0.577350269189626, 154 | -0.211324865405187, 0.788675134594813, -0.577350269189626, 155 | 0.577350269189626, 0.577350269189626, 0.577350269189626 156 | }; 157 | 158 | float4 result = openSimplex2Base(mul(X, orthonormalMap)); 159 | return float4(mul(orthonormalMap, result.xyz), result.w); 160 | } 161 | 162 | // Adapter function with the same name and parameters as originalSimplex 163 | float snoise(float3 X) 164 | { 165 | float4 result = openSimplex2_ImproveXY(X); 166 | return result.w; 167 | } 168 | 169 | // Adapter function with the same name and parameters as originalSimplex 170 | float snoise(float4 X) 171 | { 172 | float4 result = openSimplex2_ImproveXY(X.xyz); 173 | return result.w; 174 | } 175 | 176 | //////////////////////////////// End noise code //////////////////////////////// 177 | 178 | #endif 179 | -------------------------------------------------------------------------------- /Assets/Shaders/Input.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef UNIVERSAL_INPUT_INCLUDED 2 | #define UNIVERSAL_INPUT_INCLUDED 3 | 4 | #define MAX_VISIBLE_LIGHTS_UBO 32 5 | #define MAX_VISIBLE_LIGHTS_SSBO 256 6 | 7 | // Keep in sync with RenderingUtils.useStructuredBuffer 8 | #define USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA 0 9 | 10 | #define RENDERING_LIGHT_LAYERS_MASK (255) 11 | #define RENDERING_LIGHT_LAYERS_MASK_SHIFT (0) 12 | #define DEFAULT_LIGHT_LAYERS (RENDERING_LIGHT_LAYERS_MASK >> RENDERING_LIGHT_LAYERS_MASK_SHIFT) 13 | 14 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderTypes.cs.hlsl" 15 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Deprecated.hlsl" 16 | 17 | // Must match: UniversalRenderPipeline.maxVisibleAdditionalLights 18 | #if defined(SHADER_API_MOBILE) && (defined(SHADER_API_GLES) || defined(SHADER_API_GLES30)) 19 | #define MAX_VISIBLE_LIGHTS 16 20 | #elif defined(SHADER_API_MOBILE) || (defined(SHADER_API_GLCORE) && !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) // Workaround because SHADER_API_GLCORE is also defined when SHADER_API_SWITCH is 21 | #define MAX_VISIBLE_LIGHTS 32 22 | #else 23 | #define MAX_VISIBLE_LIGHTS 256 24 | #endif 25 | 26 | // Match with values in UniversalRenderPipeline.cs 27 | #define MAX_ZBIN_VEC4S 1024 28 | #define MAX_TILE_VEC4S 4096 29 | #if MAX_VISIBLE_LIGHTS < 32 30 | #define LIGHTS_PER_TILE 32 31 | #else 32 | #define LIGHTS_PER_TILE MAX_VISIBLE_LIGHTS 33 | #endif 34 | 35 | struct InputData 36 | { 37 | float3 positionWS; 38 | float4 positionCS; 39 | half3 normalWS; 40 | half3 viewDirectionWS; 41 | float4 shadowCoord; 42 | half fogCoord; 43 | half3 vertexLighting; 44 | half3 bakedGI; 45 | float2 normalizedScreenSpaceUV; 46 | half4 shadowMask; 47 | half3x3 tangentToWorld; 48 | 49 | // Clausen BRDF 50 | #if defined _DIRECT_LIGHT_BRDF_DIFFRACTION 51 | float2 uvs; 52 | #endif 53 | // Clausen BRDF 54 | 55 | 56 | #if defined(DEBUG_DISPLAY) 57 | half2 dynamicLightmapUV; 58 | half2 staticLightmapUV; 59 | float3 vertexSH; 60 | 61 | half3 brdfDiffuse; 62 | half3 brdfSpecular; 63 | float2 uv; 64 | uint mipCount; 65 | 66 | // texelSize : 67 | // x = 1 / width 68 | // y = 1 / height 69 | // z = width 70 | // w = height 71 | float4 texelSize; 72 | 73 | // mipInfo : 74 | // x = quality settings minStreamingMipLevel 75 | // y = original mip count for texture 76 | // z = desired on screen mip level 77 | // w = loaded mip level 78 | float4 mipInfo; 79 | #endif 80 | }; 81 | 82 | /////////////////////////////////////////////////////////////////////////////// 83 | // Constant Buffers // 84 | /////////////////////////////////////////////////////////////////////////////// 85 | 86 | half4 _GlossyEnvironmentColor; 87 | half4 _SubtractiveShadowColor; 88 | 89 | half4 _GlossyEnvironmentCubeMap_HDR; 90 | TEXTURECUBE(_GlossyEnvironmentCubeMap); 91 | SAMPLER(sampler_GlossyEnvironmentCubeMap); 92 | 93 | #define _InvCameraViewProj unity_MatrixInvVP 94 | float4 _ScaledScreenParams; 95 | 96 | float4 _MainLightPosition; 97 | half4 _MainLightColor; 98 | half4 _MainLightOcclusionProbes; 99 | uint _MainLightLayerMask; 100 | 101 | // xyz are currently unused 102 | // w: directLightStrength 103 | half4 _AmbientOcclusionParam; 104 | 105 | half4 _AdditionalLightsCount; 106 | 107 | #if USE_CLUSTERED_LIGHTING 108 | // Directional lights would be in all clusters, so they don't go into the cluster structure. 109 | // Instead, they are stored first in the light buffer. 110 | uint _AdditionalLightsDirectionalCount; 111 | // The number of Z-bins to skip based on near plane distance. 112 | uint _AdditionalLightsZBinOffset; 113 | // Scale from view-space Z to Z-bin. 114 | float _AdditionalLightsZBinScale; 115 | // Scale from screen-space UV [0, 1] to tile coordinates [0, tile resolution]. 116 | float2 _AdditionalLightsTileScale; 117 | uint _AdditionalLightsTileCountX; 118 | #endif 119 | 120 | #if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA 121 | StructuredBuffer _AdditionalLightsBuffer; 122 | StructuredBuffer _AdditionalLightsIndices; 123 | #else 124 | // GLES3 causes a performance regression in some devices when using CBUFFER. 125 | #ifndef SHADER_API_GLES3 126 | CBUFFER_START(AdditionalLights) 127 | #endif 128 | float4 _AdditionalLightsPosition[MAX_VISIBLE_LIGHTS]; 129 | half4 _AdditionalLightsColor[MAX_VISIBLE_LIGHTS]; 130 | half4 _AdditionalLightsAttenuation[MAX_VISIBLE_LIGHTS]; 131 | half4 _AdditionalLightsSpotDir[MAX_VISIBLE_LIGHTS]; 132 | half4 _AdditionalLightsOcclusionProbes[MAX_VISIBLE_LIGHTS]; 133 | float _AdditionalLightsLayerMasks[MAX_VISIBLE_LIGHTS]; // we want uint[] but Unity api does not support it. 134 | #ifndef SHADER_API_GLES3 135 | CBUFFER_END 136 | #endif 137 | #endif 138 | 139 | #if USE_CLUSTERED_LIGHTING 140 | CBUFFER_START(AdditionalLightsZBins) 141 | float4 _AdditionalLightsZBins[MAX_ZBIN_VEC4S]; 142 | CBUFFER_END 143 | CBUFFER_START(AdditionalLightsTiles) 144 | float4 _AdditionalLightsTiles[MAX_TILE_VEC4S]; 145 | CBUFFER_END 146 | #endif 147 | 148 | #define UNITY_MATRIX_M unity_ObjectToWorld 149 | #define UNITY_MATRIX_I_M unity_WorldToObject 150 | #define UNITY_MATRIX_V unity_MatrixV 151 | #define UNITY_MATRIX_I_V unity_MatrixInvV 152 | #define UNITY_MATRIX_P OptimizeProjectionMatrix(glstate_matrix_projection) 153 | #define UNITY_MATRIX_I_P unity_MatrixInvP 154 | #define UNITY_MATRIX_VP unity_MatrixVP 155 | #define UNITY_MATRIX_I_VP unity_MatrixInvVP 156 | #define UNITY_MATRIX_MV mul(UNITY_MATRIX_V, UNITY_MATRIX_M) 157 | #define UNITY_MATRIX_T_MV transpose(UNITY_MATRIX_MV) 158 | #define UNITY_MATRIX_IT_MV transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) 159 | #define UNITY_MATRIX_MVP mul(UNITY_MATRIX_VP, UNITY_MATRIX_M) 160 | #define UNITY_PREV_MATRIX_M unity_MatrixPreviousM 161 | #define UNITY_PREV_MATRIX_I_M unity_MatrixPreviousMI 162 | 163 | // Note: #include order is important here. 164 | // UnityInput.hlsl must be included before UnityInstancing.hlsl, so constant buffer 165 | // declarations don't fail because of instancing macros. 166 | // UniversalDOTSInstancing.hlsl must be included after UnityInstancing.hlsl 167 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl" 168 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl" 169 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl" 170 | 171 | // VFX may also redefine UNITY_MATRIX_M / UNITY_MATRIX_I_M as static per-particle global matrices. 172 | #ifdef HAVE_VFX_MODIFICATION 173 | #include "Packages/com.unity.visualeffectgraph/Shaders/VFXMatricesOverride.hlsl" 174 | #endif 175 | 176 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl" 177 | 178 | #endif 179 | -------------------------------------------------------------------------------- /Assets/Shaders/LitForwardPass.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef UNIVERSAL_FORWARD_LIT_PASS_INCLUDED 2 | #define UNIVERSAL_FORWARD_LIT_PASS_INCLUDED 3 | 4 | #include "Assets/Shaders/Lighting.hlsl" 5 | 6 | // GLES2 has limited amount of interpolators 7 | #if defined(_PARALLAXMAP) && !defined(SHADER_API_GLES) 8 | #define REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR 9 | #endif 10 | 11 | #if (defined(_NORMALMAP) || (defined(_PARALLAXMAP) && !defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR))) || defined(_DETAIL) 12 | #define REQUIRES_WORLD_SPACE_TANGENT_INTERPOLATOR 13 | #endif 14 | 15 | // keep this file in sync with LitGBufferPass.hlsl 16 | 17 | struct Attributes 18 | { 19 | float4 positionOS : POSITION; 20 | float3 normalOS : NORMAL; 21 | float4 tangentOS : TANGENT; 22 | float2 texcoord : TEXCOORD0; 23 | float2 staticLightmapUV : TEXCOORD1; 24 | float2 dynamicLightmapUV : TEXCOORD2; 25 | UNITY_VERTEX_INPUT_INSTANCE_ID 26 | }; 27 | 28 | struct Varyings 29 | { 30 | float2 uv : TEXCOORD0; 31 | 32 | #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR) 33 | float3 positionWS : TEXCOORD1; 34 | #endif 35 | 36 | float3 normalWS : TEXCOORD2; 37 | #if defined(REQUIRES_WORLD_SPACE_TANGENT_INTERPOLATOR) 38 | half4 tangentWS : TEXCOORD3; // xyz: tangent, w: sign 39 | #endif 40 | float3 viewDirWS : TEXCOORD4; 41 | 42 | #ifdef _ADDITIONAL_LIGHTS_VERTEX 43 | half4 fogFactorAndVertexLight : TEXCOORD5; // x: fogFactor, yzw: vertex light 44 | #else 45 | half fogFactor : TEXCOORD5; 46 | #endif 47 | 48 | #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) 49 | float4 shadowCoord : TEXCOORD6; 50 | #endif 51 | 52 | #if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR) 53 | half3 viewDirTS : TEXCOORD7; 54 | #endif 55 | 56 | DECLARE_LIGHTMAP_OR_SH(staticLightmapUV, vertexSH, 8); 57 | #ifdef DYNAMICLIGHTMAP_ON 58 | float2 dynamicLightmapUV : TEXCOORD9; // Dynamic lightmap UVs 59 | #endif 60 | 61 | float4 positionCS : SV_POSITION; 62 | UNITY_VERTEX_INPUT_INSTANCE_ID 63 | UNITY_VERTEX_OUTPUT_STEREO 64 | }; 65 | 66 | void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData) 67 | { 68 | inputData = (InputData)0; 69 | 70 | #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR) 71 | inputData.positionWS = input.positionWS; 72 | #endif 73 | 74 | half3 viewDirWS = GetWorldSpaceNormalizeViewDir(input.positionWS); 75 | #if defined(_NORMALMAP) || defined(_DETAIL) 76 | float sgn = input.tangentWS.w; // should be either +1 or -1 77 | float3 bitangent = sgn * cross(input.normalWS.xyz, input.tangentWS.xyz); 78 | half3x3 tangentToWorld = half3x3(input.tangentWS.xyz, bitangent.xyz, input.normalWS.xyz); 79 | 80 | #if defined(_NORMALMAP) 81 | inputData.tangentToWorld = tangentToWorld; 82 | #endif 83 | inputData.normalWS = TransformTangentToWorld(normalTS, tangentToWorld); 84 | #else 85 | inputData.normalWS = input.normalWS; 86 | #endif 87 | 88 | inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); 89 | inputData.viewDirectionWS = viewDirWS; 90 | 91 | #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) 92 | inputData.shadowCoord = input.shadowCoord; 93 | #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) 94 | inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); 95 | #else 96 | inputData.shadowCoord = float4(0, 0, 0, 0); 97 | #endif 98 | #ifdef _ADDITIONAL_LIGHTS_VERTEX 99 | inputData.fogCoord = InitializeInputDataFog(float4(input.positionWS, 1.0), input.fogFactorAndVertexLight.x); 100 | inputData.vertexLighting = input.fogFactorAndVertexLight.yzw; 101 | #else 102 | inputData.fogCoord = InitializeInputDataFog(float4(input.positionWS, 1.0), input.fogFactor); 103 | #endif 104 | 105 | #if defined(DYNAMICLIGHTMAP_ON) 106 | inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS); 107 | #else 108 | inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS); 109 | #endif 110 | 111 | inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); 112 | inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV); 113 | 114 | #if defined(DEBUG_DISPLAY) 115 | #if defined(DYNAMICLIGHTMAP_ON) 116 | inputData.dynamicLightmapUV = input.dynamicLightmapUV; 117 | #endif 118 | #if defined(LIGHTMAP_ON) 119 | inputData.staticLightmapUV = input.staticLightmapUV; 120 | #else 121 | inputData.vertexSH = input.vertexSH; 122 | #endif 123 | #endif 124 | } 125 | 126 | /////////////////////////////////////////////////////////////////////////////// 127 | // Vertex and Fragment functions // 128 | /////////////////////////////////////////////////////////////////////////////// 129 | 130 | // Used in Standard (Physically Based) shader 131 | Varyings LitPassVertex(Attributes input) 132 | { 133 | Varyings output = (Varyings)0; 134 | 135 | UNITY_SETUP_INSTANCE_ID(input); 136 | UNITY_TRANSFER_INSTANCE_ID(input, output); 137 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); 138 | 139 | VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz); 140 | 141 | // normalWS and tangentWS already normalize. 142 | // this is required to avoid skewing the direction during interpolation 143 | // also required for per-vertex lighting and SH evaluation 144 | VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS); 145 | 146 | half3 vertexLight = VertexLighting(vertexInput.positionWS, normalInput.normalWS); 147 | 148 | half fogFactor = 0; 149 | #if !defined(_FOG_FRAGMENT) 150 | fogFactor = ComputeFogFactor(vertexInput.positionCS.z); 151 | #endif 152 | 153 | output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap); 154 | 155 | // already normalized from normal transform to WS. 156 | output.normalWS = normalInput.normalWS; 157 | #if defined(REQUIRES_WORLD_SPACE_TANGENT_INTERPOLATOR) || defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR) 158 | real sign = input.tangentOS.w * GetOddNegativeScale(); 159 | half4 tangentWS = half4(normalInput.tangentWS.xyz, sign); 160 | #endif 161 | #if defined(REQUIRES_WORLD_SPACE_TANGENT_INTERPOLATOR) 162 | output.tangentWS = tangentWS; 163 | #endif 164 | 165 | #if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR) 166 | half3 viewDirWS = GetWorldSpaceNormalizeViewDir(vertexInput.positionWS); 167 | half3 viewDirTS = GetViewDirectionTangentSpace(tangentWS, output.normalWS, viewDirWS); 168 | output.viewDirTS = viewDirTS; 169 | #endif 170 | 171 | OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV); 172 | #ifdef DYNAMICLIGHTMAP_ON 173 | output.dynamicLightmapUV = input.dynamicLightmapUV.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; 174 | #endif 175 | OUTPUT_SH(output.normalWS.xyz, output.vertexSH); 176 | #ifdef _ADDITIONAL_LIGHTS_VERTEX 177 | output.fogFactorAndVertexLight = half4(fogFactor, vertexLight); 178 | #else 179 | output.fogFactor = fogFactor; 180 | #endif 181 | 182 | #if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR) 183 | output.positionWS = vertexInput.positionWS; 184 | #endif 185 | 186 | #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) 187 | output.shadowCoord = GetShadowCoord(vertexInput); 188 | #endif 189 | 190 | output.positionCS = vertexInput.positionCS; 191 | 192 | return output; 193 | } 194 | 195 | // Used in Standard (Physically Based) shader 196 | half4 LitPassFragment(Varyings input) : SV_Target 197 | { 198 | UNITY_SETUP_INSTANCE_ID(input); 199 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); 200 | 201 | #if defined(_PARALLAXMAP) 202 | #if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR) 203 | half3 viewDirTS = input.viewDirTS; 204 | #else 205 | half3 viewDirWS = GetWorldSpaceNormalizeViewDir(input.positionWS); 206 | half3 viewDirTS = GetViewDirectionTangentSpace(input.tangentWS, input.normalWS, viewDirWS); 207 | #endif 208 | ApplyPerPixelDisplacement(viewDirTS, input.uv); 209 | #endif 210 | 211 | SurfaceData surfaceData; 212 | InitializeStandardLitSurfaceData(input.uv, surfaceData); 213 | 214 | InputData inputData; 215 | InitializeInputData(input, surfaceData.normalTS, inputData); 216 | // Clausen BRDF 217 | #if defined _DIRECT_LIGHT_BRDF_DIFFRACTION 218 | inputData.uvs = input.uv; 219 | #endif 220 | // Clausen BRDF 221 | 222 | SETUP_DEBUG_TEXTURE_DATA(inputData, input.uv, _BaseMap); 223 | 224 | #ifdef _DBUFFER 225 | ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData); 226 | #endif 227 | 228 | half4 color = UniversalFragmentPBR(inputData, surfaceData); 229 | 230 | color.rgb = MixFog(color.rgb, inputData.fogCoord); 231 | color.a = OutputAlpha(color.a, _Surface); 232 | 233 | return color; 234 | } 235 | 236 | #endif 237 | -------------------------------------------------------------------------------- /Assets/Editor/CustomLitMaterial/DiffractionLitShader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace UnityEditor.Rendering.Universal.ShaderGUI 6 | { 7 | internal class DiffractionLitShader : BaseShaderGUI 8 | { 9 | static readonly string[] workflowModeNames = Enum.GetNames(typeof(DiffractionLitGUI.WorkflowMode)); 10 | static readonly string[] analyticSpecularBRDFModeNames = Enum.GetNames(typeof(DiffractionLitGUI.AnalyticSpecularBRDFMode)); 11 | static readonly string[] noiseModeNames = Enum.GetNames(typeof(DiffractionLitGUI.NoiseImplementation)); 12 | 13 | private DiffractionLitGUI.LitProperties litProperties; 14 | private DiffractionLitDetailGUI.LitProperties litDetailProperties; 15 | 16 | public override void FillAdditionalFoldouts(MaterialHeaderScopeList materialScopesList) 17 | { 18 | materialScopesList.RegisterHeaderScope(DiffractionLitDetailGUI.Styles.detailInputs, Expandable.Details, _ => DiffractionLitDetailGUI.DoDetailArea(litDetailProperties, materialEditor)); 19 | } 20 | 21 | // collect properties from the material properties 22 | public override void FindProperties(MaterialProperty[] properties) 23 | { 24 | base.FindProperties(properties); 25 | litProperties = new DiffractionLitGUI.LitProperties(properties); 26 | litDetailProperties = new DiffractionLitDetailGUI.LitProperties(properties); 27 | } 28 | 29 | // material changed check 30 | public override void ValidateMaterial(Material material) 31 | { 32 | SetMaterialKeywords(material, DiffractionLitGUI.SetMaterialKeywords, DiffractionLitDetailGUI.SetMaterialKeywords); 33 | 34 | if(litProperties.diffractionPattern?.floatValue > 0) 35 | updateCholeskyDecomposition(); 36 | } 37 | 38 | private void updateCholeskyDecomposition() 39 | { 40 | Vector4 column1 = new Vector4(litProperties.diffractionVarR.floatValue, 41 | litProperties.diffractionCovarRG.floatValue, 42 | litProperties.diffractionCovarRB.floatValue, 43 | 0); 44 | 45 | Vector4 column2 = new Vector4(litProperties.diffractionCovarRG.floatValue, 46 | litProperties.diffractionVarG.floatValue, 47 | litProperties.diffractionCovarGB.floatValue, 48 | 0); 49 | 50 | Vector4 column3 = new Vector4(litProperties.diffractionCovarRB.floatValue, 51 | litProperties.diffractionCovarGB.floatValue, 52 | litProperties.diffractionVarB.floatValue, 53 | 0); 54 | 55 | Matrix4x4 cov_init = new Matrix4x4(column1, column2, column3, new Vector4(0,0,0,0)); 56 | Matrix4x4 L = Matrix4x4.zero; 57 | 58 | 59 | for (int i = 0; i < 3; i++) 60 | { 61 | for (int j = 0; j < (i + 1); j++) 62 | { 63 | float sum = 0; 64 | for (int k = 0; k < j; k++) 65 | sum += L[i,k] * L[j,k]; 66 | 67 | if (i == j) 68 | L[i,j] = Mathf.Sqrt(cov_init[i,i] - sum); 69 | else 70 | L[i,j] = ((1.0f / L[j,j]) * (cov_init[i,j] - sum)); 71 | } 72 | } 73 | ///////////////////// 74 | litProperties.diffractionCovInitMatRow1.vectorValue = new Vector4(L[0, 0], L[0, 1], L[0, 2], 0); 75 | litProperties.diffractionCovInitMatRow2.vectorValue = new Vector4(L[1, 0], L[1, 1], L[1, 2], 0); 76 | litProperties.diffractionCovInitMatRow3.vectorValue = new Vector4(L[2, 0], L[2, 1], L[2, 2], 0); 77 | } 78 | 79 | // material main surface options 80 | public override void DrawSurfaceOptions(Material material) 81 | { 82 | // Use default labelWidth 83 | EditorGUIUtility.labelWidth = 0f; 84 | 85 | if (litProperties.workflowMode != null) 86 | DoPopup(DiffractionLitGUI.Styles.workflowModeText, litProperties.workflowMode, workflowModeNames); 87 | 88 | base.DrawSurfaceOptions(material); 89 | } 90 | 91 | // material main surface inputs 92 | public override void DrawSurfaceInputs(Material material) 93 | { 94 | base.DrawSurfaceInputs(material); 95 | DiffractionLitGUI.Inputs(litProperties, materialEditor, material); 96 | DrawEmissionProperties(material, true); 97 | DrawTileOffset(materialEditor, baseMapProp); 98 | } 99 | 100 | // material main advanced options 101 | public override void DrawAdvancedOptions(Material material) 102 | { 103 | // Use default labelWidth 104 | EditorGUIUtility.labelWidth = 0f; 105 | 106 | if (litProperties.analyticSpecularBRDFMode != null) 107 | { 108 | DoPopup(DiffractionLitGUI.Styles.analyticSpecularBRDFModeText, litProperties.analyticSpecularBRDFMode, analyticSpecularBRDFModeNames); 109 | DiffractionLitGUI.AnalyticSpecularBRDFMode specBrdfMode = (DiffractionLitGUI.AnalyticSpecularBRDFMode)litProperties.analyticSpecularBRDFMode.floatValue; 110 | if (specBrdfMode == DiffractionLitGUI.AnalyticSpecularBRDFMode.CT_DIFF) 111 | { 112 | materialEditor.ShaderProperty(litProperties.diffractionPattern, "Diffraction Pattern"); 113 | materialEditor.ShaderProperty(litProperties.diffractionWidth, "Diffraction Width"); 114 | materialEditor.ShaderProperty(litProperties.diffractionHeight, "Diffraction Height"); 115 | 116 | materialEditor.ShaderProperty(litProperties.diffractionVarR, "Var_R"); 117 | materialEditor.ShaderProperty(litProperties.diffractionVarG, "Var_G"); 118 | materialEditor.ShaderProperty(litProperties.diffractionVarB, "Var_B"); 119 | materialEditor.ShaderProperty(litProperties.diffractionCovarRG, "Covar_RG"); 120 | materialEditor.ShaderProperty(litProperties.diffractionCovarRB, "Covar_RB"); 121 | materialEditor.ShaderProperty(litProperties.diffractionCovarGB, "Covar_GB"); 122 | 123 | materialEditor.ShaderProperty(litProperties.diffractionUVscalingX, "UV Correction X "); 124 | materialEditor.ShaderProperty(litProperties.diffractionUVscalingY, "UV Correction Y"); 125 | materialEditor.ShaderProperty(litProperties.diffractionZWScale, "Spatio-Temporal Pattern-Shift factor"); 126 | materialEditor.ShaderProperty(litProperties.diffractionStereoSpecularity, "Diffraction Stereoscopic Specularity"); 127 | DoPopup(DiffractionLitGUI.Styles.noiseModeText, litProperties.noiseImplementation, noiseModeNames); 128 | } 129 | 130 | } 131 | 132 | if (litProperties.reflections != null && litProperties.highlights != null) 133 | { 134 | materialEditor.ShaderProperty(litProperties.highlights, LitGUI.Styles.highlightsText); 135 | materialEditor.ShaderProperty(litProperties.reflections, LitGUI.Styles.reflectionsText); 136 | } 137 | 138 | base.DrawAdvancedOptions(material); 139 | } 140 | 141 | public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) 142 | { 143 | if (material == null) 144 | throw new ArgumentNullException("material"); 145 | 146 | // _Emission property is lost after assigning Standard shader to the material 147 | // thus transfer it before assigning the new shader 148 | if (material.HasProperty("_Emission")) 149 | { 150 | material.SetColor("_EmissionColor", material.GetColor("_Emission")); 151 | } 152 | 153 | base.AssignNewShaderToMaterial(material, oldShader, newShader); 154 | 155 | if (oldShader == null || !oldShader.name.Contains("Legacy Shaders/")) 156 | { 157 | SetupMaterialBlendMode(material); 158 | return; 159 | } 160 | 161 | SurfaceType surfaceType = SurfaceType.Opaque; 162 | BlendMode blendMode = BlendMode.Alpha; 163 | if (oldShader.name.Contains("/Transparent/Cutout/")) 164 | { 165 | surfaceType = SurfaceType.Opaque; 166 | material.SetFloat("_AlphaClip", 1); 167 | } 168 | else if (oldShader.name.Contains("/Transparent/")) 169 | { 170 | // NOTE: legacy shaders did not provide physically based transparency 171 | // therefore Fade mode 172 | surfaceType = SurfaceType.Transparent; 173 | blendMode = BlendMode.Alpha; 174 | } 175 | material.SetFloat("_Blend", (float)blendMode); 176 | 177 | material.SetFloat("_Surface", (float)surfaceType); 178 | if (surfaceType == SurfaceType.Opaque) 179 | { 180 | material.DisableKeyword("_SURFACE_TYPE_TRANSPARENT"); 181 | } 182 | else 183 | { 184 | material.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); 185 | } 186 | 187 | if (oldShader.name.Equals("Standard (Specular setup)")) 188 | { 189 | material.SetFloat("_WorkflowMode", (float)DiffractionLitGUI.WorkflowMode.Specular); 190 | Texture texture = material.GetTexture("_SpecGlossMap"); 191 | if (texture != null) 192 | material.SetTexture("_MetallicSpecGlossMap", texture); 193 | } 194 | else 195 | { 196 | material.SetFloat("_WorkflowMode", (float)DiffractionLitGUI.WorkflowMode.Metallic); 197 | Texture texture = material.GetTexture("_MetallicGlossMap"); 198 | if (texture != null) 199 | material.SetTexture("_MetallicSpecGlossMap", texture); 200 | } 201 | } 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /Assets/Shaders/Core.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef UNIVERSAL_PIPELINE_CORE_INCLUDED 2 | #define UNIVERSAL_PIPELINE_CORE_INCLUDED 3 | 4 | // VT is not supported in URP (for now) this ensures any shaders using the VT 5 | // node work by falling to regular texture sampling. 6 | #define FORCE_VIRTUAL_TEXTURING_OFF 1 7 | 8 | #if defined(_CLUSTERED_RENDERING) 9 | #define _ADDITIONAL_LIGHTS 1 10 | #undef _ADDITIONAL_LIGHTS_VERTEX 11 | #define USE_CLUSTERED_LIGHTING 1 12 | #else 13 | #define USE_CLUSTERED_LIGHTING 0 14 | #endif 15 | 16 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" 17 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" 18 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" 19 | #include "Assets/Shaders/Input.hlsl" 20 | 21 | #if !defined(SHADER_HINT_NICE_QUALITY) 22 | #if defined(SHADER_API_MOBILE) || defined(SHADER_API_SWITCH) 23 | #define SHADER_HINT_NICE_QUALITY 0 24 | #else 25 | #define SHADER_HINT_NICE_QUALITY 1 26 | #endif 27 | #endif 28 | 29 | // Shader Quality Tiers in Universal. 30 | // SRP doesn't use Graphics Settings Quality Tiers. 31 | // We should expose shader quality tiers in the pipeline asset. 32 | // Meanwhile, it's forced to be: 33 | // High Quality: Non-mobile platforms or shader explicit defined SHADER_HINT_NICE_QUALITY 34 | // Medium: Mobile aside from GLES2 35 | // Low: GLES2 36 | #if SHADER_HINT_NICE_QUALITY 37 | #define SHADER_QUALITY_HIGH 38 | #elif defined(SHADER_API_GLES) 39 | #define SHADER_QUALITY_LOW 40 | #else 41 | #define SHADER_QUALITY_MEDIUM 42 | #endif 43 | 44 | #ifndef BUMP_SCALE_NOT_SUPPORTED 45 | #define BUMP_SCALE_NOT_SUPPORTED !SHADER_HINT_NICE_QUALITY 46 | #endif 47 | 48 | 49 | #if UNITY_REVERSED_Z 50 | // TODO: workaround. There's a bug where SHADER_API_GL_CORE gets erroneously defined on switch. 51 | #if (defined(SHADER_API_GLCORE) && !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) 52 | //GL with reversed z => z clip range is [near, -far] -> remapping to [0, far] 53 | #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max((coord - _ProjectionParams.y)/(-_ProjectionParams.z-_ProjectionParams.y)*_ProjectionParams.z, 0) 54 | #else 55 | //D3d with reversed Z => z clip range is [near, 0] -> remapping to [0, far] 56 | //max is required to protect ourselves from near plane not being correct/meaningful in case of oblique matrices. 57 | #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(((1.0-(coord)/_ProjectionParams.y)*_ProjectionParams.z),0) 58 | #endif 59 | #elif UNITY_UV_STARTS_AT_TOP 60 | //D3d without reversed z => z clip range is [0, far] -> nothing to do 61 | #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) (coord) 62 | #else 63 | //Opengl => z clip range is [-near, far] -> remapping to [0, far] 64 | #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(((coord + _ProjectionParams.y)/(_ProjectionParams.z+_ProjectionParams.y))*_ProjectionParams.z, 0) 65 | #endif 66 | 67 | // Stereo-related bits 68 | #if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) 69 | 70 | #define SLICE_ARRAY_INDEX unity_StereoEyeIndex 71 | 72 | #define TEXTURE2D_X(textureName) TEXTURE2D_ARRAY(textureName) 73 | #define TEXTURE2D_X_PARAM(textureName, samplerName) TEXTURE2D_ARRAY_PARAM(textureName, samplerName) 74 | #define TEXTURE2D_X_ARGS(textureName, samplerName) TEXTURE2D_ARRAY_ARGS(textureName, samplerName) 75 | #define TEXTURE2D_X_HALF(textureName) TEXTURE2D_ARRAY_HALF(textureName) 76 | #define TEXTURE2D_X_FLOAT(textureName) TEXTURE2D_ARRAY_FLOAT(textureName) 77 | 78 | #define LOAD_TEXTURE2D_X(textureName, unCoord2) LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, SLICE_ARRAY_INDEX) 79 | #define LOAD_TEXTURE2D_X_LOD(textureName, unCoord2, lod) LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, SLICE_ARRAY_INDEX, lod) 80 | #define SAMPLE_TEXTURE2D_X(textureName, samplerName, coord2) SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, SLICE_ARRAY_INDEX) 81 | #define SAMPLE_TEXTURE2D_X_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, SLICE_ARRAY_INDEX, lod) 82 | #define GATHER_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, SLICE_ARRAY_INDEX) 83 | #define GATHER_RED_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_RED_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX)) 84 | #define GATHER_GREEN_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_GREEN_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX)) 85 | #define GATHER_BLUE_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_BLUE_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX)) 86 | 87 | #else 88 | #define SLICE_ARRAY_INDEX 0 89 | 90 | #define TEXTURE2D_X(textureName) TEXTURE2D(textureName) 91 | #define TEXTURE2D_X_PARAM(textureName, samplerName) TEXTURE2D_PARAM(textureName, samplerName) 92 | #define TEXTURE2D_X_ARGS(textureName, samplerName) TEXTURE2D_ARGS(textureName, samplerName) 93 | #define TEXTURE2D_X_HALF(textureName) TEXTURE2D_HALF(textureName) 94 | #define TEXTURE2D_X_FLOAT(textureName) TEXTURE2D_FLOAT(textureName) 95 | 96 | #define LOAD_TEXTURE2D_X(textureName, unCoord2) LOAD_TEXTURE2D(textureName, unCoord2) 97 | #define LOAD_TEXTURE2D_X_LOD(textureName, unCoord2, lod) LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) 98 | #define SAMPLE_TEXTURE2D_X(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) 99 | #define SAMPLE_TEXTURE2D_X_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) 100 | #define GATHER_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_TEXTURE2D(textureName, samplerName, coord2) 101 | #define GATHER_RED_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) 102 | #define GATHER_GREEN_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) 103 | #define GATHER_BLUE_TEXTURE2D_X(textureName, samplerName, coord2) GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) 104 | #endif 105 | 106 | /// 107 | /// Texture Sampling Macro Overrides for Scaling 108 | /// 109 | /// When mip bias is supported by the underlying platform, the following section redefines all 2d texturing operations to support a global mip bias feature. 110 | /// This feature is used to improve rendering quality when image scaling is active. It achieves this by adding a bias value to the standard mip lod calculation 111 | /// which allows us to select the mip level based on the final image resolution rather than the current rendering resolution. 112 | 113 | #ifdef PLATFORM_SAMPLE_TEXTURE2D_BIAS 114 | #ifdef SAMPLE_TEXTURE2D 115 | #undef SAMPLE_TEXTURE2D 116 | #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) \ 117 | PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, _GlobalMipBias.x) 118 | #endif 119 | #ifdef SAMPLE_TEXTURE2D_BIAS 120 | #undef SAMPLE_TEXTURE2D_BIAS 121 | #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) \ 122 | PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, (bias + _GlobalMipBias.x)) 123 | #endif 124 | #endif 125 | 126 | #ifdef PLATFORM_SAMPLE_TEXTURE2D_GRAD 127 | #ifdef SAMPLE_TEXTURE2D_GRAD 128 | #undef SAMPLE_TEXTURE2D_GRAD 129 | #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) \ 130 | PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, (dpdx * _GlobalMipBias.y), (dpdy * _GlobalMipBias.y)) 131 | #endif 132 | #endif 133 | 134 | #ifdef PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS 135 | #ifdef SAMPLE_TEXTURE2D_ARRAY 136 | #undef SAMPLE_TEXTURE2D_ARRAY 137 | #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) \ 138 | PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, _GlobalMipBias.x) 139 | #endif 140 | #ifdef SAMPLE_TEXTURE2D_ARRAY_BIAS 141 | #undef SAMPLE_TEXTURE2D_ARRAY_BIAS 142 | #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) \ 143 | PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, (bias + _GlobalMipBias.x)) 144 | #endif 145 | #endif 146 | 147 | #ifdef PLATFORM_SAMPLE_TEXTURECUBE_BIAS 148 | #ifdef SAMPLE_TEXTURECUBE 149 | #undef SAMPLE_TEXTURECUBE 150 | #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) \ 151 | PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, _GlobalMipBias.x) 152 | #endif 153 | #ifdef SAMPLE_TEXTURECUBE_BIAS 154 | #undef SAMPLE_TEXTURECUBE_BIAS 155 | #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) \ 156 | PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, (bias + _GlobalMipBias.x)) 157 | #endif 158 | #endif 159 | 160 | #ifdef PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS 161 | 162 | #ifdef SAMPLE_TEXTURECUBE_ARRAY 163 | #undef SAMPLE_TEXTURECUBE_ARRAY 164 | #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index)\ 165 | PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, _GlobalMipBias.x) 166 | #endif 167 | 168 | #ifdef SAMPLE_TEXTURECUBE_ARRAY_BIAS 169 | #undef SAMPLE_TEXTURECUBE_ARRAY_BIAS 170 | #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)\ 171 | PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, (bias + _GlobalMipBias.x)) 172 | #endif 173 | #endif 174 | 175 | #define VT_GLOBAL_MIP_BIAS_MULTIPLIER (_GlobalMipBias.y) 176 | 177 | // Structs 178 | struct VertexPositionInputs 179 | { 180 | float3 positionWS; // World space position 181 | float3 positionVS; // View space position 182 | float4 positionCS; // Homogeneous clip space position 183 | float4 positionNDC;// Homogeneous normalized device coordinates 184 | }; 185 | 186 | struct VertexNormalInputs 187 | { 188 | real3 tangentWS; 189 | real3 bitangentWS; 190 | float3 normalWS; 191 | }; 192 | 193 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl" 194 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Deprecated.hlsl" 195 | 196 | #endif 197 | -------------------------------------------------------------------------------- /Assets/Shaders/LitInput.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef UNIVERSAL_LIT_INPUT_INCLUDED 2 | #define UNIVERSAL_LIT_INPUT_INCLUDED 3 | 4 | #include "Assets/Shaders/Core.hlsl" 5 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl" 6 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" 7 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ParallaxMapping.hlsl" 8 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" 9 | 10 | #if defined(_DETAIL_MULX2) || defined(_DETAIL_SCALED) 11 | #define _DETAIL 12 | #endif 13 | 14 | // NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts. 15 | CBUFFER_START(UnityPerMaterial) 16 | float4 _BaseMap_ST; 17 | float4 _DetailAlbedoMap_ST; 18 | half4 _BaseColor; 19 | half4 _SpecColor; 20 | half4 _EmissionColor; 21 | half _Cutoff; 22 | half _Smoothness; 23 | half _Metallic; 24 | half _BumpScale; 25 | half _Parallax; 26 | half _OcclusionStrength; 27 | half _ClearCoatMask; 28 | half _ClearCoatSmoothness; 29 | half _DetailAlbedoMapScale; 30 | half _DetailNormalMapScale; 31 | half _Surface; 32 | // Clausen BRDF 33 | float _DiffractionWidth; 34 | float _DiffractionHeight; 35 | float _DiffractionPatternToggle; 36 | // Clausen BRDF 37 | CBUFFER_END 38 | 39 | // NOTE: Do not ifdef the properties for dots instancing, but ifdef the actual usage. 40 | // Otherwise you might break CPU-side as property constant-buffer offsets change per variant. 41 | // NOTE: Dots instancing is orthogonal to the constant buffer above. 42 | #ifdef UNITY_DOTS_INSTANCING_ENABLED 43 | UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) 44 | UNITY_DOTS_INSTANCED_PROP(float4, _BaseColor) 45 | UNITY_DOTS_INSTANCED_PROP(float4, _SpecColor) 46 | UNITY_DOTS_INSTANCED_PROP(float4, _EmissionColor) 47 | UNITY_DOTS_INSTANCED_PROP(float , _Cutoff) 48 | UNITY_DOTS_INSTANCED_PROP(float , _Smoothness) 49 | UNITY_DOTS_INSTANCED_PROP(float , _Metallic) 50 | UNITY_DOTS_INSTANCED_PROP(float , _BumpScale) 51 | UNITY_DOTS_INSTANCED_PROP(float , _Parallax) 52 | UNITY_DOTS_INSTANCED_PROP(float , _OcclusionStrength) 53 | UNITY_DOTS_INSTANCED_PROP(float , _ClearCoatMask) 54 | UNITY_DOTS_INSTANCED_PROP(float , _ClearCoatSmoothness) 55 | UNITY_DOTS_INSTANCED_PROP(float , _DetailAlbedoMapScale) 56 | UNITY_DOTS_INSTANCED_PROP(float , _DetailNormalMapScale) 57 | UNITY_DOTS_INSTANCED_PROP(float , _Surface) 58 | // Clausen BRDF 59 | UNITY_DOTS_INSTANCED_PROP(float , _DiffractionWidth) 60 | UNITY_DOTS_INSTANCED_PROP(float , _DiffractionHeight) 61 | UNITY_DOTS_INSTANCED_PROP(float , _DiffractionPatternToggle) 62 | // Clausen BRDF 63 | UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) 64 | 65 | #define _BaseColor UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4 , Metadata_BaseColor) 66 | #define _SpecColor UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4 , Metadata_SpecColor) 67 | #define _EmissionColor UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float4 , Metadata_EmissionColor) 68 | #define _Cutoff UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_Cutoff) 69 | #define _Smoothness UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_Smoothness) 70 | #define _Metallic UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_Metallic) 71 | #define _BumpScale UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_BumpScale) 72 | #define _Parallax UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_Parallax) 73 | #define _OcclusionStrength UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_OcclusionStrength) 74 | #define _ClearCoatMask UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_ClearCoatMask) 75 | #define _ClearCoatSmoothness UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_ClearCoatSmoothness) 76 | #define _DetailAlbedoMapScale UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_DetailAlbedoMapScale) 77 | #define _DetailNormalMapScale UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_DetailNormalMapScale) 78 | #define _Surface UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_Surface) 79 | // Clausen BRDF 80 | #define _DiffractionWidth UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_DiffractionWidth) 81 | #define _DiffractionHeight UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_DiffractionHeight) 82 | #define _DiffractionHeight UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata_DiffractionPatternToggle) 83 | // Clausen BRDF 84 | #endif 85 | 86 | TEXTURE2D(_ParallaxMap); SAMPLER(sampler_ParallaxMap); 87 | TEXTURE2D(_OcclusionMap); SAMPLER(sampler_OcclusionMap); 88 | TEXTURE2D(_DetailMask); SAMPLER(sampler_DetailMask); 89 | TEXTURE2D(_DetailAlbedoMap); SAMPLER(sampler_DetailAlbedoMap); 90 | TEXTURE2D(_DetailNormalMap); SAMPLER(sampler_DetailNormalMap); 91 | TEXTURE2D(_MetallicGlossMap); SAMPLER(sampler_MetallicGlossMap); 92 | TEXTURE2D(_SpecGlossMap); SAMPLER(sampler_SpecGlossMap); 93 | TEXTURE2D(_ClearCoatMap); SAMPLER(sampler_ClearCoatMap); 94 | 95 | 96 | #ifdef _SPECULAR_SETUP 97 | #define SAMPLE_METALLICSPECULAR(uv) SAMPLE_TEXTURE2D(_SpecGlossMap, sampler_SpecGlossMap, uv) 98 | #else 99 | #define SAMPLE_METALLICSPECULAR(uv) SAMPLE_TEXTURE2D(_MetallicGlossMap, sampler_MetallicGlossMap, uv) 100 | #endif 101 | 102 | half4 SampleMetallicSpecGloss(float2 uv, half albedoAlpha) 103 | { 104 | half4 specGloss; 105 | 106 | #ifdef _METALLICSPECGLOSSMAP 107 | specGloss = half4(SAMPLE_METALLICSPECULAR(uv)); 108 | #ifdef _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 109 | specGloss.a = albedoAlpha * _Smoothness; 110 | #else 111 | specGloss.a *= _Smoothness; 112 | #endif 113 | #else // _METALLICSPECGLOSSMAP 114 | #if _SPECULAR_SETUP 115 | specGloss.rgb = _SpecColor.rgb; 116 | #else 117 | specGloss.rgb = _Metallic.rrr; 118 | #endif 119 | 120 | #ifdef _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 121 | specGloss.a = albedoAlpha * _Smoothness; 122 | #else 123 | specGloss.a = _Smoothness; 124 | #endif 125 | #endif 126 | 127 | return specGloss; 128 | } 129 | 130 | half SampleOcclusion(float2 uv) 131 | { 132 | #ifdef _OCCLUSIONMAP 133 | // TODO: Controls things like these by exposing SHADER_QUALITY levels (low, medium, high) 134 | #if defined(SHADER_API_GLES) 135 | return SAMPLE_TEXTURE2D(_OcclusionMap, sampler_OcclusionMap, uv).g; 136 | #else 137 | half occ = SAMPLE_TEXTURE2D(_OcclusionMap, sampler_OcclusionMap, uv).g; 138 | return LerpWhiteTo(occ, _OcclusionStrength); 139 | #endif 140 | #else 141 | return half(1.0); 142 | #endif 143 | } 144 | 145 | 146 | // Returns clear coat parameters 147 | // .x/.r == mask 148 | // .y/.g == smoothness 149 | half2 SampleClearCoat(float2 uv) 150 | { 151 | #if defined(_CLEARCOAT) || defined(_CLEARCOATMAP) 152 | half2 clearCoatMaskSmoothness = half2(_ClearCoatMask, _ClearCoatSmoothness); 153 | 154 | #if defined(_CLEARCOATMAP) 155 | clearCoatMaskSmoothness *= SAMPLE_TEXTURE2D(_ClearCoatMap, sampler_ClearCoatMap, uv).rg; 156 | #endif 157 | 158 | return clearCoatMaskSmoothness; 159 | #else 160 | return half2(0.0, 1.0); 161 | #endif // _CLEARCOAT 162 | } 163 | 164 | void ApplyPerPixelDisplacement(half3 viewDirTS, inout float2 uv) 165 | { 166 | #if defined(_PARALLAXMAP) 167 | uv += ParallaxMapping(TEXTURE2D_ARGS(_ParallaxMap, sampler_ParallaxMap), viewDirTS, _Parallax, uv); 168 | #endif 169 | } 170 | 171 | // Used for scaling detail albedo. Main features: 172 | // - Depending if detailAlbedo brightens or darkens, scale magnifies effect. 173 | // - No effect is applied if detailAlbedo is 0.5. 174 | half3 ScaleDetailAlbedo(half3 detailAlbedo, half scale) 175 | { 176 | // detailAlbedo = detailAlbedo * 2.0h - 1.0h; 177 | // detailAlbedo *= _DetailAlbedoMapScale; 178 | // detailAlbedo = detailAlbedo * 0.5h + 0.5h; 179 | // return detailAlbedo * 2.0f; 180 | 181 | // A bit more optimized 182 | return half(2.0) * detailAlbedo * scale - scale + half(1.0); 183 | } 184 | 185 | half3 ApplyDetailAlbedo(float2 detailUv, half3 albedo, half detailMask) 186 | { 187 | #if defined(_DETAIL) 188 | half3 detailAlbedo = SAMPLE_TEXTURE2D(_DetailAlbedoMap, sampler_DetailAlbedoMap, detailUv).rgb; 189 | 190 | // In order to have same performance as builtin, we do scaling only if scale is not 1.0 (Scaled version has 6 additional instructions) 191 | #if defined(_DETAIL_SCALED) 192 | detailAlbedo = ScaleDetailAlbedo(detailAlbedo, _DetailAlbedoMapScale); 193 | #else 194 | detailAlbedo = half(2.0) * detailAlbedo; 195 | #endif 196 | 197 | return albedo * LerpWhiteTo(detailAlbedo, detailMask); 198 | #else 199 | return albedo; 200 | #endif 201 | } 202 | 203 | half3 ApplyDetailNormal(float2 detailUv, half3 normalTS, half detailMask) 204 | { 205 | #if defined(_DETAIL) 206 | #if BUMP_SCALE_NOT_SUPPORTED 207 | half3 detailNormalTS = UnpackNormal(SAMPLE_TEXTURE2D(_DetailNormalMap, sampler_DetailNormalMap, detailUv)); 208 | #else 209 | half3 detailNormalTS = UnpackNormalScale(SAMPLE_TEXTURE2D(_DetailNormalMap, sampler_DetailNormalMap, detailUv), _DetailNormalMapScale); 210 | #endif 211 | 212 | // With UNITY_NO_DXT5nm unpacked vector is not normalized for BlendNormalRNM 213 | // For visual consistancy we going to do in all cases 214 | detailNormalTS = normalize(detailNormalTS); 215 | 216 | return lerp(normalTS, BlendNormalRNM(normalTS, detailNormalTS), detailMask); // todo: detailMask should lerp the angle of the quaternion rotation, not the normals 217 | #else 218 | return normalTS; 219 | #endif 220 | } 221 | 222 | inline void InitializeStandardLitSurfaceData(float2 uv, out SurfaceData outSurfaceData) 223 | { 224 | half4 albedoAlpha = SampleAlbedoAlpha(uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)); 225 | outSurfaceData.alpha = Alpha(albedoAlpha.a, _BaseColor, _Cutoff); 226 | 227 | half4 specGloss = SampleMetallicSpecGloss(uv, albedoAlpha.a); 228 | outSurfaceData.albedo = albedoAlpha.rgb * _BaseColor.rgb; 229 | 230 | #if _SPECULAR_SETUP 231 | outSurfaceData.metallic = half(1.0); 232 | outSurfaceData.specular = specGloss.rgb; 233 | #else 234 | outSurfaceData.metallic = specGloss.r; 235 | outSurfaceData.specular = half3(0.0, 0.0, 0.0); 236 | #endif 237 | 238 | outSurfaceData.smoothness = specGloss.a; 239 | outSurfaceData.normalTS = SampleNormal(uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap), _BumpScale); 240 | outSurfaceData.occlusion = SampleOcclusion(uv); 241 | outSurfaceData.emission = SampleEmission(uv, _EmissionColor.rgb, TEXTURE2D_ARGS(_EmissionMap, sampler_EmissionMap)); 242 | 243 | #if defined(_CLEARCOAT) || defined(_CLEARCOATMAP) 244 | half2 clearCoat = SampleClearCoat(uv); 245 | outSurfaceData.clearCoatMask = clearCoat.r; 246 | outSurfaceData.clearCoatSmoothness = clearCoat.g; 247 | #else 248 | outSurfaceData.clearCoatMask = half(0.0); 249 | outSurfaceData.clearCoatSmoothness = half(0.0); 250 | #endif 251 | 252 | #if defined(_DETAIL) 253 | half detailMask = SAMPLE_TEXTURE2D(_DetailMask, sampler_DetailMask, uv).a; 254 | float2 detailUv = uv * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw; 255 | outSurfaceData.albedo = ApplyDetailAlbedo(detailUv, outSurfaceData.albedo, detailMask); 256 | outSurfaceData.normalTS = ApplyDetailNormal(detailUv, outSurfaceData.normalTS, detailMask); 257 | #endif 258 | } 259 | 260 | #endif // UNIVERSAL_INPUT_SURFACE_PBR_INCLUDED 261 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": { 4 | "version": "1.0.0", 5 | "depth": 0, 6 | "source": "builtin", 7 | "dependencies": {} 8 | }, 9 | "com.unity.2d.tilemap": { 10 | "version": "1.0.0", 11 | "depth": 0, 12 | "source": "builtin", 13 | "dependencies": {} 14 | }, 15 | "com.unity.ads": { 16 | "version": "3.7.5", 17 | "depth": 0, 18 | "source": "registry", 19 | "dependencies": { 20 | "com.unity.ugui": "1.0.0" 21 | }, 22 | "url": "https://packages.unity.com" 23 | }, 24 | "com.unity.analytics": { 25 | "version": "3.6.12", 26 | "depth": 0, 27 | "source": "registry", 28 | "dependencies": { 29 | "com.unity.ugui": "1.0.0" 30 | }, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.burst": { 34 | "version": "1.6.6", 35 | "depth": 1, 36 | "source": "registry", 37 | "dependencies": { 38 | "com.unity.mathematics": "1.2.1" 39 | }, 40 | "url": "https://packages.unity.com" 41 | }, 42 | "com.unity.collab-proxy": { 43 | "version": "1.15.18", 44 | "depth": 0, 45 | "source": "registry", 46 | "dependencies": { 47 | "com.unity.services.core": "1.0.1" 48 | }, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.ext.nunit": { 52 | "version": "1.0.6", 53 | "depth": 1, 54 | "source": "registry", 55 | "dependencies": {}, 56 | "url": "https://packages.unity.com" 57 | }, 58 | "com.unity.ide.rider": { 59 | "version": "3.0.15", 60 | "depth": 0, 61 | "source": "registry", 62 | "dependencies": { 63 | "com.unity.ext.nunit": "1.0.6" 64 | }, 65 | "url": "https://packages.unity.com" 66 | }, 67 | "com.unity.ide.visualstudio": { 68 | "version": "2.0.16", 69 | "depth": 0, 70 | "source": "registry", 71 | "dependencies": { 72 | "com.unity.test-framework": "1.1.9" 73 | }, 74 | "url": "https://packages.unity.com" 75 | }, 76 | "com.unity.ide.vscode": { 77 | "version": "1.2.5", 78 | "depth": 0, 79 | "source": "registry", 80 | "dependencies": {}, 81 | "url": "https://packages.unity.com" 82 | }, 83 | "com.unity.inputsystem": { 84 | "version": "1.7.0", 85 | "depth": 1, 86 | "source": "registry", 87 | "dependencies": { 88 | "com.unity.modules.uielements": "1.0.0" 89 | }, 90 | "url": "https://packages.unity.com" 91 | }, 92 | "com.unity.mathematics": { 93 | "version": "1.2.6", 94 | "depth": 1, 95 | "source": "registry", 96 | "dependencies": {}, 97 | "url": "https://packages.unity.com" 98 | }, 99 | "com.unity.nuget.newtonsoft-json": { 100 | "version": "3.0.2", 101 | "depth": 2, 102 | "source": "registry", 103 | "dependencies": {}, 104 | "url": "https://packages.unity.com" 105 | }, 106 | "com.unity.purchasing": { 107 | "version": "4.1.5", 108 | "depth": 0, 109 | "source": "registry", 110 | "dependencies": { 111 | "com.unity.ugui": "1.0.0", 112 | "com.unity.modules.unityanalytics": "1.0.0", 113 | "com.unity.modules.unitywebrequest": "1.0.0", 114 | "com.unity.modules.jsonserialize": "1.0.0", 115 | "com.unity.modules.androidjni": "1.0.0", 116 | "com.unity.services.core": "1.0.1" 117 | }, 118 | "url": "https://packages.unity.com" 119 | }, 120 | "com.unity.render-pipelines.core": { 121 | "version": "12.1.7", 122 | "depth": 1, 123 | "source": "builtin", 124 | "dependencies": { 125 | "com.unity.ugui": "1.0.0", 126 | "com.unity.modules.physics": "1.0.0", 127 | "com.unity.modules.jsonserialize": "1.0.0" 128 | } 129 | }, 130 | "com.unity.render-pipelines.universal": { 131 | "version": "12.1.7", 132 | "depth": 0, 133 | "source": "builtin", 134 | "dependencies": { 135 | "com.unity.mathematics": "1.2.1", 136 | "com.unity.burst": "1.5.0", 137 | "com.unity.render-pipelines.core": "12.1.7", 138 | "com.unity.shadergraph": "12.1.7" 139 | } 140 | }, 141 | "com.unity.searcher": { 142 | "version": "4.9.1", 143 | "depth": 2, 144 | "source": "registry", 145 | "dependencies": {}, 146 | "url": "https://packages.unity.com" 147 | }, 148 | "com.unity.services.core": { 149 | "version": "1.4.0", 150 | "depth": 1, 151 | "source": "registry", 152 | "dependencies": { 153 | "com.unity.modules.unitywebrequest": "1.0.0", 154 | "com.unity.nuget.newtonsoft-json": "3.0.2", 155 | "com.unity.modules.androidjni": "1.0.0" 156 | }, 157 | "url": "https://packages.unity.com" 158 | }, 159 | "com.unity.shadergraph": { 160 | "version": "12.1.7", 161 | "depth": 1, 162 | "source": "builtin", 163 | "dependencies": { 164 | "com.unity.render-pipelines.core": "12.1.7", 165 | "com.unity.searcher": "4.9.1" 166 | } 167 | }, 168 | "com.unity.subsystemregistration": { 169 | "version": "1.1.0", 170 | "depth": 1, 171 | "source": "registry", 172 | "dependencies": { 173 | "com.unity.modules.subsystems": "1.0.0" 174 | }, 175 | "url": "https://packages.unity.com" 176 | }, 177 | "com.unity.test-framework": { 178 | "version": "1.1.31", 179 | "depth": 0, 180 | "source": "registry", 181 | "dependencies": { 182 | "com.unity.ext.nunit": "1.0.6", 183 | "com.unity.modules.imgui": "1.0.0", 184 | "com.unity.modules.jsonserialize": "1.0.0" 185 | }, 186 | "url": "https://packages.unity.com" 187 | }, 188 | "com.unity.textmeshpro": { 189 | "version": "3.0.6", 190 | "depth": 0, 191 | "source": "registry", 192 | "dependencies": { 193 | "com.unity.ugui": "1.0.0" 194 | }, 195 | "url": "https://packages.unity.com" 196 | }, 197 | "com.unity.timeline": { 198 | "version": "1.6.4", 199 | "depth": 0, 200 | "source": "registry", 201 | "dependencies": { 202 | "com.unity.modules.director": "1.0.0", 203 | "com.unity.modules.animation": "1.0.0", 204 | "com.unity.modules.audio": "1.0.0", 205 | "com.unity.modules.particlesystem": "1.0.0" 206 | }, 207 | "url": "https://packages.unity.com" 208 | }, 209 | "com.unity.ugui": { 210 | "version": "1.0.0", 211 | "depth": 0, 212 | "source": "builtin", 213 | "dependencies": { 214 | "com.unity.modules.ui": "1.0.0", 215 | "com.unity.modules.imgui": "1.0.0" 216 | } 217 | }, 218 | "com.unity.visualscripting": { 219 | "version": "1.7.8", 220 | "depth": 0, 221 | "source": "registry", 222 | "dependencies": { 223 | "com.unity.ugui": "1.0.0", 224 | "com.unity.modules.jsonserialize": "1.0.0" 225 | }, 226 | "url": "https://packages.unity.com" 227 | }, 228 | "com.unity.xr.core-utils": { 229 | "version": "2.2.3", 230 | "depth": 1, 231 | "source": "registry", 232 | "dependencies": { 233 | "com.unity.modules.xr": "1.0.0" 234 | }, 235 | "url": "https://packages.unity.com" 236 | }, 237 | "com.unity.xr.interaction.toolkit": { 238 | "version": "2.5.2", 239 | "depth": 0, 240 | "source": "registry", 241 | "dependencies": { 242 | "com.unity.inputsystem": "1.7.0", 243 | "com.unity.mathematics": "1.2.6", 244 | "com.unity.ugui": "1.0.0", 245 | "com.unity.xr.core-utils": "2.2.3", 246 | "com.unity.xr.legacyinputhelpers": "2.1.10", 247 | "com.unity.modules.audio": "1.0.0", 248 | "com.unity.modules.imgui": "1.0.0", 249 | "com.unity.modules.physics": "1.0.0" 250 | }, 251 | "url": "https://packages.unity.com" 252 | }, 253 | "com.unity.xr.legacyinputhelpers": { 254 | "version": "2.1.10", 255 | "depth": 1, 256 | "source": "registry", 257 | "dependencies": { 258 | "com.unity.modules.vr": "1.0.0", 259 | "com.unity.modules.xr": "1.0.0" 260 | }, 261 | "url": "https://packages.unity.com" 262 | }, 263 | "com.unity.xr.management": { 264 | "version": "4.2.1", 265 | "depth": 0, 266 | "source": "registry", 267 | "dependencies": { 268 | "com.unity.modules.subsystems": "1.0.0", 269 | "com.unity.modules.vr": "1.0.0", 270 | "com.unity.modules.xr": "1.0.0", 271 | "com.unity.xr.legacyinputhelpers": "2.1.7", 272 | "com.unity.subsystemregistration": "1.0.6" 273 | }, 274 | "url": "https://packages.unity.com" 275 | }, 276 | "com.unity.xr.openxr": { 277 | "version": "1.4.2", 278 | "depth": 0, 279 | "source": "registry", 280 | "dependencies": { 281 | "com.unity.xr.management": "4.0.1", 282 | "com.unity.xr.legacyinputhelpers": "2.1.2", 283 | "com.unity.inputsystem": "1.3.0" 284 | }, 285 | "url": "https://packages.unity.com" 286 | }, 287 | "com.unity.modules.ai": { 288 | "version": "1.0.0", 289 | "depth": 0, 290 | "source": "builtin", 291 | "dependencies": {} 292 | }, 293 | "com.unity.modules.androidjni": { 294 | "version": "1.0.0", 295 | "depth": 0, 296 | "source": "builtin", 297 | "dependencies": {} 298 | }, 299 | "com.unity.modules.animation": { 300 | "version": "1.0.0", 301 | "depth": 0, 302 | "source": "builtin", 303 | "dependencies": {} 304 | }, 305 | "com.unity.modules.assetbundle": { 306 | "version": "1.0.0", 307 | "depth": 0, 308 | "source": "builtin", 309 | "dependencies": {} 310 | }, 311 | "com.unity.modules.audio": { 312 | "version": "1.0.0", 313 | "depth": 0, 314 | "source": "builtin", 315 | "dependencies": {} 316 | }, 317 | "com.unity.modules.cloth": { 318 | "version": "1.0.0", 319 | "depth": 0, 320 | "source": "builtin", 321 | "dependencies": { 322 | "com.unity.modules.physics": "1.0.0" 323 | } 324 | }, 325 | "com.unity.modules.director": { 326 | "version": "1.0.0", 327 | "depth": 0, 328 | "source": "builtin", 329 | "dependencies": { 330 | "com.unity.modules.audio": "1.0.0", 331 | "com.unity.modules.animation": "1.0.0" 332 | } 333 | }, 334 | "com.unity.modules.imageconversion": { 335 | "version": "1.0.0", 336 | "depth": 0, 337 | "source": "builtin", 338 | "dependencies": {} 339 | }, 340 | "com.unity.modules.imgui": { 341 | "version": "1.0.0", 342 | "depth": 0, 343 | "source": "builtin", 344 | "dependencies": {} 345 | }, 346 | "com.unity.modules.jsonserialize": { 347 | "version": "1.0.0", 348 | "depth": 0, 349 | "source": "builtin", 350 | "dependencies": {} 351 | }, 352 | "com.unity.modules.particlesystem": { 353 | "version": "1.0.0", 354 | "depth": 0, 355 | "source": "builtin", 356 | "dependencies": {} 357 | }, 358 | "com.unity.modules.physics": { 359 | "version": "1.0.0", 360 | "depth": 0, 361 | "source": "builtin", 362 | "dependencies": {} 363 | }, 364 | "com.unity.modules.physics2d": { 365 | "version": "1.0.0", 366 | "depth": 0, 367 | "source": "builtin", 368 | "dependencies": {} 369 | }, 370 | "com.unity.modules.screencapture": { 371 | "version": "1.0.0", 372 | "depth": 0, 373 | "source": "builtin", 374 | "dependencies": { 375 | "com.unity.modules.imageconversion": "1.0.0" 376 | } 377 | }, 378 | "com.unity.modules.subsystems": { 379 | "version": "1.0.0", 380 | "depth": 1, 381 | "source": "builtin", 382 | "dependencies": { 383 | "com.unity.modules.jsonserialize": "1.0.0" 384 | } 385 | }, 386 | "com.unity.modules.terrain": { 387 | "version": "1.0.0", 388 | "depth": 0, 389 | "source": "builtin", 390 | "dependencies": {} 391 | }, 392 | "com.unity.modules.terrainphysics": { 393 | "version": "1.0.0", 394 | "depth": 0, 395 | "source": "builtin", 396 | "dependencies": { 397 | "com.unity.modules.physics": "1.0.0", 398 | "com.unity.modules.terrain": "1.0.0" 399 | } 400 | }, 401 | "com.unity.modules.tilemap": { 402 | "version": "1.0.0", 403 | "depth": 0, 404 | "source": "builtin", 405 | "dependencies": { 406 | "com.unity.modules.physics2d": "1.0.0" 407 | } 408 | }, 409 | "com.unity.modules.ui": { 410 | "version": "1.0.0", 411 | "depth": 0, 412 | "source": "builtin", 413 | "dependencies": {} 414 | }, 415 | "com.unity.modules.uielements": { 416 | "version": "1.0.0", 417 | "depth": 0, 418 | "source": "builtin", 419 | "dependencies": { 420 | "com.unity.modules.ui": "1.0.0", 421 | "com.unity.modules.imgui": "1.0.0", 422 | "com.unity.modules.jsonserialize": "1.0.0", 423 | "com.unity.modules.uielementsnative": "1.0.0" 424 | } 425 | }, 426 | "com.unity.modules.uielementsnative": { 427 | "version": "1.0.0", 428 | "depth": 1, 429 | "source": "builtin", 430 | "dependencies": { 431 | "com.unity.modules.ui": "1.0.0", 432 | "com.unity.modules.imgui": "1.0.0", 433 | "com.unity.modules.jsonserialize": "1.0.0" 434 | } 435 | }, 436 | "com.unity.modules.umbra": { 437 | "version": "1.0.0", 438 | "depth": 0, 439 | "source": "builtin", 440 | "dependencies": {} 441 | }, 442 | "com.unity.modules.unityanalytics": { 443 | "version": "1.0.0", 444 | "depth": 0, 445 | "source": "builtin", 446 | "dependencies": { 447 | "com.unity.modules.unitywebrequest": "1.0.0", 448 | "com.unity.modules.jsonserialize": "1.0.0" 449 | } 450 | }, 451 | "com.unity.modules.unitywebrequest": { 452 | "version": "1.0.0", 453 | "depth": 0, 454 | "source": "builtin", 455 | "dependencies": {} 456 | }, 457 | "com.unity.modules.unitywebrequestassetbundle": { 458 | "version": "1.0.0", 459 | "depth": 0, 460 | "source": "builtin", 461 | "dependencies": { 462 | "com.unity.modules.assetbundle": "1.0.0", 463 | "com.unity.modules.unitywebrequest": "1.0.0" 464 | } 465 | }, 466 | "com.unity.modules.unitywebrequestaudio": { 467 | "version": "1.0.0", 468 | "depth": 0, 469 | "source": "builtin", 470 | "dependencies": { 471 | "com.unity.modules.unitywebrequest": "1.0.0", 472 | "com.unity.modules.audio": "1.0.0" 473 | } 474 | }, 475 | "com.unity.modules.unitywebrequesttexture": { 476 | "version": "1.0.0", 477 | "depth": 0, 478 | "source": "builtin", 479 | "dependencies": { 480 | "com.unity.modules.unitywebrequest": "1.0.0", 481 | "com.unity.modules.imageconversion": "1.0.0" 482 | } 483 | }, 484 | "com.unity.modules.unitywebrequestwww": { 485 | "version": "1.0.0", 486 | "depth": 0, 487 | "source": "builtin", 488 | "dependencies": { 489 | "com.unity.modules.unitywebrequest": "1.0.0", 490 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 491 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 492 | "com.unity.modules.audio": "1.0.0", 493 | "com.unity.modules.assetbundle": "1.0.0", 494 | "com.unity.modules.imageconversion": "1.0.0" 495 | } 496 | }, 497 | "com.unity.modules.vehicles": { 498 | "version": "1.0.0", 499 | "depth": 0, 500 | "source": "builtin", 501 | "dependencies": { 502 | "com.unity.modules.physics": "1.0.0" 503 | } 504 | }, 505 | "com.unity.modules.video": { 506 | "version": "1.0.0", 507 | "depth": 0, 508 | "source": "builtin", 509 | "dependencies": { 510 | "com.unity.modules.audio": "1.0.0", 511 | "com.unity.modules.ui": "1.0.0", 512 | "com.unity.modules.unitywebrequest": "1.0.0" 513 | } 514 | }, 515 | "com.unity.modules.vr": { 516 | "version": "1.0.0", 517 | "depth": 0, 518 | "source": "builtin", 519 | "dependencies": { 520 | "com.unity.modules.jsonserialize": "1.0.0", 521 | "com.unity.modules.physics": "1.0.0", 522 | "com.unity.modules.xr": "1.0.0" 523 | } 524 | }, 525 | "com.unity.modules.wind": { 526 | "version": "1.0.0", 527 | "depth": 0, 528 | "source": "builtin", 529 | "dependencies": {} 530 | }, 531 | "com.unity.modules.xr": { 532 | "version": "1.0.0", 533 | "depth": 0, 534 | "source": "builtin", 535 | "dependencies": { 536 | "com.unity.modules.physics": "1.0.0", 537 | "com.unity.modules.jsonserialize": "1.0.0", 538 | "com.unity.modules.subsystems": "1.0.0" 539 | } 540 | } 541 | } 542 | } 543 | -------------------------------------------------------------------------------- /Assets/Shaders/Lighting.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef UNIVERSAL_LIGHTING_INCLUDED 2 | #define UNIVERSAL_LIGHTING_INCLUDED 3 | 4 | #include "Assets/Shaders/BRDF.hlsl" 5 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl" 6 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl" 7 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RealtimeLights.hlsl" 8 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/AmbientOcclusion.hlsl" 9 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" 10 | 11 | #if defined(LIGHTMAP_ON) 12 | #define DECLARE_LIGHTMAP_OR_SH(lmName, shName, index) float2 lmName : TEXCOORD##index 13 | #define OUTPUT_LIGHTMAP_UV(lightmapUV, lightmapScaleOffset, OUT) OUT.xy = lightmapUV.xy * lightmapScaleOffset.xy + lightmapScaleOffset.zw; 14 | #define OUTPUT_SH(normalWS, OUT) 15 | #else 16 | #define DECLARE_LIGHTMAP_OR_SH(lmName, shName, index) half3 shName : TEXCOORD##index 17 | #define OUTPUT_LIGHTMAP_UV(lightmapUV, lightmapScaleOffset, OUT) 18 | #define OUTPUT_SH(normalWS, OUT) OUT.xyz = SampleSHVertex(normalWS) 19 | #endif 20 | 21 | /////////////////////////////////////////////////////////////////////////////// 22 | // Lighting Functions // 23 | /////////////////////////////////////////////////////////////////////////////// 24 | half3 LightingLambert(half3 lightColor, half3 lightDir, half3 normal) 25 | { 26 | half NdotL = saturate(dot(normal, lightDir)); 27 | return lightColor * NdotL; 28 | } 29 | 30 | half3 LightingSpecular(half3 lightColor, half3 lightDir, half3 normal, half3 viewDir, half4 specular, half smoothness) 31 | { 32 | float3 halfVec = SafeNormalize(float3(lightDir) + float3(viewDir)); 33 | half NdotH = half(saturate(dot(normal, halfVec))); 34 | half modifier = pow(NdotH, smoothness); 35 | half3 specularReflection = specular.rgb * modifier; 36 | return lightColor * specularReflection; 37 | } 38 | 39 | half3 LightingPhysicallyBased(BRDFData brdfData, BRDFData brdfDataClearCoat, 40 | half3 lightColor, half3 lightDirectionWS, half lightAttenuation, 41 | half3 normalWS, half3 viewDirectionWS, 42 | half clearCoatMask, bool specularHighlightsOff) 43 | { 44 | half NdotL = saturate(dot(normalWS, lightDirectionWS)); 45 | half3 radiance = lightColor * (lightAttenuation * NdotL); 46 | 47 | half3 brdf = brdfData.diffuse; 48 | #ifndef _SPECULARHIGHLIGHTS_OFF 49 | [branch] if (!specularHighlightsOff) 50 | { 51 | #if defined _DIRECT_LIGHT_BRDF_COOK_TORRANCE 52 | brdf += DirectBRDFSpecular_GGXReference(brdfData, normalWS, lightDirectionWS, viewDirectionWS); 53 | #elif defined _DIRECT_LIGHT_BRDF_DIFFRACTION 54 | brdf += DirectBRDFSpecular_Diffraction(brdfData, normalWS, lightDirectionWS, viewDirectionWS); 55 | #else 56 | brdf += brdfData.specular * DirectBRDFSpecular(brdfData, normalWS, lightDirectionWS, viewDirectionWS); 57 | #endif 58 | 59 | 60 | #if defined(_CLEARCOAT) || defined(_CLEARCOATMAP) 61 | // Clear coat evaluates the specular a second timw and has some common terms with the base specular. 62 | // We rely on the compiler to merge these and compute them only once. 63 | half brdfCoat = kDielectricSpec.r * DirectBRDFSpecular(brdfDataClearCoat, normalWS, lightDirectionWS, viewDirectionWS); 64 | 65 | // Mix clear coat and base layer using khronos glTF recommended formula 66 | // https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_materials_clearcoat/README.md 67 | // Use NoV for direct too instead of LoH as an optimization (NoV is light invariant). 68 | half NoV = saturate(dot(normalWS, viewDirectionWS)); 69 | // Use slightly simpler fresnelTerm (Pow4 vs Pow5) as a small optimization. 70 | // It is matching fresnel used in the GI/Env, so should produce a consistent clear coat blend (env vs. direct) 71 | half coatFresnel = kDielectricSpec.x + kDielectricSpec.a * Pow4(1.0 - NoV); 72 | 73 | brdf = brdf * (1.0 - clearCoatMask * coatFresnel) + brdfCoat * clearCoatMask; 74 | #endif // _CLEARCOAT 75 | } 76 | #endif // _SPECULARHIGHLIGHTS_OFF 77 | 78 | return brdf * radiance; 79 | } 80 | 81 | half3 LightingPhysicallyBased(BRDFData brdfData, BRDFData brdfDataClearCoat, Light light, half3 normalWS, half3 viewDirectionWS, half clearCoatMask, bool specularHighlightsOff) 82 | { 83 | return LightingPhysicallyBased(brdfData, brdfDataClearCoat, light.color, light.direction, light.distanceAttenuation * light.shadowAttenuation, normalWS, viewDirectionWS, clearCoatMask, specularHighlightsOff); 84 | } 85 | 86 | // Backwards compatibility 87 | half3 LightingPhysicallyBased(BRDFData brdfData, Light light, half3 normalWS, half3 viewDirectionWS) 88 | { 89 | #ifdef _SPECULARHIGHLIGHTS_OFF 90 | bool specularHighlightsOff = true; 91 | #else 92 | bool specularHighlightsOff = false; 93 | #endif 94 | const BRDFData noClearCoat = (BRDFData)0; 95 | return LightingPhysicallyBased(brdfData, noClearCoat, light, normalWS, viewDirectionWS, 0.0, specularHighlightsOff); 96 | } 97 | 98 | half3 LightingPhysicallyBased(BRDFData brdfData, half3 lightColor, half3 lightDirectionWS, half lightAttenuation, half3 normalWS, half3 viewDirectionWS) 99 | { 100 | Light light; 101 | light.color = lightColor; 102 | light.direction = lightDirectionWS; 103 | light.distanceAttenuation = lightAttenuation; 104 | light.shadowAttenuation = 1; 105 | return LightingPhysicallyBased(brdfData, light, normalWS, viewDirectionWS); 106 | } 107 | 108 | half3 LightingPhysicallyBased(BRDFData brdfData, Light light, half3 normalWS, half3 viewDirectionWS, bool specularHighlightsOff) 109 | { 110 | const BRDFData noClearCoat = (BRDFData)0; 111 | return LightingPhysicallyBased(brdfData, noClearCoat, light, normalWS, viewDirectionWS, 0.0, specularHighlightsOff); 112 | } 113 | 114 | half3 LightingPhysicallyBased(BRDFData brdfData, half3 lightColor, half3 lightDirectionWS, half lightAttenuation, half3 normalWS, half3 viewDirectionWS, bool specularHighlightsOff) 115 | { 116 | Light light; 117 | light.color = lightColor; 118 | light.direction = lightDirectionWS; 119 | light.distanceAttenuation = lightAttenuation; 120 | light.shadowAttenuation = 1; 121 | return LightingPhysicallyBased(brdfData, light, viewDirectionWS, specularHighlightsOff, specularHighlightsOff); 122 | } 123 | 124 | half3 VertexLighting(float3 positionWS, half3 normalWS) 125 | { 126 | half3 vertexLightColor = half3(0.0, 0.0, 0.0); 127 | 128 | #ifdef _ADDITIONAL_LIGHTS_VERTEX 129 | uint lightsCount = GetAdditionalLightsCount(); 130 | LIGHT_LOOP_BEGIN(lightsCount) 131 | Light light = GetAdditionalLight(lightIndex, positionWS); 132 | half3 lightColor = light.color * light.distanceAttenuation; 133 | vertexLightColor += LightingLambert(lightColor, light.direction, normalWS); 134 | LIGHT_LOOP_END 135 | #endif 136 | 137 | return vertexLightColor; 138 | } 139 | 140 | struct LightingData 141 | { 142 | half3 giColor; 143 | half3 mainLightColor; 144 | half3 additionalLightsColor; 145 | half3 vertexLightingColor; 146 | half3 emissionColor; 147 | }; 148 | 149 | half3 CalculateLightingColor(LightingData lightingData, half3 albedo) 150 | { 151 | half3 lightingColor = 0; 152 | 153 | if (IsOnlyAOLightingFeatureEnabled()) 154 | { 155 | return lightingData.giColor; // Contains white + AO 156 | } 157 | 158 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_GLOBAL_ILLUMINATION)) 159 | { 160 | lightingColor += lightingData.giColor; 161 | } 162 | 163 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_MAIN_LIGHT)) 164 | { 165 | lightingColor += lightingData.mainLightColor; 166 | } 167 | 168 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_ADDITIONAL_LIGHTS)) 169 | { 170 | lightingColor += lightingData.additionalLightsColor; 171 | } 172 | 173 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_VERTEX_LIGHTING)) 174 | { 175 | lightingColor += lightingData.vertexLightingColor; 176 | } 177 | 178 | lightingColor *= albedo; 179 | 180 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_EMISSION)) 181 | { 182 | lightingColor += lightingData.emissionColor; 183 | } 184 | 185 | return lightingColor; 186 | } 187 | 188 | half4 CalculateFinalColor(LightingData lightingData, half alpha) 189 | { 190 | half3 finalColor = CalculateLightingColor(lightingData, 1); 191 | 192 | return half4(finalColor, alpha); 193 | } 194 | 195 | half4 CalculateFinalColor(LightingData lightingData, half3 albedo, half alpha, float fogCoord) 196 | { 197 | #if defined(_FOG_FRAGMENT) 198 | #if (defined(FOG_LINEAR) || defined(FOG_EXP) || defined(FOG_EXP2)) 199 | float viewZ = -fogCoord; 200 | float nearToFarZ = max(viewZ - _ProjectionParams.y, 0); 201 | half fogFactor = ComputeFogFactorZ0ToFar(nearToFarZ); 202 | #else 203 | half fogFactor = 0; 204 | #endif 205 | #else 206 | half fogFactor = fogCoord; 207 | #endif 208 | half3 lightingColor = CalculateLightingColor(lightingData, albedo); 209 | half3 finalColor = MixFog(lightingColor, fogFactor); 210 | 211 | return half4(finalColor, alpha); 212 | } 213 | 214 | LightingData CreateLightingData(InputData inputData, SurfaceData surfaceData) 215 | { 216 | LightingData lightingData; 217 | 218 | lightingData.giColor = inputData.bakedGI; 219 | lightingData.emissionColor = surfaceData.emission; 220 | lightingData.vertexLightingColor = 0; 221 | lightingData.mainLightColor = 0; 222 | lightingData.additionalLightsColor = 0; 223 | 224 | return lightingData; 225 | } 226 | 227 | half3 CalculateBlinnPhong(Light light, InputData inputData, SurfaceData surfaceData) 228 | { 229 | half3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation); 230 | half3 lightColor = LightingLambert(attenuatedLightColor, light.direction, inputData.normalWS); 231 | 232 | lightColor *= surfaceData.albedo; 233 | 234 | #if defined(_SPECGLOSSMAP) || defined(_SPECULAR_COLOR) 235 | half smoothness = exp2(10 * surfaceData.smoothness + 1); 236 | 237 | lightColor += LightingSpecular(attenuatedLightColor, light.direction, inputData.normalWS, inputData.viewDirectionWS, half4(surfaceData.specular, 1), smoothness); 238 | #endif 239 | 240 | return lightColor; 241 | } 242 | 243 | /////////////////////////////////////////////////////////////////////////////// 244 | // Fragment Functions // 245 | // Used by ShaderGraph and others builtin renderers // 246 | /////////////////////////////////////////////////////////////////////////////// 247 | 248 | //////////////////////////////////////////////////////////////////////////////// 249 | /// PBR lighting... 250 | //////////////////////////////////////////////////////////////////////////////// 251 | half4 UniversalFragmentPBR(InputData inputData, SurfaceData surfaceData) 252 | { 253 | #if defined(_SPECULARHIGHLIGHTS_OFF) 254 | bool specularHighlightsOff = true; 255 | #else 256 | bool specularHighlightsOff = false; 257 | #endif 258 | BRDFData brdfData; 259 | 260 | // NOTE: can modify "surfaceData"... 261 | InitializeBRDFData(surfaceData, brdfData); 262 | // Clausen BRDF 263 | #if defined _DIRECT_LIGHT_BRDF_DIFFRACTION 264 | brdfData.uvs = inputData.uvs; 265 | brdfData.wsPosition = inputData.positionWS; 266 | #endif 267 | // Clausen BRDF 268 | 269 | #if defined(DEBUG_DISPLAY) 270 | half4 debugColor; 271 | 272 | if (CanDebugOverrideOutputColor(inputData, surfaceData, brdfData, debugColor)) 273 | { 274 | return debugColor; 275 | } 276 | #endif 277 | 278 | // Clear-coat calculation... 279 | BRDFData brdfDataClearCoat = CreateClearCoatBRDFData(surfaceData, brdfData); 280 | half4 shadowMask = CalculateShadowMask(inputData); 281 | AmbientOcclusionFactor aoFactor = CreateAmbientOcclusionFactor(inputData, surfaceData); 282 | uint meshRenderingLayers = GetMeshRenderingLightLayer(); 283 | Light mainLight = GetMainLight(inputData, shadowMask, aoFactor); 284 | 285 | // NOTE: We don't apply AO to the GI here because it's done in the lighting calculation below... 286 | MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI); 287 | 288 | LightingData lightingData = CreateLightingData(inputData, surfaceData); 289 | 290 | lightingData.giColor = GlobalIllumination(brdfData, brdfDataClearCoat, surfaceData.clearCoatMask, 291 | inputData.bakedGI, aoFactor.indirectAmbientOcclusion, inputData.positionWS, 292 | inputData.normalWS, inputData.viewDirectionWS); 293 | 294 | if (IsMatchingLightLayer(mainLight.layerMask, meshRenderingLayers)) 295 | { 296 | lightingData.mainLightColor = LightingPhysicallyBased(brdfData, brdfDataClearCoat, 297 | mainLight, 298 | inputData.normalWS, inputData.viewDirectionWS, 299 | surfaceData.clearCoatMask, specularHighlightsOff); 300 | } 301 | 302 | #if defined(_ADDITIONAL_LIGHTS) 303 | uint pixelLightCount = GetAdditionalLightsCount(); 304 | 305 | #if USE_CLUSTERED_LIGHTING 306 | for (uint lightIndex = 0; lightIndex < min(_AdditionalLightsDirectionalCount, MAX_VISIBLE_LIGHTS); lightIndex++) 307 | { 308 | Light light = GetAdditionalLight(lightIndex, inputData, shadowMask, aoFactor); 309 | 310 | if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) 311 | { 312 | lightingData.additionalLightsColor += LightingPhysicallyBased(brdfData, brdfDataClearCoat, light, 313 | inputData.normalWS, inputData.viewDirectionWS, 314 | surfaceData.clearCoatMask, specularHighlightsOff); 315 | } 316 | } 317 | #endif 318 | 319 | LIGHT_LOOP_BEGIN(pixelLightCount) 320 | Light light = GetAdditionalLight(lightIndex, inputData, shadowMask, aoFactor); 321 | 322 | if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) 323 | { 324 | lightingData.additionalLightsColor += LightingPhysicallyBased(brdfData, brdfDataClearCoat, light, 325 | inputData.normalWS, inputData.viewDirectionWS, 326 | surfaceData.clearCoatMask, specularHighlightsOff); 327 | } 328 | LIGHT_LOOP_END 329 | #endif 330 | 331 | #if defined(_ADDITIONAL_LIGHTS_VERTEX) 332 | lightingData.vertexLightingColor += inputData.vertexLighting * brdfData.diffuse; 333 | #endif 334 | 335 | return CalculateFinalColor(lightingData, surfaceData.alpha); 336 | } 337 | 338 | // Deprecated: Use the version which takes "SurfaceData" instead of passing all of these arguments... 339 | half4 UniversalFragmentPBR(InputData inputData, half3 albedo, half metallic, half3 specular, 340 | half smoothness, half occlusion, half3 emission, half alpha) 341 | { 342 | SurfaceData surfaceData; 343 | 344 | surfaceData.albedo = albedo; 345 | surfaceData.specular = specular; 346 | surfaceData.metallic = metallic; 347 | surfaceData.smoothness = smoothness; 348 | surfaceData.normalTS = half3(0, 0, 1); 349 | surfaceData.emission = emission; 350 | surfaceData.occlusion = occlusion; 351 | surfaceData.alpha = alpha; 352 | surfaceData.clearCoatMask = 0; 353 | surfaceData.clearCoatSmoothness = 1; 354 | 355 | return UniversalFragmentPBR(inputData, surfaceData); 356 | } 357 | 358 | //////////////////////////////////////////////////////////////////////////////// 359 | /// Phong lighting... 360 | //////////////////////////////////////////////////////////////////////////////// 361 | half4 UniversalFragmentBlinnPhong(InputData inputData, SurfaceData surfaceData) 362 | { 363 | #if defined(DEBUG_DISPLAY) 364 | half4 debugColor; 365 | 366 | if (CanDebugOverrideOutputColor(inputData, surfaceData, debugColor)) 367 | { 368 | return debugColor; 369 | } 370 | #endif 371 | 372 | uint meshRenderingLayers = GetMeshRenderingLightLayer(); 373 | half4 shadowMask = CalculateShadowMask(inputData); 374 | AmbientOcclusionFactor aoFactor = CreateAmbientOcclusionFactor(inputData, surfaceData); 375 | Light mainLight = GetMainLight(inputData, shadowMask, aoFactor); 376 | 377 | MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, aoFactor); 378 | 379 | inputData.bakedGI *= surfaceData.albedo; 380 | 381 | LightingData lightingData = CreateLightingData(inputData, surfaceData); 382 | if (IsMatchingLightLayer(mainLight.layerMask, meshRenderingLayers)) 383 | { 384 | lightingData.mainLightColor += CalculateBlinnPhong(mainLight, inputData, surfaceData); 385 | } 386 | 387 | #if defined(_ADDITIONAL_LIGHTS) 388 | uint pixelLightCount = GetAdditionalLightsCount(); 389 | 390 | #if USE_CLUSTERED_LIGHTING 391 | for (uint lightIndex = 0; lightIndex < min(_AdditionalLightsDirectionalCount, MAX_VISIBLE_LIGHTS); lightIndex++) 392 | { 393 | Light light = GetAdditionalLight(lightIndex, inputData, shadowMask, aoFactor); 394 | if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) 395 | { 396 | lightingData.additionalLightsColor += CalculateBlinnPhong(light, inputData, surfaceData); 397 | } 398 | } 399 | #endif 400 | 401 | LIGHT_LOOP_BEGIN(pixelLightCount) 402 | Light light = GetAdditionalLight(lightIndex, inputData, shadowMask, aoFactor); 403 | if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) 404 | { 405 | lightingData.additionalLightsColor += CalculateBlinnPhong(light, inputData, surfaceData); 406 | } 407 | LIGHT_LOOP_END 408 | #endif 409 | 410 | #if defined(_ADDITIONAL_LIGHTS_VERTEX) 411 | lightingData.vertexLightingColor += inputData.vertexLighting; 412 | #endif 413 | 414 | return CalculateFinalColor(lightingData, surfaceData.alpha); 415 | } 416 | 417 | // Deprecated: Use the version which takes "SurfaceData" instead of passing all of these arguments... 418 | half4 UniversalFragmentBlinnPhong(InputData inputData, half3 diffuse, half4 specularGloss, half smoothness, half3 emission, half alpha, half3 normalTS) 419 | { 420 | SurfaceData surfaceData; 421 | 422 | surfaceData.albedo = diffuse; 423 | surfaceData.alpha = alpha; 424 | surfaceData.emission = emission; 425 | surfaceData.metallic = 0; 426 | surfaceData.occlusion = 1; 427 | surfaceData.smoothness = smoothness; 428 | surfaceData.specular = specularGloss.rgb; 429 | surfaceData.clearCoatMask = 0; 430 | surfaceData.clearCoatSmoothness = 1; 431 | surfaceData.normalTS = normalTS; 432 | 433 | return UniversalFragmentBlinnPhong(inputData, surfaceData); 434 | } 435 | 436 | //////////////////////////////////////////////////////////////////////////////// 437 | /// Unlit 438 | //////////////////////////////////////////////////////////////////////////////// 439 | half4 UniversalFragmentBakedLit(InputData inputData, SurfaceData surfaceData) 440 | { 441 | #ifdef _ALPHAPREMULTIPLY_ON 442 | surfaceData.albedo *= surfaceData.alpha; 443 | #endif 444 | 445 | #if defined(DEBUG_DISPLAY) 446 | half4 debugColor; 447 | 448 | if (CanDebugOverrideOutputColor(inputData, surfaceData, debugColor)) 449 | { 450 | return debugColor; 451 | } 452 | #endif 453 | 454 | AmbientOcclusionFactor aoFactor = CreateAmbientOcclusionFactor(inputData, surfaceData); 455 | LightingData lightingData = CreateLightingData(inputData, surfaceData); 456 | 457 | if (IsLightingFeatureEnabled(DEBUGLIGHTINGFEATUREFLAGS_AMBIENT_OCCLUSION)) 458 | { 459 | lightingData.giColor *= aoFactor.indirectAmbientOcclusion; 460 | } 461 | 462 | return CalculateFinalColor(lightingData, surfaceData.albedo, surfaceData.alpha, inputData.fogCoord); 463 | } 464 | 465 | // Deprecated: Use the version which takes "SurfaceData" instead of passing all of these arguments... 466 | half4 UniversalFragmentBakedLit(InputData inputData, half3 color, half alpha, half3 normalTS) 467 | { 468 | SurfaceData surfaceData; 469 | 470 | surfaceData.albedo = color; 471 | surfaceData.alpha = alpha; 472 | surfaceData.emission = half3(0, 0, 0); 473 | surfaceData.metallic = 0; 474 | surfaceData.occlusion = 1; 475 | surfaceData.smoothness = 1; 476 | surfaceData.specular = half3(0, 0, 0); 477 | surfaceData.clearCoatMask = 0; 478 | surfaceData.clearCoatSmoothness = 1; 479 | surfaceData.normalTS = normalTS; 480 | 481 | return UniversalFragmentBakedLit(inputData, surfaceData); 482 | } 483 | 484 | #endif 485 | --------------------------------------------------------------------------------