├── .gitattributes ├── .gitignore ├── Assets.meta ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Documentation~ └── images │ └── project_settings.png ├── Editor.meta ├── Editor ├── Unity.ShaderGlobals.Editor.asmdef └── Unity.ShaderGlobals.Editor.asmdef.meta ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── Components.meta ├── Components │ ├── ColliderMouseEventsComponent.cs │ ├── ColliderMouseEventsComponent.cs.meta │ ├── MaterialPropertyBlockComponent.cs │ ├── MaterialPropertyBlockComponent.cs.meta │ ├── TransformVector.cs │ ├── TransformVector.cs.meta │ ├── Wind.hlsl │ ├── Wind.hlsl.meta │ ├── Wind.shadersubgraph │ ├── Wind.shadersubgraph.meta │ ├── WindProperties.cs │ └── WindProperties.cs.meta ├── ShaderGlobals.cs ├── ShaderGlobals.cs.meta ├── Timeline.meta ├── Timeline │ ├── AmbientLight.meta │ ├── AmbientLight │ │ ├── AmbientLightControlAsset.cs │ │ ├── AmbientLightControlAsset.cs.meta │ │ ├── AmbientLightControlBehaviour.cs │ │ ├── AmbientLightControlBehaviour.cs.meta │ │ ├── AmbientLightControlMixerBehaviour.cs │ │ ├── AmbientLightControlMixerBehaviour.cs.meta │ │ ├── AmbientLightControlTrack.cs │ │ └── AmbientLightControlTrack.cs.meta │ ├── GlobalBoolean.meta │ ├── GlobalBoolean │ │ ├── GlobalBooleanControlAsset.cs │ │ ├── GlobalBooleanControlAsset.cs.meta │ │ ├── GlobalBooleanControlBehaviour.cs │ │ ├── GlobalBooleanControlBehaviour.cs.meta │ │ ├── GlobalBooleanControlTrack.cs │ │ └── GlobalBooleanControlTrack.cs.meta │ ├── GlobalBooleanKeyword.meta │ ├── GlobalBooleanKeyword │ │ ├── GlobalBooleanKeywordControlAsset.cs │ │ ├── GlobalBooleanKeywordControlAsset.cs.meta │ │ ├── GlobalBooleanKeywordControlBehaviour.cs │ │ ├── GlobalBooleanKeywordControlBehaviour.cs.meta │ │ ├── GlobalBooleanKeywordControlTrack.cs │ │ └── GlobalBooleanKeywordControlTrack.cs.meta │ ├── GlobalColor.meta │ ├── GlobalColor │ │ ├── GlobalColorControlAsset.cs │ │ ├── GlobalColorControlAsset.cs.meta │ │ ├── GlobalColorControlBehaviour.cs │ │ ├── GlobalColorControlBehaviour.cs.meta │ │ ├── GlobalColorControlMixerBehaviour.cs │ │ ├── GlobalColorControlMixerBehaviour.cs.meta │ │ ├── GlobalColorControlTrack.cs │ │ └── GlobalColorControlTrack.cs.meta │ ├── GlobalFloat.meta │ ├── GlobalFloat │ │ ├── GlobalFloatControlAsset.cs │ │ ├── GlobalFloatControlAsset.cs.meta │ │ ├── GlobalFloatControlBehaviour.cs │ │ ├── GlobalFloatControlBehaviour.cs.meta │ │ ├── GlobalFloatControlMixerBehaviour.cs │ │ ├── GlobalFloatControlMixerBehaviour.cs.meta │ │ ├── GlobalFloatControlTrack.cs │ │ └── GlobalFloatControlTrack.cs.meta │ ├── Unity.ShaderGlobals.Timeline.asmdef │ └── Unity.ShaderGlobals.Timeline.asmdef.meta ├── Unity.ShaderGlobals.asmdef ├── Unity.ShaderGlobals.asmdef.meta ├── VolumeComponent.meta └── VolumeComponent │ ├── ShaderGlobalsVolumeComponent.cs │ ├── ShaderGlobalsVolumeComponent.cs.meta │ ├── Unity.ShaderGlobals.Volume.asmdef │ ├── Unity.ShaderGlobals.Volume.asmdef.meta │ ├── VolumeComponentUpdater.cs │ └── VolumeComponentUpdater.cs.meta ├── package.json └── package.json.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a41e7b7b526d48659d748d96e1503dc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this package will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [0.0.1-preview.1] - 2023-07-03 8 | 9 | ### This is the first release of *Unity Package *. 10 | 11 | *Short description of this release* -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 948b145bcc7bb4308906f5630ba9746b 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Documentation~/images/project_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredMoreau/com.unity.shader-globals/70a936691909a79f0a2e59339aec3320e11d229d/Documentation~/images/project_settings.png -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe46272b302bc41c7b7c7df5abf1b696 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Unity.ShaderGlobals.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.ShaderGlobals.Editor", 3 | "rootNamespace": "Unity.ShaderGlobals.Editor", 4 | "references": [ 5 | "Unity.ShaderGlobals" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /Editor/Unity.ShaderGlobals.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0db7be64f12e4f33aaf5266d56f7a4e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4be81db9ab1194bb28b668b311101375 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shader Globals 2 | 3 | ### Installation 4 | Open the **Package Manager**, click on the + Icon, select "Add Package from Git Url".
5 | Enter the package url: git@github.com:FredMoreau/com.unity.shader-globals.git 6 | 7 | ### Usage 8 | Open the **Project Settings**
9 | Select the **Graphics / Shader Globals** tab.
10 | You can add your global values here.
11 | They will immediatly apply in the Editor.
12 | At runtime, they will be set upon load so that other C# scripts can still override them. 13 | 14 | ![Screenshot](./Documentation~/images/project_settings.png) 15 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 049fa2fe925044060911f51d857c91e7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f4771bfe0325406fbc05ae66e8690e3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4adc490851074f4f81bcf8aa1f9c6ce 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Components/ColliderMouseEventsComponent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | 6 | namespace Unity.ShaderGlobals 7 | { 8 | [RequireComponent(typeof(Collider))] 9 | public class ColliderMouseEventsComponent : MonoBehaviour 10 | { 11 | [SerializeField] UnityEvent onMouseUpAsButton; 12 | [SerializeField] UnityEvent onMouseEnter; 13 | [SerializeField] UnityEvent onMouseHover; 14 | [SerializeField] UnityEvent onMouseExit; 15 | 16 | private void OnMouseUpAsButton() 17 | { 18 | onMouseUpAsButton?.Invoke(); 19 | } 20 | 21 | private void OnMouseEnter() 22 | { 23 | onMouseEnter?.Invoke(); 24 | onMouseHover?.Invoke(true); 25 | } 26 | 27 | private void OnMouseExit() 28 | { 29 | onMouseExit?.Invoke(); 30 | onMouseHover?.Invoke(false); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Runtime/Components/ColliderMouseEventsComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e54f28266bfc94a70909fce6a9d0dd5a -------------------------------------------------------------------------------- /Runtime/Components/MaterialPropertyBlockComponent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Unity.ShaderGlobals 6 | { 7 | [RequireComponent(typeof(Renderer))] 8 | public class MaterialPropertyBlockComponent : MonoBehaviour 9 | { 10 | [System.Serializable] 11 | public class PropertyBlockElement 12 | { 13 | public string name; 14 | public string reference; 15 | public T value; 16 | } 17 | 18 | [SerializeField] List> floats; 19 | [SerializeField] List> colors; 20 | 21 | Renderer _renderer; 22 | new Renderer renderer 23 | { 24 | get 25 | { 26 | if (_renderer == null) 27 | _renderer = GetComponent(); 28 | return _renderer; 29 | } 30 | } 31 | 32 | public void ApplyPropertyBlock() 33 | { 34 | var propertyBlock = new MaterialPropertyBlock(); 35 | foreach (var f in floats) 36 | propertyBlock.SetFloat(f.reference, f.value); 37 | foreach (var c in colors) 38 | propertyBlock.SetColor(c.reference, c.value); 39 | 40 | renderer.SetPropertyBlock(propertyBlock); 41 | } 42 | 43 | public void ResetPropertyBlock() 44 | { 45 | renderer.SetPropertyBlock(null); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Runtime/Components/MaterialPropertyBlockComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ad7d5614831141e39504b54f50b02c0 -------------------------------------------------------------------------------- /Runtime/Components/TransformVector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Unity.ShaderGlobals.Components 6 | { 7 | [AddComponentMenu("Shaders/Transform Vector")] 8 | [ExecuteAlways, ExecuteInEditMode] 9 | public class TransformVector : MonoBehaviour 10 | { 11 | public enum Source { Position, Direction, Scale } 12 | public enum Mode { Global, ByMaterial, ByPropertyBlock } 13 | 14 | [SerializeField] Source source; 15 | [SerializeField] string vectorReferenceName = "_CustomVector"; 16 | [SerializeField] Mode mode = Mode.Global; 17 | [SerializeField] Renderer[] targets; 18 | 19 | MaterialPropertyBlock _materialPropertyBlock; 20 | MaterialPropertyBlock materialPropertyBlock 21 | { 22 | get 23 | { 24 | if (_materialPropertyBlock is null) 25 | { 26 | _materialPropertyBlock = new MaterialPropertyBlock(); 27 | } 28 | return _materialPropertyBlock; 29 | } 30 | } 31 | 32 | private void Awake() 33 | { 34 | if (mode == Mode.ByPropertyBlock && targets.Length > 0) 35 | { 36 | materialPropertyBlock.SetVector(vectorReferenceName, vector); 37 | foreach (var renderer in targets) 38 | { 39 | renderer.SetPropertyBlock(materialPropertyBlock); 40 | } 41 | } 42 | } 43 | 44 | Vector4 vector 45 | { 46 | get => source switch 47 | { 48 | Source.Position => transform.position, 49 | Source.Direction => transform.forward, 50 | Source.Scale => transform.localScale, 51 | }; 52 | } 53 | 54 | private void Update() 55 | { 56 | switch (mode) 57 | { 58 | case Mode.Global: 59 | Shader.SetGlobalVector(vectorReferenceName, vector); 60 | break; 61 | case Mode.ByMaterial: 62 | if (targets.Length == 0) 63 | break; 64 | foreach (var renderer in targets) 65 | { 66 | renderer.material.SetVector(vectorReferenceName, vector); 67 | } 68 | break; 69 | case Mode.ByPropertyBlock: 70 | materialPropertyBlock.SetVector(vectorReferenceName, vector); 71 | break; 72 | } 73 | } 74 | 75 | private void OnDrawGizmos() 76 | { 77 | Gizmos.matrix = transform.localToWorldMatrix; 78 | Gizmos.color = Color.cyan; 79 | switch (source) 80 | { 81 | case Source.Position: 82 | break; 83 | case Source.Direction: 84 | Gizmos.DrawRay(Vector3.zero, Vector3.forward); 85 | break; 86 | case Source.Scale: 87 | Gizmos.DrawWireCube(Vector3.zero, transform.localScale); 88 | break; 89 | } 90 | } 91 | 92 | [ContextMenu("Reset PropertyBlocks on Targets")] 93 | void ResetTargets() 94 | { 95 | foreach (var renderer in targets) 96 | { 97 | renderer.SetPropertyBlock(null); 98 | } 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /Runtime/Components/TransformVector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31bca8daa422d430fbbf1889545028e4 3 | -------------------------------------------------------------------------------- /Runtime/Components/Wind.hlsl: -------------------------------------------------------------------------------- 1 | float4 _WindVector; 2 | float4 _WindValues; 3 | 4 | void Wind_float(out float3 Position, out float3 Direction, out float Radius, out float Strength, out float Turbulence, out float PulseMagnitude, out float PulseFrequency) 5 | { 6 | #if defined(SHADERGRAPH_PREVIEW) 7 | Position = float3(-1, 0, -1); 8 | Direction = float3(.7, .2, .7); 9 | Radius = 1; 10 | Strength = 1; 11 | Turbulence = 1; 12 | PulseMagnitude = 0.5; 13 | PulseFrequency = 0.01; 14 | #else 15 | Position = _WindVector.xyz; 16 | Direction = _WindVector.xyz; 17 | Radius = _WindVector.w; 18 | Strength = _WindValues.x; 19 | Turbulence = _WindValues.y; 20 | PulseMagnitude = _WindValues.z; 21 | PulseFrequency = _WindValues.w; 22 | #endif 23 | } -------------------------------------------------------------------------------- /Runtime/Components/Wind.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4bbcba1645e64b07a8904b8ad28d563 3 | ShaderIncludeImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Components/Wind.shadersubgraph: -------------------------------------------------------------------------------- 1 | { 2 | "m_SGVersion": 3, 3 | "m_Type": "UnityEditor.ShaderGraph.GraphData", 4 | "m_ObjectId": "7442096484a34f17a0ddd86893679842", 5 | "m_Properties": [], 6 | "m_Keywords": [ 7 | { 8 | "m_Id": "015c1c46506a4b3a8bfc6cfd820918c5" 9 | } 10 | ], 11 | "m_Dropdowns": [], 12 | "m_CategoryData": [ 13 | { 14 | "m_Id": "f459b1d467a541eca361088cd36af3d5" 15 | } 16 | ], 17 | "m_Nodes": [ 18 | { 19 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 20 | }, 21 | { 22 | "m_Id": "b55f9fd259f440db9429d565fbf08628" 23 | }, 24 | { 25 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 26 | } 27 | ], 28 | "m_GroupDatas": [], 29 | "m_StickyNoteDatas": [], 30 | "m_Edges": [ 31 | { 32 | "m_OutputSlot": { 33 | "m_Node": { 34 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 35 | }, 36 | "m_SlotId": 0 37 | }, 38 | "m_InputSlot": { 39 | "m_Node": { 40 | "m_Id": "b55f9fd259f440db9429d565fbf08628" 41 | }, 42 | "m_SlotId": 4 43 | } 44 | }, 45 | { 46 | "m_OutputSlot": { 47 | "m_Node": { 48 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 49 | }, 50 | "m_SlotId": 1 51 | }, 52 | "m_InputSlot": { 53 | "m_Node": { 54 | "m_Id": "b55f9fd259f440db9429d565fbf08628" 55 | }, 56 | "m_SlotId": 1 57 | } 58 | }, 59 | { 60 | "m_OutputSlot": { 61 | "m_Node": { 62 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 63 | }, 64 | "m_SlotId": 2 65 | }, 66 | "m_InputSlot": { 67 | "m_Node": { 68 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 69 | }, 70 | "m_SlotId": 2 71 | } 72 | }, 73 | { 74 | "m_OutputSlot": { 75 | "m_Node": { 76 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 77 | }, 78 | "m_SlotId": 3 79 | }, 80 | "m_InputSlot": { 81 | "m_Node": { 82 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 83 | }, 84 | "m_SlotId": 3 85 | } 86 | }, 87 | { 88 | "m_OutputSlot": { 89 | "m_Node": { 90 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 91 | }, 92 | "m_SlotId": 4 93 | }, 94 | "m_InputSlot": { 95 | "m_Node": { 96 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 97 | }, 98 | "m_SlotId": 4 99 | } 100 | }, 101 | { 102 | "m_OutputSlot": { 103 | "m_Node": { 104 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 105 | }, 106 | "m_SlotId": 5 107 | }, 108 | "m_InputSlot": { 109 | "m_Node": { 110 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 111 | }, 112 | "m_SlotId": 5 113 | } 114 | }, 115 | { 116 | "m_OutputSlot": { 117 | "m_Node": { 118 | "m_Id": "65a4a5a4efe24faa9d7045c9b2148100" 119 | }, 120 | "m_SlotId": 6 121 | }, 122 | "m_InputSlot": { 123 | "m_Node": { 124 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 125 | }, 126 | "m_SlotId": 6 127 | } 128 | }, 129 | { 130 | "m_OutputSlot": { 131 | "m_Node": { 132 | "m_Id": "b55f9fd259f440db9429d565fbf08628" 133 | }, 134 | "m_SlotId": 0 135 | }, 136 | "m_InputSlot": { 137 | "m_Node": { 138 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 139 | }, 140 | "m_SlotId": 1 141 | } 142 | } 143 | ], 144 | "m_VertexContext": { 145 | "m_Position": { 146 | "x": 0.0, 147 | "y": 0.0 148 | }, 149 | "m_Blocks": [] 150 | }, 151 | "m_FragmentContext": { 152 | "m_Position": { 153 | "x": 0.0, 154 | "y": 0.0 155 | }, 156 | "m_Blocks": [] 157 | }, 158 | "m_PreviewData": { 159 | "serializedMesh": { 160 | "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", 161 | "m_Guid": "" 162 | }, 163 | "preventRotation": false 164 | }, 165 | "m_Path": "Sub Graphs", 166 | "m_GraphPrecision": 1, 167 | "m_PreviewMode": 2, 168 | "m_OutputNode": { 169 | "m_Id": "cd29512fbd6e47128706d3a46bf8f309" 170 | }, 171 | "m_ActiveTargets": [] 172 | } 173 | 174 | { 175 | "m_SGVersion": 1, 176 | "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", 177 | "m_ObjectId": "015c1c46506a4b3a8bfc6cfd820918c5", 178 | "m_Guid": { 179 | "m_GuidSerialized": "9049b447-5ced-4cd9-9d00-1f081964a613" 180 | }, 181 | "m_Name": "WINDMODE", 182 | "m_DefaultRefNameVersion": 1, 183 | "m_RefNameGeneratedByDisplayName": "WINDMODE", 184 | "m_DefaultReferenceName": "_WINDMODE", 185 | "m_OverrideReferenceName": "_WIND", 186 | "m_GeneratePropertyBlock": true, 187 | "m_UseCustomSlotLabel": false, 188 | "m_CustomSlotLabel": "", 189 | "m_DismissedVersion": 0, 190 | "m_KeywordType": 1, 191 | "m_KeywordDefinition": 1, 192 | "m_KeywordScope": 1, 193 | "m_KeywordStages": 63, 194 | "m_Entries": [ 195 | { 196 | "id": 4, 197 | "displayName": "SPHERICAL", 198 | "referenceName": "SPHERICAL" 199 | }, 200 | { 201 | "id": 1, 202 | "displayName": "DIRECTIONAL", 203 | "referenceName": "DIRECTIONAL" 204 | } 205 | ], 206 | "m_Value": 1, 207 | "m_IsEditable": true 208 | } 209 | 210 | { 211 | "m_SGVersion": 0, 212 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 213 | "m_ObjectId": "125582a91baf43bdaea7746a361ffdc3", 214 | "m_Id": 0, 215 | "m_DisplayName": "Out", 216 | "m_SlotType": 1, 217 | "m_Hidden": false, 218 | "m_ShaderOutputName": "Out", 219 | "m_StageCapability": 3, 220 | "m_Value": { 221 | "x": 0.0, 222 | "y": 0.0, 223 | "z": 0.0, 224 | "w": 0.0 225 | }, 226 | "m_DefaultValue": { 227 | "x": 0.0, 228 | "y": 0.0, 229 | "z": 0.0, 230 | "w": 0.0 231 | } 232 | } 233 | 234 | { 235 | "m_SGVersion": 0, 236 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 237 | "m_ObjectId": "1350591f234d4bc8a53388fbf0b73a39", 238 | "m_Id": 6, 239 | "m_DisplayName": "PulseFrequency", 240 | "m_SlotType": 0, 241 | "m_Hidden": false, 242 | "m_ShaderOutputName": "PulseFrequency", 243 | "m_StageCapability": 3, 244 | "m_Value": 0.0, 245 | "m_DefaultValue": 0.0, 246 | "m_Labels": [] 247 | } 248 | 249 | { 250 | "m_SGVersion": 0, 251 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 252 | "m_ObjectId": "22ee28a4ed5d45c9a2c0326f30ffd98a", 253 | "m_Id": 2, 254 | "m_DisplayName": "Radius", 255 | "m_SlotType": 0, 256 | "m_Hidden": false, 257 | "m_ShaderOutputName": "Radius", 258 | "m_StageCapability": 3, 259 | "m_Value": 0.0, 260 | "m_DefaultValue": 0.0, 261 | "m_Labels": [] 262 | } 263 | 264 | { 265 | "m_SGVersion": 0, 266 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 267 | "m_ObjectId": "2a706520981246c68ea3e108ac58ff49", 268 | "m_Id": 4, 269 | "m_DisplayName": "Turbulence", 270 | "m_SlotType": 1, 271 | "m_Hidden": false, 272 | "m_ShaderOutputName": "Turbulence", 273 | "m_StageCapability": 3, 274 | "m_Value": 0.0, 275 | "m_DefaultValue": 0.0, 276 | "m_Labels": [] 277 | } 278 | 279 | { 280 | "m_SGVersion": 0, 281 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 282 | "m_ObjectId": "2d2252027e6445f991054036924d804c", 283 | "m_Id": 5, 284 | "m_DisplayName": "PulseMagnitude", 285 | "m_SlotType": 0, 286 | "m_Hidden": false, 287 | "m_ShaderOutputName": "PulseMagnitude", 288 | "m_StageCapability": 3, 289 | "m_Value": 0.0, 290 | "m_DefaultValue": 0.0, 291 | "m_Labels": [] 292 | } 293 | 294 | { 295 | "m_SGVersion": 0, 296 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 297 | "m_ObjectId": "3265192e83c243fcbfec12598b6eb062", 298 | "m_Id": 1, 299 | "m_DisplayName": "Out_Vector4", 300 | "m_SlotType": 0, 301 | "m_Hidden": false, 302 | "m_ShaderOutputName": "Out_Vector4", 303 | "m_StageCapability": 3, 304 | "m_Value": { 305 | "x": 0.0, 306 | "y": 0.0, 307 | "z": 0.0 308 | }, 309 | "m_DefaultValue": { 310 | "x": 0.0, 311 | "y": 0.0, 312 | "z": 0.0 313 | }, 314 | "m_Labels": [] 315 | } 316 | 317 | { 318 | "m_SGVersion": 0, 319 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 320 | "m_ObjectId": "4ba53b2434da4e70a938e2a5311ff84d", 321 | "m_Id": 3, 322 | "m_DisplayName": "Strength", 323 | "m_SlotType": 1, 324 | "m_Hidden": false, 325 | "m_ShaderOutputName": "Strength", 326 | "m_StageCapability": 3, 327 | "m_Value": 0.0, 328 | "m_DefaultValue": 0.0, 329 | "m_Labels": [] 330 | } 331 | 332 | { 333 | "m_SGVersion": 0, 334 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 335 | "m_ObjectId": "4e0d4eb70a4248c7b2fef2ea8eb4f63f", 336 | "m_Id": 1, 337 | "m_DisplayName": "DIRECTIONAL", 338 | "m_SlotType": 0, 339 | "m_Hidden": false, 340 | "m_ShaderOutputName": "DIRECTIONAL", 341 | "m_StageCapability": 3, 342 | "m_Value": { 343 | "x": 0.0, 344 | "y": 0.0, 345 | "z": 0.0, 346 | "w": 0.0 347 | }, 348 | "m_DefaultValue": { 349 | "x": 0.0, 350 | "y": 0.0, 351 | "z": 0.0, 352 | "w": 0.0 353 | } 354 | } 355 | 356 | { 357 | "m_SGVersion": 0, 358 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 359 | "m_ObjectId": "5dc2ec4fe8944d70b9bdd1177c8658a2", 360 | "m_Id": 4, 361 | "m_DisplayName": "SPHERICAL", 362 | "m_SlotType": 0, 363 | "m_Hidden": false, 364 | "m_ShaderOutputName": "SPHERICAL", 365 | "m_StageCapability": 3, 366 | "m_Value": { 367 | "x": 0.0, 368 | "y": 0.0, 369 | "z": 0.0, 370 | "w": 0.0 371 | }, 372 | "m_DefaultValue": { 373 | "x": 0.0, 374 | "y": 0.0, 375 | "z": 0.0, 376 | "w": 0.0 377 | } 378 | } 379 | 380 | { 381 | "m_SGVersion": 0, 382 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 383 | "m_ObjectId": "60c24de4eb194d5a8e83b76cdb6038c6", 384 | "m_Id": 5, 385 | "m_DisplayName": "PulseMagnitude", 386 | "m_SlotType": 1, 387 | "m_Hidden": false, 388 | "m_ShaderOutputName": "PulseMagnitude", 389 | "m_StageCapability": 3, 390 | "m_Value": 0.0, 391 | "m_DefaultValue": 0.0, 392 | "m_Labels": [] 393 | } 394 | 395 | { 396 | "m_SGVersion": 1, 397 | "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", 398 | "m_ObjectId": "65a4a5a4efe24faa9d7045c9b2148100", 399 | "m_Group": { 400 | "m_Id": "" 401 | }, 402 | "m_Name": "Wind (Custom Function)", 403 | "m_DrawState": { 404 | "m_Expanded": true, 405 | "m_Position": { 406 | "serializedVersion": "2", 407 | "x": -992.0, 408 | "y": -297.5, 409 | "width": 183.0, 410 | "height": 238.0 411 | } 412 | }, 413 | "m_Slots": [ 414 | { 415 | "m_Id": "df7855d3792d43caa55526b1957772d7" 416 | }, 417 | { 418 | "m_Id": "e3d8a4494c2c4ceca077740c7f81156a" 419 | }, 420 | { 421 | "m_Id": "b7fae3de0a2c4c828afb0bf5f0439256" 422 | }, 423 | { 424 | "m_Id": "4ba53b2434da4e70a938e2a5311ff84d" 425 | }, 426 | { 427 | "m_Id": "2a706520981246c68ea3e108ac58ff49" 428 | }, 429 | { 430 | "m_Id": "60c24de4eb194d5a8e83b76cdb6038c6" 431 | }, 432 | { 433 | "m_Id": "d6bf2c088ad14acca12240239a775f3d" 434 | } 435 | ], 436 | "synonyms": [ 437 | "code", 438 | "HLSL" 439 | ], 440 | "m_Precision": 1, 441 | "m_PreviewExpanded": false, 442 | "m_DismissedVersion": 0, 443 | "m_PreviewMode": 0, 444 | "m_CustomColors": { 445 | "m_SerializableColors": [] 446 | }, 447 | "m_SourceType": 0, 448 | "m_FunctionName": "Wind", 449 | "m_FunctionSource": "e4bbcba1645e64b07a8904b8ad28d563", 450 | "m_FunctionBody": "Enter function body here..." 451 | } 452 | 453 | { 454 | "m_SGVersion": 0, 455 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 456 | "m_ObjectId": "8028a996750646bf9431c436dfb65ac3", 457 | "m_Id": 4, 458 | "m_DisplayName": "Turbulence", 459 | "m_SlotType": 0, 460 | "m_Hidden": false, 461 | "m_ShaderOutputName": "Turbulence", 462 | "m_StageCapability": 3, 463 | "m_Value": 0.0, 464 | "m_DefaultValue": 0.0, 465 | "m_Labels": [] 466 | } 467 | 468 | { 469 | "m_SGVersion": 0, 470 | "m_Type": "UnityEditor.ShaderGraph.KeywordNode", 471 | "m_ObjectId": "b55f9fd259f440db9429d565fbf08628", 472 | "m_Group": { 473 | "m_Id": "" 474 | }, 475 | "m_Name": "WINDMODE", 476 | "m_DrawState": { 477 | "m_Expanded": true, 478 | "m_Position": { 479 | "serializedVersion": "2", 480 | "x": -721.5, 481 | "y": -356.5, 482 | "width": 195.0, 483 | "height": 118.0 484 | } 485 | }, 486 | "m_Slots": [ 487 | { 488 | "m_Id": "125582a91baf43bdaea7746a361ffdc3" 489 | }, 490 | { 491 | "m_Id": "5dc2ec4fe8944d70b9bdd1177c8658a2" 492 | }, 493 | { 494 | "m_Id": "4e0d4eb70a4248c7b2fef2ea8eb4f63f" 495 | } 496 | ], 497 | "synonyms": [], 498 | "m_Precision": 0, 499 | "m_PreviewExpanded": false, 500 | "m_DismissedVersion": 0, 501 | "m_PreviewMode": 0, 502 | "m_CustomColors": { 503 | "m_SerializableColors": [] 504 | }, 505 | "m_Keyword": { 506 | "m_Id": "015c1c46506a4b3a8bfc6cfd820918c5" 507 | } 508 | } 509 | 510 | { 511 | "m_SGVersion": 0, 512 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 513 | "m_ObjectId": "b7fae3de0a2c4c828afb0bf5f0439256", 514 | "m_Id": 2, 515 | "m_DisplayName": "Radius", 516 | "m_SlotType": 1, 517 | "m_Hidden": false, 518 | "m_ShaderOutputName": "Radius", 519 | "m_StageCapability": 3, 520 | "m_Value": 0.0, 521 | "m_DefaultValue": 0.0, 522 | "m_Labels": [] 523 | } 524 | 525 | { 526 | "m_SGVersion": 0, 527 | "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", 528 | "m_ObjectId": "cd29512fbd6e47128706d3a46bf8f309", 529 | "m_Group": { 530 | "m_Id": "" 531 | }, 532 | "m_Name": "Output", 533 | "m_DrawState": { 534 | "m_Expanded": true, 535 | "m_Position": { 536 | "serializedVersion": "2", 537 | "x": -462.0, 538 | "y": -297.5, 539 | "width": 137.0, 540 | "height": 197.0 541 | } 542 | }, 543 | "m_Slots": [ 544 | { 545 | "m_Id": "3265192e83c243fcbfec12598b6eb062" 546 | }, 547 | { 548 | "m_Id": "22ee28a4ed5d45c9a2c0326f30ffd98a" 549 | }, 550 | { 551 | "m_Id": "de78227134794d05b7a0b67965652fd6" 552 | }, 553 | { 554 | "m_Id": "8028a996750646bf9431c436dfb65ac3" 555 | }, 556 | { 557 | "m_Id": "2d2252027e6445f991054036924d804c" 558 | }, 559 | { 560 | "m_Id": "1350591f234d4bc8a53388fbf0b73a39" 561 | } 562 | ], 563 | "synonyms": [], 564 | "m_Precision": 0, 565 | "m_PreviewExpanded": true, 566 | "m_DismissedVersion": 0, 567 | "m_PreviewMode": 0, 568 | "m_CustomColors": { 569 | "m_SerializableColors": [] 570 | }, 571 | "IsFirstSlotValid": true 572 | } 573 | 574 | { 575 | "m_SGVersion": 0, 576 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 577 | "m_ObjectId": "d6bf2c088ad14acca12240239a775f3d", 578 | "m_Id": 6, 579 | "m_DisplayName": "PulseFrequency", 580 | "m_SlotType": 1, 581 | "m_Hidden": false, 582 | "m_ShaderOutputName": "PulseFrequency", 583 | "m_StageCapability": 3, 584 | "m_Value": 0.0, 585 | "m_DefaultValue": 0.0, 586 | "m_Labels": [] 587 | } 588 | 589 | { 590 | "m_SGVersion": 0, 591 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 592 | "m_ObjectId": "de78227134794d05b7a0b67965652fd6", 593 | "m_Id": 3, 594 | "m_DisplayName": "Strength", 595 | "m_SlotType": 0, 596 | "m_Hidden": false, 597 | "m_ShaderOutputName": "Strength", 598 | "m_StageCapability": 3, 599 | "m_Value": 0.0, 600 | "m_DefaultValue": 0.0, 601 | "m_Labels": [] 602 | } 603 | 604 | { 605 | "m_SGVersion": 0, 606 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 607 | "m_ObjectId": "df7855d3792d43caa55526b1957772d7", 608 | "m_Id": 0, 609 | "m_DisplayName": "Position", 610 | "m_SlotType": 1, 611 | "m_Hidden": false, 612 | "m_ShaderOutputName": "Position", 613 | "m_StageCapability": 3, 614 | "m_Value": { 615 | "x": 0.0, 616 | "y": 0.0, 617 | "z": 0.0 618 | }, 619 | "m_DefaultValue": { 620 | "x": 0.0, 621 | "y": 0.0, 622 | "z": 0.0 623 | }, 624 | "m_Labels": [] 625 | } 626 | 627 | { 628 | "m_SGVersion": 0, 629 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 630 | "m_ObjectId": "e3d8a4494c2c4ceca077740c7f81156a", 631 | "m_Id": 1, 632 | "m_DisplayName": "Direction", 633 | "m_SlotType": 1, 634 | "m_Hidden": false, 635 | "m_ShaderOutputName": "Direction", 636 | "m_StageCapability": 3, 637 | "m_Value": { 638 | "x": 0.0, 639 | "y": 0.0, 640 | "z": 0.0 641 | }, 642 | "m_DefaultValue": { 643 | "x": 0.0, 644 | "y": 0.0, 645 | "z": 0.0 646 | }, 647 | "m_Labels": [] 648 | } 649 | 650 | { 651 | "m_SGVersion": 0, 652 | "m_Type": "UnityEditor.ShaderGraph.CategoryData", 653 | "m_ObjectId": "f459b1d467a541eca361088cd36af3d5", 654 | "m_Name": "", 655 | "m_ChildObjectList": [ 656 | { 657 | "m_Id": "015c1c46506a4b3a8bfc6cfd820918c5" 658 | } 659 | ] 660 | } 661 | 662 | -------------------------------------------------------------------------------- /Runtime/Components/Wind.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70aec72f70463471fb507cec94259be8 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /Runtime/Components/WindProperties.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | 6 | namespace Unity.ShaderGlobals.Components 7 | { 8 | [AddComponentMenu("Shaders/Wind Properties"), RequireComponent(typeof(WindZone))] 9 | [ExecuteAlways, ExecuteInEditMode] 10 | public class WindProperties : MonoBehaviour 11 | { 12 | string _windVectorReferenceName = "_WindPosition"; 13 | string _windFloatValuesReferenceName = "_WindValues"; 14 | 15 | GlobalKeyword wind_dir_kw, wind_spherical_kw; 16 | Vector4 windVector, windValues; 17 | 18 | WindZone _windZone; 19 | WindZone WindZone 20 | { 21 | get 22 | { 23 | if (_windZone == null) 24 | _windZone = GetComponent(); 25 | return _windZone; 26 | } 27 | } 28 | 29 | private void Start() 30 | { 31 | wind_dir_kw = new GlobalKeyword("_WIND_DIRECTIONAL"); 32 | wind_spherical_kw = new GlobalKeyword("_WIND_SPHERICAL"); 33 | 34 | switch (WindZone.mode) 35 | { 36 | case WindZoneMode.Directional: 37 | Shader.SetKeyword(wind_dir_kw, true); 38 | Shader.SetKeyword(wind_spherical_kw, false); 39 | break; 40 | case WindZoneMode.Spherical: 41 | Shader.SetKeyword(wind_dir_kw, false); 42 | Shader.SetKeyword(wind_spherical_kw, true); 43 | break; 44 | } 45 | } 46 | 47 | private void Update() 48 | { 49 | switch (WindZone.mode) 50 | { 51 | case WindZoneMode.Directional: 52 | windVector = transform.forward; 53 | break; 54 | case WindZoneMode.Spherical: 55 | windVector = transform.position; 56 | break; 57 | } 58 | 59 | windVector.w = WindZone.radius; 60 | windValues.Set(WindZone.windMain, 61 | WindZone.windTurbulence, 62 | WindZone.windPulseMagnitude, 63 | WindZone.windPulseFrequency 64 | ); 65 | 66 | Shader.SetGlobalVector(_windVectorReferenceName, transform.forward); 67 | Shader.SetGlobalVector(_windFloatValuesReferenceName, windValues); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Runtime/Components/WindProperties.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4930d8737f26640f39f37687dd2f2f57 3 | -------------------------------------------------------------------------------- /Runtime/ShaderGlobals.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UIElements; 6 | #if UNITY_EDITOR 7 | using UnityEditor; 8 | using UnityEditor.UIElements; 9 | using System.IO; 10 | #endif 11 | 12 | // TODO : prevent adding the same name twice 13 | // TODO : prevent adding built-in globals, display them as grayed out --> https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html 14 | 15 | namespace Unity.ShaderGlobals 16 | { 17 | public sealed class ShaderGlobals : ScriptableObject 18 | { 19 | [Serializable] 20 | public class ShaderGlobal 21 | { 22 | public string referenceName; 23 | public T value; 24 | } 25 | 26 | // TODO : move to Project Settings Folder 27 | public const string k_ShaderGlobalsSettingsPath = "Assets/Resources/ShaderGlobals.asset"; 28 | //public const string k_ShaderGlobalsSettingsPath = "ProjectSettings/ShaderGlobals.asset"; 29 | 30 | public List> globalFloats = new List>(); 31 | public List> globalIntegers = new List>(); 32 | public List> globalColors = new List>(); 33 | public List> globalVectors = new List>(); 34 | public List> globalMatrices = new List>(); 35 | public List> globalTextures = new List>(); 36 | public List>> globalFloatArrays = new List>>(); 37 | public List>> globalVectorArrays = new List>>(); 38 | public List>> globalMatrixArrays = new List>>(); 39 | 40 | public List> globalKeywords = new List>(); 41 | 42 | #if UNITY_EDITOR 43 | [InitializeOnLoadMethod, InitializeOnEnterPlayMode] 44 | #endif 45 | [RuntimeInitializeOnLoadMethod] 46 | static void LoadProjectGlobals() 47 | { 48 | var settings = Resources.Load("ShaderGlobals"); 49 | if (settings is null) 50 | return; 51 | 52 | settings.SetGlobals(); 53 | } 54 | 55 | public void SetGlobals() 56 | { 57 | // floats 58 | foreach (var floatGlobal in globalFloats) 59 | Shader.SetGlobalFloat(floatGlobal.referenceName, floatGlobal.value); 60 | 61 | // float arrays 62 | foreach (var floatArrayGlobal in globalFloatArrays) 63 | Shader.SetGlobalFloatArray(floatArrayGlobal.referenceName, floatArrayGlobal.value); 64 | 65 | // colors 66 | foreach (var colorGlobal in globalColors) 67 | Shader.SetGlobalColor(colorGlobal.referenceName, colorGlobal.value); 68 | 69 | // integers 70 | foreach (var intGlobal in globalIntegers) 71 | Shader.SetGlobalInteger(intGlobal.referenceName, intGlobal.value); 72 | 73 | // matrices 74 | foreach (var matrixGlobal in globalMatrices) 75 | Shader.SetGlobalMatrix(matrixGlobal.referenceName, matrixGlobal.value); 76 | 77 | // matrix arrays 78 | foreach (var matrixArrayGlobal in globalMatrixArrays) 79 | Shader.SetGlobalMatrixArray(matrixArrayGlobal.referenceName, matrixArrayGlobal.value); 80 | 81 | // textures 82 | foreach (var textureGlobal in globalTextures) 83 | Shader.SetGlobalTexture(textureGlobal.referenceName, textureGlobal.value); 84 | 85 | // vectors 86 | foreach (var vectorGlobal in globalVectors) 87 | Shader.SetGlobalVector(vectorGlobal.referenceName, vectorGlobal.value); 88 | 89 | // vector arrays 90 | foreach (var vectorArrayGlobal in globalVectorArrays) 91 | Shader.SetGlobalVectorArray(vectorArrayGlobal.referenceName, vectorArrayGlobal.value); 92 | 93 | // keywords 94 | foreach (var keyword in globalKeywords) 95 | { 96 | if (keyword.value) 97 | Shader.EnableKeyword(keyword.referenceName); 98 | else 99 | Shader.DisableKeyword(keyword.referenceName); 100 | } 101 | } 102 | 103 | private void OnValidate() 104 | { 105 | SetGlobals(); 106 | } 107 | 108 | #if UNITY_EDITOR 109 | internal static ShaderGlobals GetOrCreateSettings() 110 | { 111 | var settings = AssetDatabase.LoadAssetAtPath(k_ShaderGlobalsSettingsPath); 112 | if (settings == null) 113 | { 114 | var dir = Path.GetDirectoryName(k_ShaderGlobalsSettingsPath); 115 | if (!Directory.Exists(dir)) 116 | Directory.CreateDirectory(dir); 117 | settings = ScriptableObject.CreateInstance(); 118 | AssetDatabase.CreateAsset(settings, k_ShaderGlobalsSettingsPath); 119 | AssetDatabase.SaveAssets(); 120 | } 121 | return settings; 122 | } 123 | 124 | internal static SerializedObject GetSerializedSettings() 125 | { 126 | return new SerializedObject(GetOrCreateSettings()); 127 | } 128 | 129 | [SettingsProvider] 130 | static SettingsProvider ShaderGlobalsSettingsProvider() 131 | { 132 | var provider = new SettingsProvider("Project/Graphics/Shader Globals", SettingsScope.Project) 133 | { 134 | label = "Shader Globals", 135 | activateHandler = (searchContext, rootElement) => 136 | { 137 | var serializedObject = GetSerializedSettings(); 138 | 139 | var title = new Label() 140 | { 141 | text = "Shader Globals" 142 | }; 143 | title.AddToClassList("title"); 144 | rootElement.Add(title); 145 | 146 | 147 | var settings = new VisualElement() 148 | { 149 | style = 150 | { 151 | flexDirection = FlexDirection.Column 152 | } 153 | }; 154 | settings.AddToClassList("property-list"); 155 | settings.Bind(serializedObject); 156 | 157 | rootElement.Add(settings); 158 | 159 | settings.Add(MakeListView("globalFloats", "Global Floats")); 160 | settings.Add(MakeListView("globalIntegers", "Global Integers")); 161 | settings.Add(MakeListView("globalColors", "Global Colors")); 162 | settings.Add(MakeListView("globalVectors", "Global Vectors")); 163 | settings.Add(MakeListView("globalMatrices", "Global Matrices")); 164 | settings.Add(MakeListView("globalTextures", "Global Textures")); 165 | settings.Add(MakeListView("globalFloatArrays", "Global Float Arrays")); 166 | settings.Add(MakeListView("globalVectorArrays", "Global Vector Arrays")); 167 | settings.Add(MakeListView("globalMatrixArrays", "Global Matrix Arrays")); 168 | 169 | settings.Add(MakeListView("globalKeywords", "Global Keywords")); 170 | }, 171 | 172 | keywords = new HashSet(new[] { "Shader", "Global" }) 173 | }; 174 | 175 | return provider; 176 | 177 | // TODO : improve arrays display 178 | VisualElement MakeListView(string propertyPath, string headerTitle) 179 | { 180 | var gPropField = new ListView(); 181 | gPropField.showFoldoutHeader = true; 182 | gPropField.headerTitle = headerTitle; 183 | gPropField.virtualizationMethod = CollectionVirtualizationMethod.DynamicHeight; 184 | gPropField.reorderable = true; 185 | gPropField.reorderMode = ListViewReorderMode.Animated; 186 | gPropField.bindingPath = propertyPath; 187 | gPropField.showAddRemoveFooter = true; 188 | gPropField.AddToClassList("property-value"); 189 | return gPropField; 190 | } 191 | } 192 | #endif 193 | } 194 | } -------------------------------------------------------------------------------- /Runtime/ShaderGlobals.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fae799cb267da498b946e267383032aa -------------------------------------------------------------------------------- /Runtime/Timeline.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dce9d7b9153047f196ca0dc33ede064 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76f8cb948964c4103b17577f22530221 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlAsset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Playables; 5 | using UnityEngine.Timeline; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | public class AmbientLightControlAsset : PlayableAsset, IPropertyPreview 10 | { 11 | public AmbientLightControlBehaviour template; 12 | 13 | public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) 14 | { 15 | var playable = ScriptPlayable.Create(graph, template); 16 | return playable; 17 | } 18 | 19 | public void GatherProperties(PlayableDirector director, IPropertyCollector driver) 20 | { 21 | AmbientLightControlBehaviour.originalColor = RenderSettings.ambientLight; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf968350e74d0448694fa378e805ccd9 -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Playables; 5 | using UnityEngine.Timeline; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | [System.Serializable] 10 | public class AmbientLightControlBehaviour : PlayableBehaviour 11 | { 12 | public static Color originalColor = default; 13 | [ColorUsage(false, true)] public Color color = Color.white; 14 | } 15 | } -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c95bed240435471995972a0a66bd086 -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlMixerBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Playables; 5 | using UnityEngine.Timeline; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | public class AmbientLightControlMixerBehaviour : PlayableBehaviour 10 | { 11 | public override void ProcessFrame(Playable playable, FrameData info, object playerData) 12 | { 13 | Color finalColor = Color.black; 14 | 15 | int inputCount = playable.GetInputCount(); 16 | 17 | for (int i = 0; i < inputCount; i++) 18 | { 19 | float inputWeight = playable.GetInputWeight(i); 20 | ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); 21 | AmbientLightControlBehaviour input = inputPlayable.GetBehaviour(); 22 | 23 | // Use the above variables to process each frame of this playable. 24 | finalColor += input.color * inputWeight; 25 | } 26 | 27 | RenderSettings.ambientLight = finalColor; 28 | } 29 | 30 | public override void OnPlayableDestroy(Playable playable) 31 | { 32 | base.OnPlayableDestroy(playable); 33 | RenderSettings.ambientLight = AmbientLightControlBehaviour.originalColor; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlMixerBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1c06dd46a19e44dea1087c5e37f9433 -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlTrack.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Playables; 5 | using UnityEngine.Timeline; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | [TrackClipType(typeof(AmbientLightControlAsset))] 10 | [TrackBindingType(null)] 11 | public class AmbientLightControlTrack : TrackAsset 12 | { 13 | public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) 14 | { 15 | return ScriptPlayable.Create(graph, inputCount); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Runtime/Timeline/AmbientLight/AmbientLightControlTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6177d04fe029437aba54973265760f4 -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afda270ed330b8246a8c7a64253caea6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlAsset.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using UnityEngine; 5 | using UnityEngine.Timeline; 6 | using UnityEngine.Playables; 7 | 8 | namespace Unity.ShaderGlobals.Timeline 9 | { 10 | #if UNITY_EDITOR 11 | [DisplayName("Boolean Clip")] 12 | #endif 13 | class GlobalBooleanControlAsset : PlayableAsset, ITimelineClipAsset 14 | { 15 | public ClipCaps clipCaps { get { return ClipCaps.None; } } 16 | 17 | public override Playable CreatePlayable(PlayableGraph graph, GameObject go) 18 | { 19 | return Playable.Create(graph); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 160fe462c8bdae4489837b5576bdd547 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | namespace Unity.ShaderGlobals.Timeline 5 | { 6 | class GlobalBooleanControlBehaviour : PlayableBehaviour 7 | { 8 | GlobalBooleanControlTrack.PostPlaybackState m_PostPlaybackState; 9 | 10 | public string referenceName { get; set; } 11 | public float originalValue { get; set; } 12 | 13 | public static ScriptPlayable Create(PlayableGraph graph, int inputCount) 14 | { 15 | return ScriptPlayable.Create(graph, inputCount); 16 | } 17 | 18 | public GlobalBooleanControlTrack.PostPlaybackState postPlaybackState 19 | { 20 | get { return m_PostPlaybackState; } 21 | set { m_PostPlaybackState = value; } 22 | } 23 | 24 | public override void OnPlayableDestroy(Playable playable) 25 | { 26 | switch (m_PostPlaybackState) 27 | { 28 | case GlobalBooleanControlTrack.PostPlaybackState.Active: 29 | Shader.SetGlobalFloat(referenceName, 1f); 30 | break; 31 | case GlobalBooleanControlTrack.PostPlaybackState.Inactive: 32 | Shader.SetGlobalFloat(referenceName, 0f); 33 | break; 34 | case GlobalBooleanControlTrack.PostPlaybackState.Revert: 35 | Shader.SetGlobalFloat(referenceName, originalValue); 36 | break; 37 | case GlobalBooleanControlTrack.PostPlaybackState.LeaveAsIs: 38 | default: 39 | break; 40 | } 41 | } 42 | 43 | public override void ProcessFrame(Playable playable, FrameData info, object playerData) 44 | { 45 | int inputCount = playable.GetInputCount(); 46 | bool hasInput = false; 47 | for (int i = 0; i < inputCount; i++) 48 | { 49 | if (playable.GetInputWeight(i) > 0) 50 | { 51 | hasInput = true; 52 | break; 53 | } 54 | } 55 | 56 | Shader.SetGlobalFloat(referenceName, hasInput ? 1f : 0f); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c7e5b4d48f81144e9e51edc1f0ca143 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlTrack.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using System; 5 | using UnityEngine; 6 | using UnityEngine.Timeline; 7 | using UnityEngine.Playables; 8 | 9 | namespace Unity.ShaderGlobals.Timeline 10 | { 11 | #if UNITY_EDITOR 12 | [DisplayName("Shader Globals/Boolean Track")] 13 | #endif 14 | [Serializable] 15 | [TrackClipType(typeof(GlobalBooleanControlAsset))] 16 | [TrackBindingType(null)] 17 | [ExcludeFromPreset] 18 | public class GlobalBooleanControlTrack : TrackAsset 19 | { 20 | [SerializeField] string _referenceName = "_customBoolean"; 21 | 22 | [SerializeField] 23 | PostPlaybackState m_PostPlaybackState = PostPlaybackState.LeaveAsIs; 24 | 25 | public string referenceName 26 | { 27 | get { return _referenceName; } 28 | set { _referenceName = value; UpdateTrackReference(); } 29 | } 30 | 31 | GlobalBooleanControlBehaviour m_ActivationMixer; 32 | 33 | public enum PostPlaybackState { Active, Inactive, Revert, LeaveAsIs } 34 | 35 | public PostPlaybackState postPlaybackState 36 | { 37 | get { return m_PostPlaybackState; } 38 | set { m_PostPlaybackState = value; UpdateTrackMode(); } 39 | } 40 | 41 | /// 42 | public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) 43 | { 44 | var mixer = GlobalBooleanControlBehaviour.Create(graph, inputCount); 45 | m_ActivationMixer = mixer.GetBehaviour(); 46 | 47 | UpdateTrackMode(); 48 | UpdateTrackReference(); 49 | 50 | return mixer; 51 | } 52 | 53 | internal void UpdateTrackMode() 54 | { 55 | if (m_ActivationMixer != null) 56 | m_ActivationMixer.postPlaybackState = m_PostPlaybackState; 57 | } 58 | 59 | /// 60 | protected override void OnCreateClip(TimelineClip clip) 61 | { 62 | clip.displayName = "On"; 63 | base.OnCreateClip(clip); 64 | } 65 | 66 | internal void UpdateTrackReference() 67 | { 68 | if (m_ActivationMixer != null) 69 | { 70 | m_ActivationMixer.referenceName = referenceName; 71 | m_ActivationMixer.originalValue = Shader.GetGlobalFloat(referenceName); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBoolean/GlobalBooleanControlTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82d8fe4a8aa3ced458eeb71848e7ca34 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c8d8399029ce24c88180306fcea246 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlAsset.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using UnityEngine; 5 | using UnityEngine.Timeline; 6 | using UnityEngine.Playables; 7 | 8 | namespace Unity.ShaderGlobals.Timeline 9 | { 10 | #if UNITY_EDITOR 11 | [DisplayName("Boolean Keyword Clip")] 12 | #endif 13 | class GlobalBooleanKeywordControlAsset : PlayableAsset, ITimelineClipAsset 14 | { 15 | public ClipCaps clipCaps { get { return ClipCaps.None; } } 16 | 17 | public override Playable CreatePlayable(PlayableGraph graph, GameObject go) 18 | { 19 | return Playable.Create(graph); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18282c48d99d8c342b1965fca00574f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | namespace Unity.ShaderGlobals.Timeline 5 | { 6 | class GlobalBooleanKeywordControlBehaviour : PlayableBehaviour 7 | { 8 | GlobalBooleanKeywordControlTrack.PostPlaybackState m_PostPlaybackState; 9 | 10 | public string referenceName { get; set; } 11 | public bool originalValue { get; set; } 12 | 13 | public static ScriptPlayable Create(PlayableGraph graph, int inputCount) 14 | { 15 | return ScriptPlayable.Create(graph, inputCount); 16 | } 17 | 18 | public GlobalBooleanKeywordControlTrack.PostPlaybackState postPlaybackState 19 | { 20 | get { return m_PostPlaybackState; } 21 | set { m_PostPlaybackState = value; } 22 | } 23 | 24 | public override void OnPlayableDestroy(Playable playable) 25 | { 26 | switch (m_PostPlaybackState) 27 | { 28 | case GlobalBooleanKeywordControlTrack.PostPlaybackState.Active: 29 | Shader.EnableKeyword(referenceName); 30 | break; 31 | case GlobalBooleanKeywordControlTrack.PostPlaybackState.Inactive: 32 | Shader.DisableKeyword(referenceName); 33 | break; 34 | case GlobalBooleanKeywordControlTrack.PostPlaybackState.Revert: 35 | if (originalValue) 36 | Shader.EnableKeyword(referenceName); 37 | else 38 | Shader.DisableKeyword(referenceName); 39 | break; 40 | case GlobalBooleanKeywordControlTrack.PostPlaybackState.LeaveAsIs: 41 | default: 42 | break; 43 | } 44 | } 45 | 46 | public override void ProcessFrame(Playable playable, FrameData info, object playerData) 47 | { 48 | int inputCount = playable.GetInputCount(); 49 | bool hasInput = false; 50 | for (int i = 0; i < inputCount; i++) 51 | { 52 | if (playable.GetInputWeight(i) > 0) 53 | { 54 | hasInput = true; 55 | break; 56 | } 57 | } 58 | 59 | if (hasInput) 60 | Shader.EnableKeyword(referenceName); 61 | else 62 | Shader.DisableKeyword(referenceName); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ffa4f7306b567545b6e4ca61cbff435 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlTrack.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using System; 5 | using UnityEngine; 6 | using UnityEngine.Timeline; 7 | using UnityEngine.Playables; 8 | 9 | namespace Unity.ShaderGlobals.Timeline 10 | { 11 | #if UNITY_EDITOR 12 | [DisplayName("Shader Globals/Boolean Keyword Track")] 13 | #endif 14 | [Serializable] 15 | [TrackClipType(typeof(GlobalBooleanKeywordControlAsset))] 16 | [TrackBindingType(null)] 17 | [ExcludeFromPreset] 18 | public class GlobalBooleanKeywordControlTrack : TrackAsset 19 | { 20 | [SerializeField] string _referenceName = "_BOOLEAN_KEYWORD"; 21 | 22 | [SerializeField] 23 | PostPlaybackState m_PostPlaybackState = PostPlaybackState.LeaveAsIs; 24 | 25 | public string referenceName 26 | { 27 | get { return _referenceName; } 28 | set { _referenceName = value; UpdateTrackReference(); } 29 | } 30 | 31 | GlobalBooleanKeywordControlBehaviour m_ActivationMixer; 32 | 33 | public enum PostPlaybackState { Active, Inactive, Revert, LeaveAsIs } 34 | 35 | public PostPlaybackState postPlaybackState 36 | { 37 | get { return m_PostPlaybackState; } 38 | set { m_PostPlaybackState = value; UpdateTrackMode(); } 39 | } 40 | 41 | /// 42 | public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) 43 | { 44 | var mixer = GlobalBooleanKeywordControlBehaviour.Create(graph, inputCount); 45 | m_ActivationMixer = mixer.GetBehaviour(); 46 | 47 | UpdateTrackMode(); 48 | UpdateTrackReference(); 49 | 50 | return mixer; 51 | } 52 | 53 | internal void UpdateTrackMode() 54 | { 55 | if (m_ActivationMixer != null) 56 | m_ActivationMixer.postPlaybackState = m_PostPlaybackState; 57 | } 58 | 59 | /// 60 | protected override void OnCreateClip(TimelineClip clip) 61 | { 62 | clip.displayName = "On"; 63 | base.OnCreateClip(clip); 64 | } 65 | 66 | internal void UpdateTrackReference() 67 | { 68 | if (m_ActivationMixer != null) 69 | { 70 | m_ActivationMixer.referenceName = referenceName; 71 | m_ActivationMixer.originalValue = Shader.IsKeywordEnabled(referenceName); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalBooleanKeyword/GlobalBooleanKeywordControlTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07f9f2a349c2bd9439549580f0c27f70 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7abf6baeef8a57642b4af8e6930e4a39 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlAsset.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using UnityEngine; 5 | using UnityEngine.Playables; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | #if UNITY_EDITOR 10 | [DisplayName("Color Clip")] 11 | #endif 12 | public class GlobalColorControlAsset : PlayableAsset 13 | { 14 | public GlobalColorControlBehaviour template; 15 | 16 | public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) 17 | { 18 | var playable = ScriptPlayable.Create(graph, template); 19 | return playable; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 143495b67ece34108a8e972378bf9473 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | namespace Unity.ShaderGlobals.Timeline 5 | { 6 | [System.Serializable] 7 | public class GlobalColorControlBehaviour : PlayableBehaviour 8 | { 9 | [ColorUsage(false, true)] public Color color = Color.white; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ea323ce191a746beb95c6ca743ac14c 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlMixerBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | namespace Unity.ShaderGlobals.Timeline 5 | { 6 | public class GlobalColorControlMixerBehaviour : PlayableBehaviour 7 | { 8 | public string referenceName { get; set; } 9 | public Color originalColor { get; set; } 10 | 11 | bool _restoreOriginalValue = false; 12 | public bool restoreOriginalValue 13 | { 14 | get { return _restoreOriginalValue; } 15 | set { _restoreOriginalValue = value; } 16 | } 17 | 18 | public override void ProcessFrame(Playable playable, FrameData info, object playerData) 19 | { 20 | Color finalColor = Color.black; 21 | 22 | int inputCount = playable.GetInputCount(); 23 | 24 | for (int i = 0; i < inputCount; i++) 25 | { 26 | float inputWeight = playable.GetInputWeight(i); 27 | ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); 28 | GlobalColorControlBehaviour input = inputPlayable.GetBehaviour(); 29 | 30 | // Use the above variables to process each frame of this playable. 31 | finalColor += input.color * inputWeight; 32 | } 33 | 34 | Shader.SetGlobalColor(referenceName, finalColor); 35 | } 36 | 37 | public override void OnPlayableDestroy(Playable playable) 38 | { 39 | base.OnPlayableDestroy(playable); 40 | 41 | if (_restoreOriginalValue) 42 | Shader.SetGlobalColor(referenceName, originalColor); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlMixerBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 086cfadc6971a4395b2557be3ce1e083 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlTrack.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using UnityEngine; 5 | using UnityEngine.Playables; 6 | using UnityEngine.Timeline; 7 | 8 | namespace Unity.ShaderGlobals.Timeline 9 | { 10 | #if UNITY_EDITOR 11 | [DisplayName("Shader Globals/Color Track")] 12 | #endif 13 | [TrackClipType(typeof(GlobalColorControlAsset))] 14 | [TrackBindingType(null)] 15 | public class GlobalColorControlTrack : TrackAsset 16 | { 17 | [SerializeField] string _referenceName = "_customFloat"; 18 | [SerializeField] bool _restoreOriginalValue = false; 19 | 20 | GlobalColorControlMixerBehaviour m_ActivationMixer; 21 | 22 | public string referenceName 23 | { 24 | get { return _referenceName; } 25 | set { _referenceName = value; UpdateTrackReference(); } 26 | } 27 | 28 | public bool restoreOriginalValue 29 | { 30 | get { return _restoreOriginalValue; } 31 | set { _restoreOriginalValue = value; UpdateTrackMode(); } 32 | } 33 | 34 | public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) 35 | { 36 | var mixer = ScriptPlayable.Create(graph, inputCount); 37 | m_ActivationMixer = mixer.GetBehaviour(); 38 | 39 | UpdateTrackMode(); 40 | UpdateTrackReference(); 41 | 42 | return mixer; 43 | } 44 | 45 | internal void UpdateTrackMode() 46 | { 47 | if (m_ActivationMixer != null) 48 | m_ActivationMixer.restoreOriginalValue = _restoreOriginalValue; 49 | } 50 | 51 | internal void UpdateTrackReference() 52 | { 53 | if (m_ActivationMixer != null) 54 | { 55 | m_ActivationMixer.referenceName = referenceName; 56 | m_ActivationMixer.originalColor = Shader.GetGlobalColor(referenceName); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalColor/GlobalColorControlTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b76e1fa8c6c3466caba90414e017705 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba5cce0f45e295e4c9939b69690d91d7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlAsset.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using UnityEngine; 5 | using UnityEngine.Playables; 6 | 7 | namespace Unity.ShaderGlobals.Timeline 8 | { 9 | #if UNITY_EDITOR 10 | [DisplayName("Float Clip")] 11 | #endif 12 | public class GlobalFloatControlAsset : PlayableAsset 13 | { 14 | public GlobalFloatControlBehaviour template; 15 | 16 | public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) 17 | { 18 | var playable = ScriptPlayable.Create(graph, template); 19 | return playable; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0e4cee00d66e4b7bba8b908ff90cde2 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.Playables; 2 | 3 | namespace Unity.ShaderGlobals.Timeline 4 | { 5 | [System.Serializable] 6 | public class GlobalFloatControlBehaviour : PlayableBehaviour 7 | { 8 | public float value = 1f; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0049be388725423498ee34e53c5e1e0 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlMixerBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | namespace Unity.ShaderGlobals.Timeline 5 | { 6 | public class GlobalFloatControlMixerBehaviour : PlayableBehaviour 7 | { 8 | public string referenceName { get; set; } 9 | public float originalValue { get; set; } 10 | 11 | bool _restoreOriginalValue = false; 12 | public bool restoreOriginalValue 13 | { 14 | get { return _restoreOriginalValue; } 15 | set { _restoreOriginalValue = value; } 16 | } 17 | 18 | public override void ProcessFrame(Playable playable, FrameData info, object playerData) 19 | { 20 | float finalValue = 0; 21 | 22 | int inputCount = playable.GetInputCount(); 23 | 24 | for (int i = 0; i < inputCount; i++) 25 | { 26 | float inputWeight = playable.GetInputWeight(i); 27 | ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); 28 | GlobalFloatControlBehaviour input = inputPlayable.GetBehaviour(); 29 | 30 | // Use the above variables to process each frame of this playable. 31 | finalValue += input.value * inputWeight; 32 | } 33 | 34 | Shader.SetGlobalFloat(referenceName, finalValue); 35 | } 36 | 37 | public override void OnPlayableDestroy(Playable playable) 38 | { 39 | base.OnPlayableDestroy(playable); 40 | 41 | if (_restoreOriginalValue) 42 | Shader.SetGlobalFloat(referenceName, originalValue); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlMixerBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3932448f3a6014103b21b3af15420a40 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlTrack.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.ComponentModel; 3 | #endif 4 | using System; 5 | using UnityEngine; 6 | using UnityEngine.Playables; 7 | using UnityEngine.Timeline; 8 | 9 | namespace Unity.ShaderGlobals.Timeline 10 | { 11 | #if UNITY_EDITOR 12 | [DisplayName("Shader Globals/Float Track")] 13 | #endif 14 | [Serializable] 15 | [TrackClipType(typeof(GlobalFloatControlAsset))] 16 | [TrackBindingType(null)] 17 | [ExcludeFromPreset] 18 | public class GlobalFloatControlTrack : TrackAsset 19 | { 20 | [SerializeField] string _referenceName = "_customFloat"; 21 | [SerializeField] bool _restoreOriginalValue = false; 22 | 23 | GlobalFloatControlMixerBehaviour m_ActivationMixer; 24 | 25 | public string referenceName 26 | { 27 | get { return _referenceName; } 28 | set { _referenceName = value; UpdateTrackReference(); } 29 | } 30 | 31 | public bool restoreOriginalValue 32 | { 33 | get { return _restoreOriginalValue; } 34 | set { _restoreOriginalValue = value; UpdateTrackMode(); } 35 | } 36 | 37 | public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) 38 | { 39 | var mixer = ScriptPlayable.Create(graph, inputCount); 40 | m_ActivationMixer = mixer.GetBehaviour(); 41 | 42 | UpdateTrackMode(); 43 | UpdateTrackReference(); 44 | 45 | return mixer; 46 | } 47 | 48 | internal void UpdateTrackMode() 49 | { 50 | if (m_ActivationMixer != null) 51 | m_ActivationMixer.restoreOriginalValue = _restoreOriginalValue; 52 | } 53 | 54 | internal void UpdateTrackReference() 55 | { 56 | if (m_ActivationMixer != null) 57 | { 58 | m_ActivationMixer.referenceName = referenceName; 59 | m_ActivationMixer.originalValue = Shader.GetGlobalFloat(referenceName); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Runtime/Timeline/GlobalFloat/GlobalFloatControlTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3adb5351e0a24ce7b17e77260c3a39c 3 | -------------------------------------------------------------------------------- /Runtime/Timeline/Unity.ShaderGlobals.Timeline.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.ShaderGlobals.Timeline", 3 | "rootNamespace": "Unity.ShaderGlobals.Timeline", 4 | "references": [ 5 | "GUID:f06555f75b070af458a003d92f9efb00" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [ 14 | "TIMELINE_ENABLED" 15 | ], 16 | "versionDefines": [ 17 | { 18 | "name": "com.unity.timeline", 19 | "expression": "", 20 | "define": "TIMELINE_ENABLED" 21 | } 22 | ], 23 | "noEngineReferences": false 24 | } -------------------------------------------------------------------------------- /Runtime/Timeline/Unity.ShaderGlobals.Timeline.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1588506fe96e342a485df60ed978c60c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Unity.ShaderGlobals.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.ShaderGlobals", 3 | "rootNamespace": "Unity.ShaderGlobals", 4 | "references": [ 5 | "GUID:df380645f10b7bc4b97d4f5eb6303d95" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Runtime/Unity.ShaderGlobals.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a3510b8f22c54717933862ea706f4e4 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/VolumeComponent.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb6757f225de4adf9acd34e503cc14f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/VolumeComponent/ShaderGlobalsVolumeComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.Rendering; 6 | 7 | namespace Unity.ShaderGlobals.Volume 8 | { 9 | [Serializable, VolumeComponentMenu("Shader/Globals")] 10 | public class ShaderGlobalsVolumeComponent : VolumeComponent 11 | { 12 | public VolumeParameter myCustomProperty = new VolumeParameter(); 13 | public VolumeParameter globals = new VolumeParameter(); 14 | public VolumeParameter>>> myFloats = new VolumeParameter>>>(); 15 | 16 | public void Update() 17 | { 18 | if (myCustomProperty.overrideState) 19 | { 20 | Shader.SetGlobalFloat("_MyCustomProperty", myCustomProperty.value); 21 | } 22 | 23 | if (globals.overrideState) 24 | { 25 | globals.value.SetGlobals(); 26 | } 27 | 28 | if (myFloats.overrideState) 29 | { 30 | foreach (var floatParam in myFloats.value) 31 | { 32 | Shader.SetGlobalFloat(floatParam.value.referenceName, floatParam.value.value); 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Runtime/VolumeComponent/ShaderGlobalsVolumeComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cac320e4a2ece4aa8b03d407dc44d9b0 -------------------------------------------------------------------------------- /Runtime/VolumeComponent/Unity.ShaderGlobals.Volume.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.ShaderGlobals.Volume", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:0a3510b8f22c54717933862ea706f4e4", 6 | "GUID:df380645f10b7bc4b97d4f5eb6303d95", 7 | "GUID:15fc0a57446b3144c949da3e2b9737a9" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [ 16 | "VOLUME_ENABLED" 17 | ], 18 | "versionDefines": [ 19 | { 20 | "name": "com.unity.render-pipelines.core", 21 | "expression": "", 22 | "define": "VOLUME_ENABLED" 23 | }, 24 | { 25 | "name": "com.unity.render-pipelines.universal", 26 | "expression": "", 27 | "define": "URP_ENABLED" 28 | } 29 | ], 30 | "noEngineReferences": false 31 | } -------------------------------------------------------------------------------- /Runtime/VolumeComponent/Unity.ShaderGlobals.Volume.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 393eea788003843509f64db5c5a48f7e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/VolumeComponent/VolumeComponentUpdater.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.Rendering; 6 | #if HDRP_ENABLED 7 | using UnityEngine.Rendering.HighDefinition; 8 | #elif URP_ENABLED 9 | using UnityEngine.Rendering.Universal; 10 | #endif 11 | 12 | namespace Unity.ShaderGlobals.Volume 13 | { 14 | [ExecuteAlways] 15 | public sealed class VolumeComponentUpdater : MonoBehaviour 16 | { 17 | VolumeStack previousStack; 18 | ShaderGlobalsVolumeComponent shaderGlobalsVolumeComponent; 19 | new Camera camera; 20 | 21 | void LateUpdate() 22 | { 23 | camera = Camera.main; 24 | 25 | if (!camera) 26 | return; 27 | VolumeStack stack; 28 | 29 | #if HDRP_ENABLED 30 | stack = HDCamera 31 | .GetOrCreate(camera) 32 | .volumeStack; 33 | #elif URP_ENABLED 34 | stack = camera 35 | .GetComponent() 36 | .volumeStack; 37 | #endif 38 | 39 | if (stack == null) 40 | return; 41 | 42 | if (stack != previousStack) 43 | { 44 | previousStack = stack; 45 | shaderGlobalsVolumeComponent = stack.GetComponent(); 46 | } 47 | 48 | shaderGlobalsVolumeComponent.Update(); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Runtime/VolumeComponent/VolumeComponentUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10650613a62144d299ba7e7d4660175f -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.unity.shader-globals", 3 | "displayName": "Shader Globals", 4 | "version": "0.0.1-preview.1", 5 | "unity": "2021.3", 6 | "description": "This package allows editing Shader Globals (floats, colors, vectors, etc) in Project Settings.", 7 | "author": { 8 | "name": "Fred Moreau", 9 | "email": "frederic.moreau@unity3d.com", 10 | "url": "https://www.unity3d.com" 11 | }, 12 | "keywords": [ 13 | "Shader", 14 | "Globals" 15 | ], 16 | "repository": { 17 | "type": "git", 18 | "url": "git@github.com:FredMoreau/com.unity.shader-globals.git" 19 | }, 20 | "samples": [], 21 | "hideInEditor": false 22 | } -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7332dde5ae649edb16c823d4646082 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------