├── HDRP ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── EditorBuildSettings.asset │ ├── XRSettings.asset │ ├── VersionControlSettings.asset │ ├── TimeManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── VFXManager.asset │ ├── HDRPProjectSettings.asset │ ├── UnityConnectSettings.asset │ ├── DynamicsManager.asset │ ├── EditorSettings.asset │ ├── PackageManagerSettings.asset │ ├── QualitySettings.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── GraphicsSettings.asset │ └── SceneTemplateSettings.json ├── Assets │ ├── Test.unity.meta │ ├── Spheres.vfx.meta │ ├── HDRP.meta │ ├── Script.meta │ ├── Test.asset.meta │ ├── HDRP │ │ ├── DefaultLookDevProfile.asset.meta │ │ ├── HDRenderPipelineAsset.asset.meta │ │ ├── Skin Diffusion Profile.asset.meta │ │ ├── DefaultSettingsVolumeProfile.asset.meta │ │ ├── Foliage Diffusion Profile.asset.meta │ │ ├── DefaultSettingsVolumeProfile.asset │ │ ├── Foliage Diffusion Profile.asset │ │ └── Skin Diffusion Profile.asset │ ├── Script │ │ ├── SetReceiverImage.cs.meta │ │ ├── SourceSelector.cs.meta │ │ ├── SetReceiverImage.cs │ │ └── SourceSelector.cs │ └── Test.asset └── Packages │ ├── manifest.json │ └── packages-lock.json ├── URP ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── XRSettings.asset │ ├── VersionControlSettings.asset │ ├── TimeManager.asset │ ├── VFXManager.asset │ ├── EditorBuildSettings.asset │ ├── URPProjectSettings.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── DynamicsManager.asset │ ├── EditorSettings.asset │ ├── PackageManagerSettings.asset │ ├── QualitySettings.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── GraphicsSettings.asset │ └── SceneTemplateSettings.json ├── Assets │ ├── Test.unity.meta │ ├── Benchmark.unity.meta │ ├── Buffer.meta │ ├── Script.meta │ ├── Shader.meta │ ├── URP.asset.meta │ ├── Shader │ │ ├── Alpha.mat.meta │ │ ├── Gradient.mat.meta │ │ ├── Receiver.mat.meta │ │ ├── Alpha.shadergraph.meta │ │ ├── Gradient.shadergraph.meta │ │ ├── Receiver.shadergraph.meta │ │ ├── Alpha.mat │ │ ├── Gradient.mat │ │ └── Receiver.mat │ ├── URP_Renderer.asset.meta │ ├── Buffer │ │ ├── Alpha.renderTexture.meta │ │ ├── Gradient.renderTexture.meta │ │ ├── Timecode.renderTexture.meta │ │ ├── Alpha.renderTexture │ │ ├── Gradient.renderTexture │ │ └── Timecode.renderTexture │ ├── Script │ │ ├── Timecode.cs.meta │ │ ├── ReceiverBenchmark.cs.meta │ │ ├── SenderBenchmark.cs.meta │ │ ├── SourceSelector.cs.meta │ │ ├── Timecode.cs │ │ ├── SourceSelector.cs │ │ ├── SenderBenchmark.cs │ │ └── ReceiverBenchmark.cs │ ├── URP_Renderer.asset │ └── URP.asset └── Packages │ ├── manifest.json │ └── packages-lock.json ├── Legacy ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── NetworkManager.asset │ ├── XRSettings.asset │ ├── TimeManager.asset │ ├── EditorBuildSettings.asset │ ├── VFXManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── EditorSettings.asset │ ├── DynamicsManager.asset │ ├── PackageManagerSettings.asset │ ├── QualitySettings.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ └── GraphicsSettings.asset ├── Assets │ ├── Test.unity.meta │ ├── FrameCount.cs │ ├── FrameCount.cs.meta │ ├── SetReceiverImage.cs.meta │ ├── SourceSelector.cs.meta │ ├── SetReceiverImage.cs │ └── SourceSelector.cs └── Packages │ ├── manifest.json │ └── packages-lock.json ├── jp.keijiro.klak.ndi ├── Plugin │ ├── Linux │ │ ├── libndi.so │ │ └── libndi.so.meta │ ├── Android │ │ ├── libndi.so │ │ └── libndi.so.meta │ ├── macOS │ │ ├── libndi.dylib │ │ └── libndi.dylib.meta │ ├── Windows │ │ ├── Processing.NDI.Lib.x64.dll │ │ └── Processing.NDI.Lib.x64.dll.meta │ ├── Android.meta │ ├── Linux.meta │ ├── Windows.meta │ └── macOS.meta ├── LICENSE.meta ├── README.md.meta ├── package.json.meta ├── libndi_licenses.txt.meta ├── Editor.meta ├── Plugin.meta ├── Runtime.meta ├── Editor │ ├── Klak.Ndi.Editor.asmdef.meta │ ├── Utility.cs.meta │ ├── PbxModifier.cs.meta │ ├── NdiReceiverEditor.cs.meta │ ├── NdiSenderEditor.cs.meta │ ├── MaterialPropertySelector.cs.meta │ ├── Klak.Ndi.Editor.asmdef │ ├── Utility.cs │ ├── NdiSenderEditor.cs │ ├── PbxModifier.cs │ ├── MaterialPropertySelector.cs │ └── NdiReceiverEditor.cs ├── Runtime │ ├── Component.meta │ ├── Internal.meta │ ├── Interop.meta │ ├── Resource.meta │ ├── Klak.Ndi.Runtime.asmdef.meta │ ├── Resource │ │ ├── Decoder.compute.meta │ │ ├── Encoder.compute.meta │ │ ├── NdiResources.asset.meta │ │ ├── NdiResources.asset │ │ ├── Decoder.compute │ │ └── Encoder.compute │ ├── Interop │ │ ├── Find.cs.meta │ │ ├── Recv.cs.meta │ │ ├── Send.cs.meta │ │ ├── Config.cs.meta │ │ ├── Structs.cs.meta │ │ ├── Config.cs │ │ ├── Find.cs │ │ ├── Structs.cs │ │ ├── Send.cs │ │ └── Recv.cs │ ├── Internal │ │ ├── Utility.cs.meta │ │ ├── AndroidHelper.cs.meta │ │ ├── ReadbackPool.cs.meta │ │ ├── RecvHelper.cs.meta │ │ ├── SharedInstance.cs.meta │ │ ├── FormatConverter.cs.meta │ │ ├── AndroidHelper.cs │ │ ├── RecvHelper.cs │ │ ├── Utility.cs │ │ ├── SharedInstance.cs │ │ └── ReadbackPool.cs │ ├── Component │ │ ├── NdiFinder.cs.meta │ │ ├── NdiReceiver_Properties.cs.meta │ │ ├── NdiSender_Properties.cs.meta │ │ ├── NdiSender.cs.meta │ │ ├── NdiReceiver.cs.meta │ │ ├── NdiFinder.cs │ │ ├── NdiResources.cs.meta │ │ ├── NdiResources.cs │ │ ├── NdiReceiver_Properties.cs │ │ ├── NdiReceiver.cs │ │ └── NdiSender_Properties.cs │ └── Klak.Ndi.Runtime.asmdef ├── package.json ├── LICENSE └── README.md ├── .gitattributes ├── .gitignore ├── README.md └── LICENSE /HDRP/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.18f1 2 | m_EditorVersionWithRevision: 2020.3.18f1 (a7d1c678663c) 3 | -------------------------------------------------------------------------------- /URP/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.18f1 2 | m_EditorVersionWithRevision: 2020.3.18f1 (a7d1c678663c) 3 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.30f1 2 | m_EditorVersionWithRevision: 2019.4.30f1 (e8c891080a1f) 3 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Linux/libndi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NDIUnityInteropTest/HEAD/jp.keijiro.klak.ndi/Plugin/Linux/libndi.so -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Android/libndi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NDIUnityInteropTest/HEAD/jp.keijiro.klak.ndi/Plugin/Android/libndi.so -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/macOS/libndi.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NDIUnityInteropTest/HEAD/jp.keijiro.klak.ndi/Plugin/macOS/libndi.dylib -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Windows/Processing.NDI.Lib.x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NDIUnityInteropTest/HEAD/jp.keijiro.klak.ndi/Plugin/Windows/Processing.NDI.Lib.x64.dll -------------------------------------------------------------------------------- /Legacy/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 | -------------------------------------------------------------------------------- /HDRP/Assets/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b918b3e8a4a44cc095b222a7f7077d4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Legacy/Assets/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0285b8a813a5a401e9ae860a72e77fd4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /URP/Assets/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a83b31f020d56ca4d93f5f70138ef6b3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /HDRP/Assets/Spheres.vfx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85ed518b507a29c46a8101f2d236aa02 3 | VisualEffectImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /URP/Assets/Benchmark.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58dcdb08bb9105547ba4115762d0ef21 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6765b8ffa8f24550a9fa04bbf2f8b7e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Legacy/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 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7778cb01ab7c4c3f88d8894f8d44521 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | 3 | *.cs text eol=lf diff=csharp 4 | *.shader text eol=lf 5 | *.cginc text eol=lf 6 | *.hlsl text eol=lf 7 | *.compute text eol=lf 8 | 9 | *.meta text eol=lf 10 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e96a0bc81e96c43acac9c2665d3a9da2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f30288638d1254bbebdf9ac665c93fc5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Buffer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71805b9365934684388c193b256c41a9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bacb3f46bf57c54385422a1cd07711b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfc6022db3d37ce41bc7da04c5895c55 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88f155dac266345e492f75680e6e491e 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/libndi_licenses.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f350df67a73c648f2ac9cb66bb68d531 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /HDRP/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 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Legacy/Assets/FrameCount.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UI = UnityEngine.UI; 3 | 4 | public sealed class FrameCount : MonoBehaviour 5 | { 6 | void Update() 7 | => GetComponent().text = $"{Time.frameCount}"; 8 | } 9 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80bf21eeca5c52f43b3f63b3d1b79a10 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 312ed0ed1c7703c42b67cb5561134cfd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a73e581cc856ab4db5b46eaf7767f73 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/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 | } -------------------------------------------------------------------------------- /Legacy/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 | } -------------------------------------------------------------------------------- /URP/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 | } -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76ec5520eac0ad79c8cf2a6ccaab09a3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc5e50cf01f707fb983502309bfa3628 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7729df4aa1e21e94282c6603f42c23a0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/macOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b281019313444be8914e7e21804d8ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/Test.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 519bd706accb66a4a944300679545fa6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/URP.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a817dc55f0eb8dc468415b739ceae0d2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/Klak.Ndi.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd8bc1162ef4ad24ab0f30ab491a04e8 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25bbceb4b4de30fe5b8a9c768ac493bb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb46a5e63f8b7c14e8ab2dd3cfbc53e2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf065af261cdb04c59a3c02b540b891f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2381ee1e3277d6079a2bea77b007388f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Alpha.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e159dec22cd1174d99e5c2f70f07e74 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Klak.Ndi.Runtime.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b59f669f136310547b59ad72df53b42f 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Gradient.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c01d1eeee63acea418bafad09e507872 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Receiver.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d717d2aa323e5c469963ea9c0a6cbe9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/URP_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6b277fe4e9566442a659b0278c18758 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Alpha.renderTexture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff94f91c62216aa4b8b027f13fe15303 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 8400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Gradient.renderTexture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73e8dcdfe3f22594693dc569656418c6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 8400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Timecode.renderTexture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ea82f700d9e65841ae79a62180986d5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 8400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/DefaultLookDevProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4519b37a0332c480a9ab191ab5820ba0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/HDRenderPipelineAsset.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df1f3ba39049146318b22c35176d0df7 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/Skin Diffusion Profile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d24c1eb06b2c8432f8307ba225ad72f9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/Decoder.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbb9f9dd93e2dca48a0993ee1e64a413 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 4 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/Encoder.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6b8573dcf6ea3a4fa44225fc68728c3 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 4 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/DefaultSettingsVolumeProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bca799cf3b7134e8ebced41bb004f221 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/Foliage Diffusion Profile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2bb11147a9004bbaa36208261623d94 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/NdiResources.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69304b86950074db7ba8caba75214004 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | Thumbs.db 3 | Desktop.ini 4 | 5 | # macOS 6 | .DS_Store 7 | 8 | # Code Editors 9 | /.idea 10 | /.vscode 11 | /*.csproj 12 | /*.sln 13 | *.swp 14 | *.vcxproj.user 15 | 16 | # Unity 17 | /*/Library 18 | /*/Logs 19 | /*/Recordings 20 | /*/UserSettings 21 | /*/Temp 22 | /*/*.blob 23 | -------------------------------------------------------------------------------- /Legacy/Assets/FrameCount.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cf786f7b3ba0464b8b85de26140d5f0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /URP/Assets/Script/Timecode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02ae1586c13b694b9fa87df91f5434d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Legacy/Assets/SetReceiverImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29d94d5fa9d5a4dd1b78ef31ba742615 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Legacy/Assets/SourceSelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd2871bdf24ef48b4a5201aad7347fda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /HDRP/Assets/Script/SetReceiverImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d08fa178503724bf48892e16b3aa17cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /HDRP/Assets/Script/SourceSelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dd36fe3654684950b95e73c3cfa370a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /URP/Assets/Script/ReceiverBenchmark.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4708590fedf20d04eb3da3b108de12ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /URP/Assets/Script/SenderBenchmark.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4da07adb0d7d9c4f83c62c2bca0bbd5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /URP/Assets/Script/SourceSelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae07b03851b241b438588e43455fa256 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/Utility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 647203dfc2553594392dddf8fe9c34fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Legacy/Assets/SetReceiverImage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UI = UnityEngine.UI; 3 | using Klak.Ndi; 4 | 5 | public sealed class SetReceiverImage : MonoBehaviour 6 | { 7 | [SerializeField] NdiReceiver _receiver = null; 8 | 9 | void Update() 10 | => GetComponent().texture = _receiver.texture; 11 | } 12 | -------------------------------------------------------------------------------- /Legacy/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/Test.unity 10 | guid: 0285b8a813a5a401e9ae860a72e77fd4 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/PbxModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10f2b5dd03d6d44859bae0e0f099f75e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Find.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1197d923eb29ad946bf19165e4bca214 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Recv.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a282a4abb4de76b488c6aa2a43c6453e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Send.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 758bf598fc3f7db4fb635bdfec4c76b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /HDRP/Assets/Script/SetReceiverImage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UI = UnityEngine.UI; 3 | using Klak.Ndi; 4 | 5 | public sealed class SetReceiverImage : MonoBehaviour 6 | { 7 | [SerializeField] NdiReceiver _receiver = null; 8 | 9 | void Update() 10 | => GetComponent().texture = _receiver.texture; 11 | } 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/NdiReceiverEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9284a7f6ca322e44e840062b3cc53892 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/NdiSenderEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f6e4542078b4084e8a69dc599746f9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/Utility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2467fb58829ca774a91d97ce1109ed45 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Config.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fe10954c97519849b0da8381127e810 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Structs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3915584363478f94c8bfa932a3fe78e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/MaterialPropertySelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11cac9dc9db9766479b14948926e07c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiFinder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e831476f03e294e898731ef14aee644 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/AndroidHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecbd6eee89e17923b97109b41528f600 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/ReadbackPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de80fed392c994a3484ee67bba2db9f8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/RecvHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4d13a3e9934fe2569e341b6f9ac20a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/SharedInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30542ea5d57cf4f4899cd4b86fe030e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiReceiver_Properties.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a4f519710082f0aca585221a35d6594 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiSender_Properties.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db5f5a1f06be2b05f94537ead72115d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Alpha.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9386c075d234d814581e1bd28d42496f 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Gradient.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8c703759a113434f8b6a1568791b99b 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Receiver.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e59dd6be419cbb4b87375f34221f6ac 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /Legacy/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository was used to test the idea of using C# interoperability to implement a Unity NDI plugin without C++ code. 2 | The finalized code has been successfully merged to the NDI plugin ([KlakNDI]). 3 | 4 | This repository is left for archival purposes and further interop tests. 5 | If you're looking for a NDI solution, please check the [KlakNDI] repository. 6 | 7 | [KlakNDI]: https://github.com/keijiro/KlakNDI 8 | -------------------------------------------------------------------------------- /URP/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/Test.unity 10 | guid: a83b31f020d56ca4d93f5f70138ef6b3 11 | - enabled: 1 12 | path: Assets/Benchmark.unity 13 | guid: 58dcdb08bb9105547ba4115762d0ef21 14 | m_configObjects: {} 15 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Keijiro Takahashi", 3 | "dependencies": { "com.unity.modules.screencapture": "1.0.0" }, 4 | "description": "NewTek NDI® plugin for Unity", 5 | "displayName": "KlakNDI", 6 | "keywords": [ "unity" ], 7 | "license": "SEE LICENSE IN LICENSE", 8 | "name": "jp.keijiro.klak.ndi", 9 | "unity": "2019.4", 10 | "unityRelease": "0f1", 11 | "version": "1.1.0" 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This package contains the following two components: 2 | 3 | - The NDI® dynamic library 4 | - The KlakNDI Unity plugin code 5 | 6 | The NDI® dynamic library (files contained in the `Plugin` directory) are 7 | provided under NewTek's NDI® SDK license. Please review `libndi_licenses.txt` 8 | before using them in your project. 9 | 10 | The KlakNDI Unity plugin code (files contained in the `Editor` and `Runtime` 11 | directory) was put into the public domain. 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/LICENSE: -------------------------------------------------------------------------------- 1 | This package contains the following two components: 2 | 3 | - The NDI® dynamic library 4 | - The KlakNDI Unity plugin code 5 | 6 | The NDI® dynamic library (files contained in the `Plugin` directory) are 7 | provided under NewTek's NDI® SDK license. Please review `libndi_licenses.txt` 8 | before using them in your project. 9 | 10 | The KlakNDI Unity plugin code (files contained in the `Editor` and `Runtime` 11 | directory) was put into the public domain. 12 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiSender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2d98e5bfcdff4847ad69efa861a8e7f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - _sourceCamera: {instanceID: 0} 8 | - _sourceTexture: {instanceID: 0} 9 | - _resources: {fileID: 11400000, guid: 69304b86950074db7ba8caba75214004, type: 2} 10 | executionOrder: 0 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/Klak.Ndi.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Klak.Ndi.Editor", 3 | "references": [ 4 | "GUID:b59f669f136310547b59ad72df53b42f" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a09ab5fc64402d49b12d170a7577986 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - _targetTexture: {instanceID: 0} 8 | - _targetRenderer: {instanceID: 0} 9 | - _resources: {fileID: 11400000, guid: 69304b86950074db7ba8caba75214004, type: 2} 10 | executionOrder: -100 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /URP/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: 4 16 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/FormatConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8a3f5df3b94ac243a0b980d53d1c800 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - _encoderCompute: {fileID: 7200000, guid: f6b8573dcf6ea3a4fa44225fc68728c3, type: 3} 8 | - _decoderCompute: {fileID: 7200000, guid: fbb9f9dd93e2dca48a0993ee1e64a413, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /HDRP/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: 1024 20 | -------------------------------------------------------------------------------- /URP/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: 1024 20 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/DefaultSettingsVolumeProfile.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: d7fd9488000d3734a9e00ee676215985, type: 3} 13 | m_Name: DefaultSettingsVolumeProfile 14 | m_EditorClassIdentifier: 15 | components: [] 16 | -------------------------------------------------------------------------------- /Legacy/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: 1024 20 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiFinder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Klak.Ndi { 4 | 5 | public static class NdiFinder 6 | { 7 | public static IEnumerable sourceNames => EnumerateSourceNames(); 8 | 9 | public static IEnumerable EnumerateSourceNames() 10 | { 11 | var list = new List(); 12 | foreach (var source in SharedInstance.Find.CurrentSources) 13 | list.Add(source.NdiName); 14 | return list; 15 | } 16 | } 17 | 18 | } // namespace Klak.Ndi 19 | -------------------------------------------------------------------------------- /URP/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopedRegistries": [ 3 | { 4 | "name": "Unity NuGet", 5 | "url": "https://unitynuget-registry.azurewebsites.net", 6 | "scopes": [ "org.nuget" ] 7 | } 8 | ], 9 | "dependencies": { 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.render-pipelines.universal": "10.6.0", 12 | "com.unity.modules.androidjni": "1.0.0", 13 | "com.unity.modules.physics": "1.0.0", 14 | "org.nuget.system.memory": "4.5.3", 15 | "jp.keijiro.klak.ndi": "file:../../jp.keijiro.klak.ndi" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Config.cs: -------------------------------------------------------------------------------- 1 | namespace Klak.Ndi.Interop { 2 | 3 | static class Config 4 | { 5 | #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN 6 | public const string DllName = "Processing.NDI.Lib.x64"; 7 | #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX 8 | public const string DllName = "libndi"; 9 | #elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID 10 | public const string DllName = "ndi"; 11 | #else 12 | public const string DllName = "__Internal"; 13 | #endif 14 | } 15 | 16 | } // namespace Klak.Ndi.Interop 17 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiResources.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f467649524ddd6789308542d9acc5cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - encoderCompute: {fileID: 7200000, guid: f6b8573dcf6ea3a4fa44225fc68728c3, type: 3} 8 | - decoderCompute: {fileID: 7200000, guid: fbb9f9dd93e2dca48a0993ee1e64a413, type: 3} 9 | - blitShader: {fileID: 4800000, guid: 4c425f54b8576fc42956d9055b23bfb2, type: 3} 10 | executionOrder: 0 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /HDRP/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 | - Test Card 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 | -------------------------------------------------------------------------------- /Legacy/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopedRegistries": [ 3 | { 4 | "name": "Unity NuGet", 5 | "url": "https://unitynuget-registry.azurewebsites.net", 6 | "scopes": [ "org.nuget" ] 7 | }, 8 | { 9 | "name": "Keijiro", 10 | "url": "https://registry.npmjs.com", 11 | "scopes": [ "jp.keijiro" ] 12 | } 13 | ], 14 | "dependencies": { 15 | "com.unity.modules.androidjni": "1.0.0", 16 | "com.unity.ugui": "1.0.0", 17 | "org.nuget.system.memory": "4.5.3", 18 | "jp.keijiro.testcards": "1.0.0", 19 | "jp.keijiro.klak.ndi": "file:../../jp.keijiro.klak.ndi" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Legacy/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 | -------------------------------------------------------------------------------- /HDRP/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: 7200000, guid: 84a17cfa13e40ae4082ef42714f0a81c, type: 3} 7 | m_CopyBufferShader: {fileID: 7200000, guid: 23c51f21a3503f6428b527b01f8a2f4e, type: 3} 8 | m_SortShader: {fileID: 7200000, guid: ea257ca3cfb12a642a5025e612af6b2a, type: 3} 9 | m_StripUpdateShader: {fileID: 7200000, guid: 8fa6c4009fe2a4d4486c62736fc30ad8, type: 3} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 2 14 | m_RuntimeVersion: 12 15 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/NdiResources.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: 2f467649524ddd6789308542d9acc5cc, type: 3} 13 | m_Name: NdiResources 14 | m_EditorClassIdentifier: 15 | encoderCompute: {fileID: 7200000, guid: f6b8573dcf6ea3a4fa44225fc68728c3, type: 3} 16 | decoderCompute: {fileID: 7200000, guid: fbb9f9dd93e2dca48a0993ee1e64a413, type: 3} 17 | -------------------------------------------------------------------------------- /URP/Assets/Script/Timecode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UI = UnityEngine.UI; 3 | 4 | sealed class Timecode : MonoBehaviour 5 | { 6 | [SerializeField] UI.Text _label = null; 7 | [SerializeField] Camera _camera = null; 8 | 9 | Color _bgColor; 10 | 11 | void Start() 12 | => _bgColor = _camera.backgroundColor; 13 | 14 | void Update() 15 | { 16 | var t = Time.time; 17 | 18 | var frame = (int)(t * 60 % 60); 19 | _label.text = $"{(int)(t / 60):00}:{(int)(t % 60):00}:{frame:00}"; 20 | 21 | var flash = (int)t != (int)(t - Time.deltaTime); 22 | _camera.backgroundColor = flash ? Color.white : _bgColor; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Klak.Ndi.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Klak.Ndi.Runtime", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:df380645f10b7bc4b97d4f5eb6303d95" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": true, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [ 15 | { 16 | "name": "com.unity.render-pipelines.core", 17 | "expression": "0.0.0", 18 | "define": "KLAK_NDI_HAS_SRP" 19 | } 20 | ], 21 | "noEngineReferences": false 22 | } -------------------------------------------------------------------------------- /HDRP/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopedRegistries": [ 3 | { 4 | "name": "Unity NuGet", 5 | "url": "https://unitynuget-registry.azurewebsites.net", 6 | "scopes": [ "org.nuget" ] 7 | } 8 | ], 9 | "dependencies": { 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.render-pipelines.high-definition": "10.6.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.imageconversion": "1.0.0", 14 | "com.unity.modules.jsonserialize": "1.0.0", 15 | "com.unity.modules.physics": "1.0.0", 16 | "com.unity.modules.video": "1.0.0", 17 | "org.nuget.system.memory": "4.5.3", 18 | "jp.keijiro.klak.ndi": "file:../../jp.keijiro.klak.ndi" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiResources.cs: -------------------------------------------------------------------------------- 1 | // We hide the create menu item because we don't expect a user to create an 2 | // instance manually -- They should use the NdiResources.asset file provided 3 | // within this package. To enable the menu item, uncomment the line bellow. 4 | // #define SHOW_MENU_ITEM 5 | 6 | using UnityEngine; 7 | 8 | namespace Klak.Ndi { 9 | 10 | #if SHOW_MENU_ITEM 11 | [CreateAssetMenu(fileName = "NdiResources", 12 | menuName = "ScriptableObjects/KlakNDI/NDI Resources")] 13 | #endif 14 | public sealed class NdiResources : ScriptableObject 15 | { 16 | public ComputeShader encoderCompute; 17 | public ComputeShader decoderCompute; 18 | } 19 | 20 | } // namespace Klak.Ndi 21 | -------------------------------------------------------------------------------- /HDRP/ProjectSettings/HDRPProjectSettings.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: 63a2978a97e4fc04cb9d905947216f3d, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 1 16 | m_ProjectSettingFolderPath: HDRP 17 | m_WizardPopupAtStart: 0 18 | m_WizardPopupAlreadyShownOnce: 0 19 | m_WizardActiveTab: 0 20 | m_WizardNeedRestartAfterChangingToDX12: 0 21 | m_WizardNeedToRunFixAllAgainAfterDomainReload: 0 22 | m_LastMaterialVersion: 11 23 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/Foliage Diffusion Profile.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: b2686e09ec7aef44bad2843e4416f057, type: 3} 13 | m_Name: Foliage Diffusion Profile 14 | m_EditorClassIdentifier: 15 | profile: 16 | name: Foliage 17 | scatteringDistance: {r: 0.7568628, g: 0.7019608, b: 0.24313727, a: 1} 18 | transmissionTint: {r: 1, g: 1, b: 1, a: 1} 19 | texturingMode: 0 20 | transmissionMode: 1 21 | thicknessRemap: {x: 0, y: 0.2873168} 22 | worldScale: 1 23 | ior: 1.4 24 | hash: 1081692787 25 | m_Version: 1 26 | profiles: [] 27 | -------------------------------------------------------------------------------- /HDRP/Assets/HDRP/Skin Diffusion Profile.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: b2686e09ec7aef44bad2843e4416f057, type: 3} 13 | m_Name: Skin Diffusion Profile 14 | m_EditorClassIdentifier: 15 | profile: 16 | name: Skin 17 | scatteringDistance: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1} 18 | transmissionTint: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1} 19 | texturingMode: 0 20 | transmissionMode: 0 21 | thicknessRemap: {x: 0, y: 8.152544} 22 | worldScale: 1 23 | ior: 1.4 24 | hash: 1075477546 25 | m_Version: 1 26 | profiles: [] 27 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Alpha.renderTexture: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!84 &8400000 4 | RenderTexture: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Alpha 10 | m_ImageContentsHash: 11 | serializedVersion: 2 12 | Hash: 00000000000000000000000000000000 13 | m_ForcedFallbackFormat: 4 14 | m_DownscaleFallback: 0 15 | m_IsAlphaChannelOptional: 0 16 | serializedVersion: 3 17 | m_Width: 1280 18 | m_Height: 720 19 | m_AntiAliasing: 1 20 | m_MipCount: -1 21 | m_DepthFormat: 2 22 | m_ColorFormat: 8 23 | m_MipMap: 0 24 | m_GenerateMips: 1 25 | m_SRGB: 0 26 | m_UseDynamicScale: 0 27 | m_BindMS: 0 28 | m_EnableCompatibleFormat: 1 29 | m_TextureSettings: 30 | serializedVersion: 2 31 | m_FilterMode: 1 32 | m_Aniso: 0 33 | m_MipBias: 0 34 | m_WrapU: 1 35 | m_WrapV: 1 36 | m_WrapW: 1 37 | m_Dimension: 2 38 | m_VolumeDepth: 1 39 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Gradient.renderTexture: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!84 &8400000 4 | RenderTexture: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Gradient 10 | m_ImageContentsHash: 11 | serializedVersion: 2 12 | Hash: 00000000000000000000000000000000 13 | m_ForcedFallbackFormat: 4 14 | m_DownscaleFallback: 0 15 | m_IsAlphaChannelOptional: 0 16 | serializedVersion: 3 17 | m_Width: 1280 18 | m_Height: 720 19 | m_AntiAliasing: 1 20 | m_MipCount: -1 21 | m_DepthFormat: 2 22 | m_ColorFormat: 8 23 | m_MipMap: 0 24 | m_GenerateMips: 1 25 | m_SRGB: 0 26 | m_UseDynamicScale: 0 27 | m_BindMS: 0 28 | m_EnableCompatibleFormat: 1 29 | m_TextureSettings: 30 | serializedVersion: 2 31 | m_FilterMode: 1 32 | m_Aniso: 0 33 | m_MipBias: 0 34 | m_WrapU: 1 35 | m_WrapV: 1 36 | m_WrapW: 1 37 | m_Dimension: 2 38 | m_VolumeDepth: 1 39 | -------------------------------------------------------------------------------- /URP/Assets/Buffer/Timecode.renderTexture: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!84 &8400000 4 | RenderTexture: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Timecode 10 | m_ImageContentsHash: 11 | serializedVersion: 2 12 | Hash: 00000000000000000000000000000000 13 | m_ForcedFallbackFormat: 4 14 | m_DownscaleFallback: 0 15 | m_IsAlphaChannelOptional: 0 16 | serializedVersion: 3 17 | m_Width: 1280 18 | m_Height: 720 19 | m_AntiAliasing: 1 20 | m_MipCount: -1 21 | m_DepthFormat: 2 22 | m_ColorFormat: 8 23 | m_MipMap: 0 24 | m_GenerateMips: 1 25 | m_SRGB: 0 26 | m_UseDynamicScale: 0 27 | m_BindMS: 0 28 | m_EnableCompatibleFormat: 1 29 | m_TextureSettings: 30 | serializedVersion: 2 31 | m_FilterMode: 1 32 | m_Aniso: 0 33 | m_MipBias: 0 34 | m_WrapU: 1 35 | m_WrapV: 1 36 | m_WrapW: 1 37 | m_Dimension: 2 38 | m_VolumeDepth: 1 39 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/AndroidHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Networking; 3 | 4 | namespace Klak.Ndi { 5 | 6 | // Platform specific helper functions for Android 7 | 8 | static class AndroidHelper 9 | { 10 | #if UNITY_ANDROID && !UNITY_EDITOR 11 | 12 | static AndroidJavaObject _nsdManager; 13 | 14 | public static void SetupNetwork() 15 | { 16 | // Enable multicasting: This also adds the network permissions to the 17 | // application manifest. 18 | NetworkTransport.SetMulticastLock(true); 19 | 20 | // Create a network service discovery manager object. 21 | var player = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 22 | var activity = player.GetStatic("currentActivity"); 23 | _nsdManager = activity.Call 24 | ("getSystemService", "servicediscovery"); 25 | } 26 | 27 | #else 28 | 29 | public static void SetupNetwork() {} 30 | 31 | #endif 32 | } 33 | 34 | } // namespace Klak.Ndi 35 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Alpha.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Alpha 11 | m_Shader: {fileID: -6465566751694194690, guid: 9386c075d234d814581e1bd28d42496f, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - unity_Lightmaps: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - unity_LightmapsInd: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - unity_ShadowMasks: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | m_Floats: [] 35 | m_Colors: [] 36 | m_BuildTextureStacks: [] 37 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/RecvHelper.cs: -------------------------------------------------------------------------------- 1 | using IntPtr = System.IntPtr; 2 | 3 | namespace Klak.Ndi { 4 | 5 | // Small helper class for NDI recv interop 6 | static class RecvHelper 7 | { 8 | public static Interop.Source? FindSource(string sourceName) 9 | { 10 | foreach (var source in SharedInstance.Find.CurrentSources) 11 | if (source.NdiName == sourceName) return source; 12 | return null; 13 | } 14 | 15 | public static unsafe Interop.Recv TryCreateRecv(string sourceName) 16 | { 17 | var source = FindSource(sourceName); 18 | if (source == null) return null; 19 | 20 | var opt = new Interop.Recv.Settings 21 | { Source = (Interop.Source)source, 22 | ColorFormat = Interop.ColorFormat.Fastest, 23 | Bandwidth = Interop.Bandwidth.Highest }; 24 | 25 | return Interop.Recv.Create(opt); 26 | } 27 | 28 | public static Interop.VideoFrame? TryCaptureVideoFrame(Interop.Recv recv) 29 | { 30 | Interop.VideoFrame video; 31 | var type = recv.Capture(out video, IntPtr.Zero, IntPtr.Zero, 0); 32 | if (type != Interop.FrameType.Video) return null; 33 | return (Interop.VideoFrame?)video; 34 | } 35 | } 36 | 37 | } // namespace Klak.Ndi 38 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 1 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /HDRP/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: 11 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 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /URP/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: 11 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 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/Utility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Reflection; 4 | 5 | namespace Klak.Ndi.Editor { 6 | 7 | // Simple string label with GUIContent 8 | struct Label 9 | { 10 | GUIContent _guiContent; 11 | 12 | public static implicit operator GUIContent(Label label) 13 | => label._guiContent; 14 | 15 | public static implicit operator Label(string text) 16 | => new Label { _guiContent = new GUIContent(text) }; 17 | } 18 | 19 | // Auto-scanning serialized property wrapper 20 | struct AutoProperty 21 | { 22 | SerializedProperty _prop; 23 | 24 | public SerializedProperty Target => _prop; 25 | 26 | public AutoProperty(SerializedProperty prop) 27 | => _prop = prop; 28 | 29 | public static implicit operator 30 | SerializedProperty(AutoProperty prop) => prop._prop; 31 | 32 | public static void Scan(T target) where T : UnityEditor.Editor 33 | { 34 | var so = target.serializedObject; 35 | 36 | var flags = BindingFlags.Public | BindingFlags.NonPublic; 37 | flags |= BindingFlags.Instance; 38 | 39 | foreach (var f in typeof(T).GetFields(flags)) 40 | if (f.FieldType == typeof(AutoProperty)) 41 | f.SetValue(target, new AutoProperty(so.FindProperty(f.Name))); 42 | } 43 | } 44 | 45 | } // namespace Klak.Ndi.Editor 46 | -------------------------------------------------------------------------------- /Legacy/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: 11 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 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /HDRP/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: 1 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 19 | m_ProjectGenerationRootNamespace: 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 1 24 | m_PrefabModeAllowAutoSave: 1 25 | m_EnterPlayModeOptionsEnabled: 1 26 | m_EnterPlayModeOptions: 3 27 | m_GameObjectNamingDigits: 1 28 | m_GameObjectNamingScheme: 0 29 | m_AssetNamingUsesSpace: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | m_DisableCookiesInLightmapper: 0 33 | m_AssetPipelineMode: 1 34 | m_CacheServerMode: 0 35 | m_CacheServerEndpoint: 36 | m_CacheServerNamespacePrefix: default 37 | m_CacheServerEnableDownload: 1 38 | m_CacheServerEnableUpload: 1 39 | m_CacheServerEnableAuth: 0 40 | m_CacheServerEnableTls: 0 41 | -------------------------------------------------------------------------------- /URP/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: 1 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 19 | m_ProjectGenerationRootNamespace: 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 1 24 | m_PrefabModeAllowAutoSave: 1 25 | m_EnterPlayModeOptionsEnabled: 1 26 | m_EnterPlayModeOptions: 3 27 | m_GameObjectNamingDigits: 1 28 | m_GameObjectNamingScheme: 0 29 | m_AssetNamingUsesSpace: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | m_DisableCookiesInLightmapper: 0 33 | m_AssetPipelineMode: 1 34 | m_CacheServerMode: 0 35 | m_CacheServerEndpoint: 36 | m_CacheServerNamespacePrefix: default 37 | m_CacheServerEnableDownload: 1 38 | m_CacheServerEnableUpload: 1 39 | m_CacheServerEnableAuth: 0 40 | m_CacheServerEnableTls: 0 41 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/macOS/libndi.dylib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 408a629b2533e4d3aaf1ff3e35346919 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 0 22 | Exclude Win: 1 23 | Exclude Win64: 1 24 | - first: 25 | Any: 26 | second: 27 | enabled: 0 28 | settings: {} 29 | - first: 30 | Editor: Editor 31 | second: 32 | enabled: 1 33 | settings: 34 | CPU: AnyCPU 35 | DefaultValueInitialized: true 36 | OS: OSX 37 | - first: 38 | Standalone: Linux64 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: None 43 | - first: 44 | Standalone: OSXUniversal 45 | second: 46 | enabled: 1 47 | settings: 48 | CPU: AnyCPU 49 | - first: 50 | Standalone: Win 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: x86 55 | - first: 56 | Standalone: Win64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: x86_64 61 | userData: 62 | assetBundleName: 63 | assetBundleVariant: 64 | -------------------------------------------------------------------------------- /Legacy/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_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | - m_Id: scoped:Unity NuGet 24 | m_Name: Unity NuGet 25 | m_Url: https://unitynuget-registry.azurewebsites.net 26 | m_Scopes: 27 | - org.nuget 28 | m_IsDefault: 0 29 | - m_Id: scoped:Keijiro 30 | m_Name: Keijiro 31 | m_Url: https://registry.npmjs.com 32 | m_Scopes: 33 | - jp.keijiro 34 | m_IsDefault: 0 35 | m_UserSelectedRegistryName: 36 | m_UserAddingNewScopedRegistry: 0 37 | m_RegistryInfoDraft: 38 | m_ErrorMessage: 39 | m_Original: 40 | m_Id: scoped:Unity NuGet 41 | m_Name: Unity NuGet 42 | m_Url: https://unitynuget-registry.azurewebsites.net 43 | m_Scopes: 44 | - org.nuget 45 | m_IsDefault: 0 46 | m_Modified: 0 47 | m_Name: Unity NuGet 48 | m_Url: https://unitynuget-registry.azurewebsites.net 49 | m_Scopes: 50 | - org.nuget 51 | m_SelectedScopeIndex: 0 52 | -------------------------------------------------------------------------------- /HDRP/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: 1 16 | m_EnablePackageDependencies: 1 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 1 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_Id: scoped:Unity NuGet 28 | m_Name: Unity NuGet 29 | m_Url: https://unitynuget-registry.azurewebsites.net 30 | m_Scopes: 31 | - org.nuget 32 | m_IsDefault: 0 33 | m_Capabilities: 0 34 | m_UserSelectedRegistryName: 35 | m_UserAddingNewScopedRegistry: 0 36 | m_RegistryInfoDraft: 37 | m_ErrorMessage: 38 | m_Original: 39 | m_Id: scoped:Unity NuGet 40 | m_Name: Unity NuGet 41 | m_Url: https://unitynuget-registry.azurewebsites.net 42 | m_Scopes: 43 | - org.nuget 44 | m_IsDefault: 0 45 | m_Capabilities: 0 46 | m_Modified: 0 47 | m_Name: Unity NuGet 48 | m_Url: https://unitynuget-registry.azurewebsites.net 49 | m_Scopes: 50 | - org.nuget 51 | m_SelectedScopeIndex: 0 52 | -------------------------------------------------------------------------------- /URP/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: 1 16 | m_EnablePackageDependencies: 1 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 1 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_Id: scoped:Unity NuGet 28 | m_Name: Unity NuGet 29 | m_Url: https://unitynuget-registry.azurewebsites.net 30 | m_Scopes: 31 | - org.nuget 32 | m_IsDefault: 0 33 | m_Capabilities: 0 34 | m_UserSelectedRegistryName: 35 | m_UserAddingNewScopedRegistry: 0 36 | m_RegistryInfoDraft: 37 | m_ErrorMessage: 38 | m_Original: 39 | m_Id: scoped:Unity NuGet 40 | m_Name: Unity NuGet 41 | m_Url: https://unitynuget-registry.azurewebsites.net 42 | m_Scopes: 43 | - org.nuget 44 | m_IsDefault: 0 45 | m_Capabilities: 0 46 | m_Modified: 0 47 | m_Name: Unity NuGet 48 | m_Url: https://unitynuget-registry.azurewebsites.net 49 | m_Scopes: 50 | - org.nuget 51 | m_SelectedScopeIndex: 0 52 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Android/libndi.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6d6a169e7cb2e1d29c75700a23ef8fb 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | - first: 26 | Android: Android 27 | second: 28 | enabled: 1 29 | settings: 30 | CPU: ARM64 31 | - first: 32 | Any: 33 | second: 34 | enabled: 0 35 | settings: {} 36 | - first: 37 | Editor: Editor 38 | second: 39 | enabled: 0 40 | settings: 41 | CPU: AnyCPU 42 | DefaultValueInitialized: true 43 | OS: AnyOS 44 | - first: 45 | Standalone: Linux64 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: OSXUniversal 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | - first: 63 | Standalone: Win64 64 | second: 65 | enabled: 0 66 | settings: 67 | CPU: None 68 | userData: 69 | assetBundleName: 70 | assetBundleVariant: 71 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Linux/libndi.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb11b91506c6f2d6790c49c6bd4b513f 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 0 24 | Exclude Win64: 0 25 | - first: 26 | Android: Android 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: ARMv7 31 | - first: 32 | Any: 33 | second: 34 | enabled: 0 35 | settings: {} 36 | - first: 37 | Editor: Editor 38 | second: 39 | enabled: 1 40 | settings: 41 | CPU: x86_64 42 | DefaultValueInitialized: true 43 | OS: Linux 44 | - first: 45 | Standalone: Linux64 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86_64 50 | - first: 51 | Standalone: OSXUniversal 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: x86 62 | - first: 63 | Standalone: Win64 64 | second: 65 | enabled: 1 66 | settings: 67 | CPU: x86_64 68 | userData: 69 | assetBundleName: 70 | assetBundleVariant: 71 | -------------------------------------------------------------------------------- /HDRP/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: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Medium 11 | pixelLightCount: 1 12 | shadows: 2 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: 1 21 | skinWeights: 2 22 | textureQuality: 0 23 | anisotropicTextures: 1 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 1 30 | lodBias: 1 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 64 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 0} 44 | excludedTargetPlatforms: [] 45 | m_PerPlatformDefaultQuality: 46 | Android: 0 47 | Lumin: 0 48 | Nintendo 3DS: 0 49 | Nintendo Switch: 0 50 | PS4: 0 51 | PSP2: 0 52 | Stadia: 0 53 | Standalone: 0 54 | WebGL: 0 55 | Windows Store Apps: 0 56 | XboxOne: 0 57 | iPhone: 0 58 | tvOS: 0 59 | -------------------------------------------------------------------------------- /URP/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: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Medium 11 | pixelLightCount: 1 12 | shadows: 1 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: 1 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 1 30 | lodBias: 0.7 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 64 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 0} 44 | excludedTargetPlatforms: [] 45 | m_PerPlatformDefaultQuality: 46 | Android: 0 47 | Lumin: 0 48 | Nintendo 3DS: 0 49 | Nintendo Switch: 0 50 | PS4: 0 51 | PSP2: 0 52 | Stadia: 0 53 | Standalone: 0 54 | WebGL: 0 55 | Windows Store Apps: 0 56 | XboxOne: 0 57 | iPhone: 0 58 | tvOS: 0 59 | -------------------------------------------------------------------------------- /HDRP/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 | -------------------------------------------------------------------------------- /URP/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 | -------------------------------------------------------------------------------- /Legacy/Assets/SourceSelector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Klak.Ndi; 6 | 7 | public class SourceSelector : MonoBehaviour 8 | { 9 | [SerializeField] Dropdown _dropdown = null; 10 | 11 | NdiReceiver _receiver; 12 | List _sourceNames; 13 | bool _disableCallback; 14 | 15 | // HACK: Assuming that the dropdown has more than 16 | // three child objects only while it's opened. 17 | bool IsOpened => _dropdown.transform.childCount > 3; 18 | 19 | void Start() => _receiver = GetComponent(); 20 | 21 | void Update() 22 | { 23 | // Do nothing if the menu is opened. 24 | if (IsOpened) return; 25 | 26 | // NDI source name retrieval 27 | _sourceNames = NdiFinder.sourceNames.ToList(); 28 | 29 | // Currect selection 30 | var index = _sourceNames.IndexOf(_receiver.ndiName); 31 | 32 | // Append the current name to the list if it's not found. 33 | if (index < 0) 34 | { 35 | index = _sourceNames.Count; 36 | _sourceNames.Add(_receiver.ndiName); 37 | } 38 | 39 | // Disable the callback while updating the menu options. 40 | _disableCallback = true; 41 | 42 | // Menu option update 43 | _dropdown.ClearOptions(); 44 | _dropdown.AddOptions(_sourceNames); 45 | _dropdown.value = index; 46 | _dropdown.RefreshShownValue(); 47 | 48 | // Resume the callback. 49 | _disableCallback = false; 50 | } 51 | 52 | public void OnChangeValue(int value) 53 | { 54 | if (_disableCallback) return; 55 | _receiver.ndiName = _sourceNames[value]; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Legacy/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: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Medium 11 | pixelLightCount: 1 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: 1 30 | lodBias: 0.7 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 64 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 0} 44 | excludedTargetPlatforms: [] 45 | m_PerPlatformDefaultQuality: 46 | Android: 0 47 | Nintendo 3DS: 0 48 | Nintendo Switch: 0 49 | PS4: 0 50 | PSM: 0 51 | PSP2: 0 52 | Stadia: 0 53 | Standalone: 0 54 | Tizen: 0 55 | WebGL: 0 56 | WiiU: 0 57 | Windows Store Apps: 0 58 | XboxOne: 0 59 | iPhone: 0 60 | tvOS: 0 61 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Plugin/Windows/Processing.NDI.Lib.x64.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84549a96544c7cf4f9bc5b15bfb8ec7f 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 0 21 | Exclude OSXUniversal: 0 22 | Exclude Win: 1 23 | Exclude Win64: 0 24 | Exclude iOS: 1 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: x86_64 36 | DefaultValueInitialized: true 37 | OS: Windows 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86_64 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: x86_64 62 | - first: 63 | iPhone: iOS 64 | second: 65 | enabled: 0 66 | settings: 67 | AddToEmbeddedBinaries: false 68 | CPU: AnyCPU 69 | CompileFlags: 70 | FrameworkDependencies: 71 | userData: 72 | assetBundleName: 73 | assetBundleVariant: 74 | -------------------------------------------------------------------------------- /HDRP/Assets/Script/SourceSelector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Klak.Ndi; 6 | 7 | public class SourceSelector : MonoBehaviour 8 | { 9 | [SerializeField] Dropdown _dropdown = null; 10 | 11 | NdiReceiver _receiver; 12 | List _sourceNames; 13 | bool _disableCallback; 14 | 15 | // HACK: Assuming that the dropdown has more than 16 | // three child objects only while it's opened. 17 | bool IsOpened => _dropdown.transform.childCount > 3; 18 | 19 | void Start() => _receiver = GetComponent(); 20 | 21 | void Update() 22 | { 23 | // Do nothing if the menu is opened. 24 | if (IsOpened) return; 25 | 26 | // NDI source name retrieval 27 | _sourceNames = NdiFinder.sourceNames.ToList(); 28 | 29 | // Currect selection 30 | var index = _sourceNames.IndexOf(_receiver.ndiName); 31 | 32 | // Append the current name to the list if it's not found. 33 | if (index < 0) 34 | { 35 | index = _sourceNames.Count; 36 | _sourceNames.Add(_receiver.ndiName); 37 | } 38 | 39 | // Disable the callback while updating the menu options. 40 | _disableCallback = true; 41 | 42 | // Menu option update 43 | _dropdown.ClearOptions(); 44 | _dropdown.AddOptions(_sourceNames); 45 | _dropdown.value = index; 46 | _dropdown.RefreshShownValue(); 47 | 48 | // Resume the callback. 49 | _disableCallback = false; 50 | } 51 | 52 | public void OnChangeValue(int value) 53 | { 54 | if (_disableCallback) return; 55 | _receiver.ndiName = _sourceNames[value]; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /URP/Assets/Script/SourceSelector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Klak.Ndi; 6 | 7 | public class SourceSelector : MonoBehaviour 8 | { 9 | [SerializeField] Dropdown _dropdown = null; 10 | 11 | NdiReceiver _receiver; 12 | List _sourceNames; 13 | bool _disableCallback; 14 | 15 | // HACK: Assuming that the dropdown has more than 16 | // three child objects only while it's opened. 17 | bool IsOpened => _dropdown.transform.childCount > 3; 18 | 19 | void Start() => _receiver = GetComponent(); 20 | 21 | void Update() 22 | { 23 | // Do nothing if the menu is opened. 24 | if (IsOpened) return; 25 | 26 | // NDI source name retrieval 27 | _sourceNames = NdiFinder.sourceNames.ToList(); 28 | 29 | // Currect selection 30 | var index = _sourceNames.IndexOf(_receiver.ndiName); 31 | 32 | // Append the current name to the list if it's not found. 33 | if (index < 0) 34 | { 35 | index = _sourceNames.Count; 36 | _sourceNames.Add(_receiver.ndiName); 37 | } 38 | 39 | // Disable the callback while updating the menu options. 40 | _disableCallback = true; 41 | 42 | // Menu option update 43 | _dropdown.ClearOptions(); 44 | _dropdown.AddOptions(_sourceNames); 45 | _dropdown.value = index; 46 | _dropdown.RefreshShownValue(); 47 | 48 | // Resume the callback. 49 | _disableCallback = false; 50 | } 51 | 52 | public void OnChangeValue(int value) 53 | { 54 | if (_disableCallback) return; 55 | _receiver.ndiName = _sourceNames[value]; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /URP/Assets/URP_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_Renderer 14 | m_EditorClassIdentifier: 15 | m_RendererFeatures: [] 16 | m_RendererFeatureMap: 17 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 18 | shaders: 19 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 20 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 21 | screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, type: 3} 22 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 23 | tileDepthInfoPS: {fileID: 0} 24 | tileDeferredPS: {fileID: 0} 25 | stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} 26 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 27 | materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} 28 | m_OpaqueLayerMask: 29 | serializedVersion: 2 30 | m_Bits: 4294967295 31 | m_TransparentLayerMask: 32 | serializedVersion: 2 33 | m_Bits: 4294967295 34 | m_DefaultStencilState: 35 | overrideStencilState: 0 36 | stencilReference: 0 37 | stencilCompareFunction: 8 38 | passOperation: 2 39 | failOperation: 0 40 | zFailOperation: 0 41 | m_ShadowTransparentReceive: 1 42 | m_RenderingMode: 0 43 | m_AccurateGbufferNormals: 0 44 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Find.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using Microsoft.Win32.SafeHandles; 4 | 5 | namespace Klak.Ndi.Interop { 6 | 7 | public class Find : SafeHandleZeroOrMinusOneIsInvalid 8 | { 9 | #region SafeHandle implementation 10 | 11 | Find() : base(true) {} 12 | 13 | protected override bool ReleaseHandle() 14 | { 15 | _Destroy(handle); 16 | return true; 17 | } 18 | 19 | #endregion 20 | 21 | #region Public methods 22 | 23 | public static Find Create() 24 | => _Create(new Settings { ShowLocalSources = true }); 25 | 26 | public Span CurrentSources 27 | => GetCurrentSourcesAsSpan(); 28 | 29 | #endregion 30 | 31 | #region Unmanaged interface 32 | 33 | // Constructor options (equivalent to NDIlib_find_create_t) 34 | [StructLayout(LayoutKind.Sequential)] 35 | public struct Settings 36 | { 37 | [MarshalAs(UnmanagedType.U1)] public bool ShowLocalSources; 38 | public IntPtr Groups; 39 | public IntPtr ExtraIPs; 40 | } 41 | 42 | unsafe Span GetCurrentSourcesAsSpan() 43 | { 44 | uint count; 45 | var array = _GetCurrentSources(this, out count); 46 | return new Span((void*)array, (int)count); 47 | } 48 | 49 | [DllImport(Config.DllName, EntryPoint = "NDIlib_find_create_v2")] 50 | static extern Find _Create(in Settings settings); 51 | 52 | [DllImport(Config.DllName, EntryPoint = "NDIlib_find_destroy")] 53 | static extern void _Destroy(IntPtr find); 54 | 55 | [DllImport(Config.DllName, EntryPoint = "NDIlib_find_get_current_sources")] 56 | static extern IntPtr _GetCurrentSources(Find find, out uint count); 57 | 58 | #endregion 59 | } 60 | 61 | } // namespace Klak.Ndi.Interop 62 | -------------------------------------------------------------------------------- /Legacy/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 | -------------------------------------------------------------------------------- /URP/Assets/URP.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 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 5 16 | k_AssetPreviousVersion: 5 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: e6b277fe4e9566442a659b0278c18758, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 1 26 | m_SupportsHDR: 1 27 | m_MSAA: 1 28 | m_RenderScale: 1 29 | m_MainLightRenderingMode: 1 30 | m_MainLightShadowsSupported: 1 31 | m_MainLightShadowmapResolution: 2048 32 | m_AdditionalLightsRenderingMode: 1 33 | m_AdditionalLightsPerObjectLimit: 4 34 | m_AdditionalLightShadowsSupported: 0 35 | m_AdditionalLightsShadowmapResolution: 512 36 | m_ShadowDistance: 50 37 | m_ShadowCascadeCount: 1 38 | m_Cascade2Split: 0.25 39 | m_Cascade3Split: {x: 0.1, y: 0.3} 40 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 41 | m_ShadowDepthBias: 1 42 | m_ShadowNormalBias: 1 43 | m_SoftShadowsSupported: 0 44 | m_UseSRPBatcher: 1 45 | m_SupportsDynamicBatching: 0 46 | m_MixedLightingSupported: 1 47 | m_DebugLevel: 0 48 | m_UseAdaptivePerformance: 1 49 | m_ColorGradingMode: 0 50 | m_ColorGradingLutSize: 32 51 | m_ShadowType: 1 52 | m_LocalShadowsSupported: 0 53 | m_LocalShadowsAtlasResolution: 256 54 | m_MaxPixelLights: 0 55 | m_ShadowAtlasResolution: 256 56 | m_ShaderVariantLogLevel: 0 57 | m_ShadowCascades: 0 58 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/Utility.cs: -------------------------------------------------------------------------------- 1 | using Unity.Collections; 2 | using Unity.Collections.LowLevel.Unsafe; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | using IntPtr = System.IntPtr; 6 | 7 | namespace Klak.Ndi { 8 | 9 | // Small utility functions 10 | static class Util 11 | { 12 | public static int FrameDataSize(int width, int height, bool alpha) 13 | => width * height * (alpha ? 3 : 2); 14 | 15 | public static bool HasAlpha(Interop.FourCC fourCC) 16 | => fourCC == Interop.FourCC.UYVA; 17 | 18 | public static bool InGammaMode 19 | => QualitySettings.activeColorSpace == ColorSpace.Gamma; 20 | 21 | public static bool UsingMetal 22 | => SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal; 23 | 24 | public static void Destroy(Object obj) 25 | { 26 | if (obj == null) return; 27 | 28 | if (Application.isPlaying) 29 | Object.Destroy(obj); 30 | else 31 | Object.DestroyImmediate(obj); 32 | } 33 | } 34 | 35 | // Extension method to add IntPtr support to ComputeBuffer.SetData 36 | static class ComputeBufferExtension 37 | { 38 | public unsafe static void SetData 39 | (this ComputeBuffer buffer, IntPtr pointer, int count, int stride) 40 | { 41 | // NativeArray view for the unmanaged memory block 42 | var view = 43 | NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray 44 | ((void*)pointer, count * stride, Allocator.None); 45 | 46 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 47 | var safety = AtomicSafetyHandle.Create(); 48 | NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref view, safety); 49 | #endif 50 | 51 | buffer.SetData(view); 52 | 53 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 54 | AtomicSafetyHandle.Release(safety); 55 | #endif 56 | } 57 | } 58 | 59 | } // namespace Klak.Ndi 60 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/NdiSenderEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace Klak.Ndi.Editor { 5 | 6 | [CanEditMultipleObjects] 7 | [CustomEditor(typeof(NdiSender))] 8 | sealed class NdiSenderEditor : UnityEditor.Editor 9 | { 10 | static class Labels 11 | { 12 | public static Label NdiName = "NDI Name"; 13 | } 14 | 15 | #pragma warning disable CS0649 16 | 17 | AutoProperty _ndiName; 18 | AutoProperty _keepAlpha; 19 | AutoProperty _captureMethod; 20 | AutoProperty _sourceCamera; 21 | AutoProperty _sourceTexture; 22 | 23 | #pragma warning restore 24 | 25 | void OnEnable() => AutoProperty.Scan(this); 26 | 27 | public override void OnInspectorGUI() 28 | { 29 | serializedObject.Update(); 30 | 31 | // NDI Name 32 | if (_captureMethod.Target.hasMultipleDifferentValues || 33 | _captureMethod.Target.enumValueIndex != (int)CaptureMethod.GameView) 34 | EditorGUILayout.DelayedTextField(_ndiName, Labels.NdiName); 35 | 36 | // Keep Alpha 37 | EditorGUILayout.PropertyField(_keepAlpha); 38 | 39 | // Capture Method 40 | EditorGUILayout.PropertyField(_captureMethod); 41 | 42 | EditorGUI.indentLevel++; 43 | 44 | // Source Camera 45 | if (_captureMethod.Target.hasMultipleDifferentValues || 46 | _captureMethod.Target.enumValueIndex == (int)CaptureMethod.Camera) 47 | EditorGUILayout.PropertyField(_sourceCamera); 48 | 49 | // Source Texture 50 | if (_captureMethod.Target.hasMultipleDifferentValues || 51 | _captureMethod.Target.enumValueIndex == (int)CaptureMethod.Texture) 52 | EditorGUILayout.PropertyField(_sourceTexture); 53 | 54 | EditorGUI.indentLevel--; 55 | 56 | serializedObject.ApplyModifiedProperties(); 57 | } 58 | } 59 | 60 | } // namespace Klak.Ndi.Editor 61 | -------------------------------------------------------------------------------- /URP/Assets/Script/SenderBenchmark.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Klak.Ndi; 3 | 4 | class SenderBenchmark : MonoBehaviour 5 | { 6 | [SerializeField] NdiResources _resources = null; 7 | 8 | RenderTexture _targetRT; 9 | GameObject[] _instances = new GameObject[16]; 10 | 11 | System.Collections.IEnumerator Start() 12 | { 13 | _targetRT = new RenderTexture(256, 256, 32); 14 | 15 | for (var index = 0; index < 16; index++) 16 | _instances[index] = CreateInstance(index); 17 | 18 | var interval = new WaitForSeconds(0.3f); 19 | 20 | while (true) 21 | { 22 | var index = Random.Range(0, 15); 23 | 24 | if (_instances[index] == null) 25 | { 26 | _instances[index] = CreateInstance(index); 27 | } 28 | else 29 | { 30 | Destroy(_instances[index]); 31 | _instances[index] = null; 32 | } 33 | 34 | yield return interval; 35 | } 36 | } 37 | 38 | GameObject CreateInstance(int index) 39 | { 40 | var components = new [] { typeof(Camera), typeof(NdiSender) }; 41 | 42 | var go = new GameObject($"Sender {index}", components); 43 | 44 | var x = (index % 4 + 0.5f) / 4 - 0.5f; 45 | var y = (index / 4 + 0.5f) / 4 - 0.5f; 46 | 47 | go.transform.parent = transform; 48 | go.transform.localPosition = new Vector3(x, y, -10); 49 | 50 | var camera = go.GetComponent(); 51 | camera.orthographic = true; 52 | camera.orthographicSize = 0.5f / 4; 53 | camera.targetTexture = _targetRT; 54 | 55 | var sender = go.GetComponent(); 56 | sender.SetResources(_resources); 57 | sender.ndiName = go.name; 58 | sender.keepAlpha = true; 59 | sender.captureMethod = CaptureMethod.Camera; 60 | sender.sourceCamera = camera; 61 | 62 | return go; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /URP/Assets/Script/ReceiverBenchmark.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Klak.Ndi; 3 | 4 | class ReceiverBenchmark : MonoBehaviour 5 | { 6 | [SerializeField] Mesh _mesh = null; 7 | [SerializeField] Material _material = null; 8 | [SerializeField] NdiResources _resources = null; 9 | [SerializeField] string _hostName = ""; 10 | 11 | GameObject[] _instances = new GameObject[16]; 12 | 13 | System.Collections.IEnumerator Start() 14 | { 15 | for (var index = 0; index < 16; index++) 16 | _instances[index] = CreateInstance(index); 17 | 18 | var interval = new WaitForSeconds(0.3f); 19 | 20 | while (true) 21 | { 22 | var index = Random.Range(0, 15); 23 | 24 | if (_instances[index] == null) 25 | { 26 | _instances[index] = CreateInstance(index); 27 | } 28 | else 29 | { 30 | Destroy(_instances[index]); 31 | _instances[index] = null; 32 | } 33 | 34 | yield return interval; 35 | } 36 | } 37 | 38 | GameObject CreateInstance(int index) 39 | { 40 | var components = new [] 41 | { typeof(MeshFilter), typeof(MeshRenderer), typeof(NdiReceiver) }; 42 | 43 | var go = new GameObject($"Receiver {index}", components); 44 | 45 | var x = (index % 4 + 0.5f) / 4 - 0.5f; 46 | var y = (index / 4 + 0.5f) / 4 - 0.5f; 47 | 48 | go.transform.parent = transform; 49 | go.transform.localPosition = new Vector3(x, y, 0); 50 | go.transform.localScale = Vector3.one / 4; 51 | 52 | var mf = go.GetComponent(); 53 | mf.sharedMesh = _mesh; 54 | 55 | var mr = go.GetComponent(); 56 | mr.sharedMaterial = _material; 57 | 58 | var receiver = go.GetComponent(); 59 | receiver.SetResources(_resources); 60 | receiver.ndiName = $"{_hostName} (Sender {index})"; 61 | receiver.targetRenderer = mr; 62 | receiver.targetMaterialProperty = "_MainTex"; 63 | 64 | return go; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Structs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Klak.Ndi.Interop { 5 | 6 | // Packet type enumeration (equivalent to NDIlib_frame_type_e) 7 | public enum FrameType 8 | { 9 | None = 0, 10 | Video = 1, 11 | Audio = 2, 12 | Metadata = 3, 13 | Error = 4, 14 | StatusChange = 100 15 | } 16 | 17 | // FourCC values for video/audio frames 18 | public enum FourCC 19 | { 20 | // Video 21 | UYVY = 0x59565955, 22 | UYVA = 0x41565955, 23 | P216 = 0x36313250, 24 | PA16 = 0x36314150, 25 | YV12 = 0x32315659, 26 | I420 = 0x30323449, 27 | NV12 = 0x3231564E, 28 | BGRA = 0x41524742, 29 | BGRX = 0x58524742, 30 | RGBA = 0x41424752, 31 | RGBX = 0x58424752, 32 | // Audio 33 | FLTp = 0x70544c46 34 | } 35 | 36 | // Frame format enumeration (equivalent to NDIlib_frame_format_type_e) 37 | public enum FrameFormat 38 | { 39 | Interleaved, 40 | Progressive, 41 | Field0, 42 | Field1 43 | } 44 | 45 | // NDI source descriptor (equivalent to NDIlib_source_t) 46 | [StructLayout(LayoutKind.Sequential)] 47 | public struct Source 48 | { 49 | IntPtr _NdiName; 50 | IntPtr _UrlAddress; 51 | public string NdiName => Marshal.PtrToStringAnsi(_NdiName); 52 | public string UrlAddress => Marshal.PtrToStringAnsi(_UrlAddress); 53 | } 54 | 55 | // Video frame descriptor (equivalent to NDILib_video_frame_v2_t) 56 | [StructLayout(LayoutKind.Sequential)] 57 | public struct VideoFrame 58 | { 59 | public int Width, Height; 60 | public FourCC FourCC; 61 | public int FrameRateN, FrameRateD; 62 | public float AspectRatio; 63 | public FrameFormat FrameFormat; 64 | public long Timecode; 65 | public IntPtr Data; 66 | public int LineStride; 67 | public IntPtr Metadata; 68 | public long Timestamp; 69 | } 70 | 71 | // Tally data structure (equivalent to NDIlib_tally_t) 72 | [StructLayout(LayoutKind.Sequential)] 73 | public struct Tally 74 | { 75 | [MarshalAs(UnmanagedType.U1)] public bool OnProgram; 76 | [MarshalAs(UnmanagedType.U1)] public bool OnPreview; 77 | } 78 | 79 | } // namespace Klak.Ndi.Interop 80 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/SharedInstance.cs: -------------------------------------------------------------------------------- 1 | namespace Klak.Ndi { 2 | 3 | // A wrangler class managing singleton-like shared object instances 4 | static class SharedInstance 5 | { 6 | #region Public properties 7 | 8 | // NDI find object 9 | static public Interop.Find Find 10 | => _find ?? InitializeFind(); 11 | 12 | // NDI send object for the game view 13 | static public Interop.Send GameViewSend 14 | => _gameViewSend ?? InitializeGameViewSend(); 15 | 16 | static public bool IsGameViewSend(Interop.Send send) 17 | => send != null && send == _gameViewSend; 18 | 19 | #endregion 20 | 21 | #region Shared object implementation 22 | 23 | static Interop.Find _find; 24 | 25 | static Interop.Find InitializeFind() 26 | { 27 | _find = Interop.Find.Create(); 28 | SetFinalizer(); 29 | return _find; 30 | } 31 | 32 | static Interop.Send _gameViewSend; 33 | 34 | static Interop.Send InitializeGameViewSend() 35 | { 36 | _gameViewSend = Interop.Send.Create("Game View"); 37 | SetFinalizer(); 38 | return _gameViewSend; 39 | } 40 | 41 | #endregion 42 | 43 | #region Initializer implementation 44 | 45 | static SharedInstance() 46 | { 47 | #if UNITY_ANDROID && !UNITY_EDITOR 48 | AndroidHelper.SetupNetwork(); 49 | #endif 50 | } 51 | 52 | #endregion 53 | 54 | #region Finalizer implementatioin 55 | 56 | // We have to clean up the shared objects on a domain reload. 57 | // (This happens only on Editor.) 58 | 59 | #if UNITY_EDITOR 60 | 61 | static bool _finalizerReady; 62 | 63 | static void SetFinalizer() 64 | { 65 | if (_finalizerReady) return; 66 | UnityEditor.AssemblyReloadEvents.beforeAssemblyReload += OnDomainReload; 67 | _finalizerReady = true; 68 | } 69 | 70 | static void OnDomainReload() 71 | { 72 | _find?.Dispose(); 73 | _find = null; 74 | 75 | _gameViewSend?.Dispose(); 76 | _gameViewSend = null; 77 | } 78 | 79 | #else 80 | 81 | static void SetFinalizer() {} 82 | 83 | #endif 84 | 85 | #endregion 86 | } 87 | 88 | } // namespace Klak.Ndi 89 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiReceiver_Properties.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Klak.Ndi { 4 | 5 | public sealed partial class NdiReceiver : MonoBehaviour 6 | { 7 | #region NDI source settings 8 | 9 | [SerializeField] string _ndiName = null; 10 | string _ndiNameRuntime; 11 | 12 | public string ndiName 13 | { get => _ndiNameRuntime; 14 | set => SetNdiName(value); } 15 | 16 | void SetNdiName(string name) 17 | { 18 | if (_ndiNameRuntime == name) return; 19 | _ndiName = _ndiNameRuntime = name; 20 | Restart(); 21 | } 22 | 23 | #endregion 24 | 25 | #region Target settings 26 | 27 | [SerializeField] RenderTexture _targetTexture = null; 28 | 29 | public RenderTexture targetTexture 30 | { get => _targetTexture; 31 | set => _targetTexture = value; } 32 | 33 | [SerializeField] Renderer _targetRenderer = null; 34 | 35 | public Renderer targetRenderer 36 | { get => _targetRenderer; 37 | set => _targetRenderer = value; } 38 | 39 | [SerializeField] string _targetMaterialProperty = null; 40 | 41 | public string targetMaterialProperty 42 | { get => _targetMaterialProperty; 43 | set => _targetMaterialProperty = value; } 44 | 45 | #endregion 46 | 47 | #region Runtime property 48 | 49 | public RenderTexture texture => _converter?.LastDecoderOutput; 50 | 51 | public string metadata { get; set; } 52 | 53 | public Interop.Recv internalRecvObject => _recv; 54 | 55 | #endregion 56 | 57 | #region Resources asset reference 58 | 59 | [SerializeField, HideInInspector] NdiResources _resources = null; 60 | 61 | public void SetResources(NdiResources resources) 62 | => _resources = resources; 63 | 64 | #endregion 65 | 66 | #region Editor change validation 67 | 68 | // Applies changes on the serialized fields to the runtime properties. 69 | // We use OnValidate on Editor, which also works as an initializer. 70 | // Player never call it, so we use Awake instead of it. 71 | 72 | #if UNITY_EDITOR 73 | void OnValidate() 74 | #else 75 | void Awake() 76 | #endif 77 | => ndiName = _ndiName; 78 | 79 | #endregion 80 | } 81 | 82 | } // namespace Klak.Ndi 83 | -------------------------------------------------------------------------------- /HDRP/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /URP/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/PbxModifier.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_IOS 2 | 3 | using UnityEditor; 4 | using UnityEditor.Callbacks; 5 | using UnityEditor.iOS.Xcode; 6 | using System.IO; 7 | 8 | namespace Klak.Ndi.Editor { 9 | 10 | // Xcode project file modifier for iOS support 11 | public class PbxModifier 12 | { 13 | [PostProcessBuild] 14 | public static void OnPostprocessBuild(BuildTarget buildTarget, string path) 15 | { 16 | if (buildTarget == BuildTarget.iOS) 17 | { 18 | ModifyProjectFile(path); 19 | ModifyPlistFile(path); 20 | } 21 | } 22 | 23 | static void ModifyProjectFile(string basePath) 24 | { 25 | var path = PBXProject.GetPBXProjectPath(basePath); 26 | 27 | var proj = new PBXProject(); 28 | proj.ReadFromFile(path); 29 | 30 | var target = proj.GetUnityFrameworkTargetGuid(); 31 | var libPath = "/Library/NDI\\ Advanced\\ SDK\\ for\\ Apple/lib/iOS"; 32 | proj.AddBuildProperty(target, "LIBRARY_SEARCH_PATHS", libPath); 33 | proj.AddFrameworkToProject(target, "Accelerate.framework", false); 34 | proj.AddFrameworkToProject(target, "VideoToolbox.framework", false); 35 | proj.AddFrameworkToProject(target, "libndi_advanced_ios.a", false); 36 | 37 | proj.WriteToFile(path); 38 | } 39 | 40 | static void ModifyPlistFile(string basePath) 41 | { 42 | var path = Path.Combine(basePath, "Info.plist"); 43 | 44 | var plist = new PlistDocument(); 45 | plist.ReadFromFile(path); 46 | 47 | var root = plist.root; 48 | 49 | // Bonjour service list 50 | { 51 | var key = "NSBonjourServices"; 52 | if (root.values.ContainsKey(key)) 53 | root.values[key].AsArray().AddString("_ndi._tcp"); 54 | else 55 | root.CreateArray(key).AddString("_ndi._tcp"); 56 | } 57 | 58 | // LAN usage description 59 | { 60 | var key = "NSLocalNetworkUsageDescription"; 61 | var desc = "NDI requires device discovery capability " + 62 | "on the networks you use."; 63 | if (!root.values.ContainsKey(key)) root.SetString(key, desc); 64 | } 65 | 66 | plist.WriteToFile(path); 67 | } 68 | } 69 | 70 | } // namespace Klak.Ndi.Editor 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Legacy/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 1 64 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Send.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using Microsoft.Win32.SafeHandles; 4 | 5 | namespace Klak.Ndi.Interop { 6 | 7 | public class Send : SafeHandleZeroOrMinusOneIsInvalid 8 | { 9 | #region SafeHandle implementation 10 | 11 | Send() : base(true) {} 12 | 13 | protected override bool ReleaseHandle() 14 | { 15 | _Destroy(handle); 16 | return true; 17 | } 18 | 19 | #endregion 20 | 21 | #region Public methods 22 | 23 | public static Send Create(string name) 24 | => _Create(new Settings { NdiName = name }); 25 | 26 | public void SendVideo(in VideoFrame data) 27 | => _SendVideo(this, data); 28 | 29 | public void SendVideoAsync(in VideoFrame data) 30 | => _SendVideoAsync(this, data); 31 | 32 | public void SendVideoAsync() 33 | => _SendVideoAsync(this, IntPtr.Zero); 34 | 35 | public bool SetTally(out Tally tally, uint timeout) 36 | => _SetTally(this, out tally, timeout); 37 | 38 | #endregion 39 | 40 | #region Unmanaged interface 41 | 42 | // Constructor options (equivalent to NDIlib_send_create_t) 43 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 44 | public struct Settings 45 | { 46 | [MarshalAs(UnmanagedType.LPStr)] public string NdiName; 47 | [MarshalAs(UnmanagedType.LPStr)] public string Groups; 48 | [MarshalAs(UnmanagedType.U1)] public bool ClockVideo; 49 | [MarshalAs(UnmanagedType.U1)] public bool ClockAudio; 50 | } 51 | 52 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_create")] 53 | static extern Send _Create(in Settings settings); 54 | 55 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_destroy")] 56 | static extern void _Destroy(IntPtr send); 57 | 58 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_send_video_v2")] 59 | static extern void _SendVideo(Send send, in VideoFrame data); 60 | 61 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_send_video_async_v2")] 62 | static extern void _SendVideoAsync(Send send, in VideoFrame data); 63 | 64 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_send_video_async_v2")] 65 | static extern void _SendVideoAsync(Send send, IntPtr data); 66 | 67 | [DllImport(Config.DllName, EntryPoint = "NDIlib_send_get_tally")] 68 | [return: MarshalAs(UnmanagedType.U1)] 69 | static extern bool _SetTally(Send send, out Tally tally, uint timeout); 70 | 71 | #endregion 72 | } 73 | 74 | } // namespace Klak.Ndi.Interop 75 | -------------------------------------------------------------------------------- /URP/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_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 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 41 | m_CustomRenderPipeline: {fileID: 11400000, guid: a817dc55f0eb8dc468415b739ceae0d2, type: 2} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_DefaultRenderingLayerMask: 1 63 | m_LogWhenShaderIsCompiled: 0 64 | -------------------------------------------------------------------------------- /HDRP/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_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 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 41 | m_CustomRenderPipeline: {fileID: 11400000, guid: df1f3ba39049146318b22c35176d0df7, type: 2} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 1 61 | m_LightsUseColorTemperature: 1 62 | m_DefaultRenderingLayerMask: 257 63 | m_LogWhenShaderIsCompiled: 0 64 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/MaterialPropertySelector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Linq; 4 | 5 | namespace Klak.Ndi.Editor { 6 | 7 | static class MaterialPropertySelector 8 | { 9 | #region Public method 10 | 11 | // Material property dropdown list 12 | public static void DropdownList 13 | (SerializedProperty rendererProperty, 14 | SerializedProperty materialProperty) 15 | { 16 | var shader = GetShaderFromRenderer(rendererProperty); 17 | 18 | // Abandon the current value if there is no shader assignment. 19 | if (shader == null) 20 | { 21 | materialProperty.stringValue = ""; 22 | return; 23 | } 24 | 25 | var names = CachePropertyNames(shader); 26 | 27 | // Abandon the current value if there is no option. 28 | if (names.Length == 0) 29 | { 30 | materialProperty.stringValue = ""; 31 | return; 32 | } 33 | 34 | // Dropdown GUI 35 | var index = System.Array.IndexOf(names, materialProperty.stringValue); 36 | var newIndex = EditorGUILayout.Popup("Property", index, names); 37 | if (index != newIndex) materialProperty.stringValue = names[newIndex]; 38 | } 39 | 40 | #endregion 41 | 42 | #region Utility function 43 | 44 | // Shader retrieval function 45 | static Shader GetShaderFromRenderer(SerializedProperty property) 46 | { 47 | var renderer = property.objectReferenceValue as Renderer; 48 | if (renderer == null) return null; 49 | 50 | var material = renderer.sharedMaterial; 51 | if (material == null) return null; 52 | 53 | return material.shader; 54 | } 55 | 56 | #endregion 57 | 58 | #region Property name cache 59 | 60 | static Shader _cachedShader; 61 | static string[] _cachedPropertyNames; 62 | 63 | static bool IsPropertyTexture(Shader shader, int index) 64 | => ShaderUtil.GetPropertyType(shader, index) == 65 | ShaderUtil.ShaderPropertyType.TexEnv; 66 | 67 | static string[] CachePropertyNames(Shader shader) 68 | { 69 | if (shader == _cachedShader) return _cachedPropertyNames; 70 | 71 | var names = 72 | Enumerable.Range(0, ShaderUtil.GetPropertyCount(shader)) 73 | .Where(i => IsPropertyTexture(shader, i)) 74 | .Select(i => ShaderUtil.GetPropertyName(shader, i)); 75 | 76 | _cachedShader = shader; 77 | _cachedPropertyNames = names.ToArray(); 78 | 79 | return _cachedPropertyNames; 80 | } 81 | 82 | #endregion 83 | } 84 | 85 | } // namespace Klak.Ndi.Editor 86 | -------------------------------------------------------------------------------- /Legacy/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ugui": { 4 | "version": "1.0.0", 5 | "depth": 0, 6 | "source": "builtin", 7 | "dependencies": { 8 | "com.unity.modules.ui": "1.0.0", 9 | "com.unity.modules.imgui": "1.0.0" 10 | } 11 | }, 12 | "jp.keijiro.klak.ndi": { 13 | "version": "file:../../jp.keijiro.klak.ndi", 14 | "depth": 0, 15 | "source": "local", 16 | "dependencies": { 17 | "com.unity.modules.screencapture": "1.0.0" 18 | } 19 | }, 20 | "jp.keijiro.testcards": { 21 | "version": "1.0.0", 22 | "depth": 0, 23 | "source": "registry", 24 | "dependencies": {}, 25 | "url": "https://registry.npmjs.com" 26 | }, 27 | "org.nuget.system.buffers": { 28 | "version": "4.4.0", 29 | "depth": 1, 30 | "source": "registry", 31 | "dependencies": {}, 32 | "url": "https://unitynuget-registry.azurewebsites.net" 33 | }, 34 | "org.nuget.system.memory": { 35 | "version": "4.5.3", 36 | "depth": 0, 37 | "source": "registry", 38 | "dependencies": { 39 | "org.nuget.system.buffers": "4.4.0", 40 | "org.nuget.system.numerics.vectors": "4.4.0", 41 | "org.nuget.system.runtime.compilerservices.unsafe": "4.5.2" 42 | }, 43 | "url": "https://unitynuget-registry.azurewebsites.net" 44 | }, 45 | "org.nuget.system.numerics.vectors": { 46 | "version": "4.4.0", 47 | "depth": 1, 48 | "source": "registry", 49 | "dependencies": {}, 50 | "url": "https://unitynuget-registry.azurewebsites.net" 51 | }, 52 | "org.nuget.system.runtime.compilerservices.unsafe": { 53 | "version": "4.5.2", 54 | "depth": 1, 55 | "source": "registry", 56 | "dependencies": {}, 57 | "url": "https://unitynuget-registry.azurewebsites.net" 58 | }, 59 | "com.unity.modules.androidjni": { 60 | "version": "1.0.0", 61 | "depth": 0, 62 | "source": "builtin", 63 | "dependencies": {} 64 | }, 65 | "com.unity.modules.imageconversion": { 66 | "version": "1.0.0", 67 | "depth": 2, 68 | "source": "builtin", 69 | "dependencies": {} 70 | }, 71 | "com.unity.modules.imgui": { 72 | "version": "1.0.0", 73 | "depth": 1, 74 | "source": "builtin", 75 | "dependencies": {} 76 | }, 77 | "com.unity.modules.screencapture": { 78 | "version": "1.0.0", 79 | "depth": 1, 80 | "source": "builtin", 81 | "dependencies": { 82 | "com.unity.modules.imageconversion": "1.0.0" 83 | } 84 | }, 85 | "com.unity.modules.ui": { 86 | "version": "1.0.0", 87 | "depth": 1, 88 | "source": "builtin", 89 | "dependencies": {} 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Interop/Recv.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using Microsoft.Win32.SafeHandles; 4 | 5 | namespace Klak.Ndi.Interop { 6 | 7 | // Bandwidth enumeration (equivalent to NDIlib_recv_bandwidth_e) 8 | public enum Bandwidth 9 | { 10 | MetadataOnly = -10, 11 | AudioOnly = 10, 12 | Lowest = 0, 13 | Highest = 100 14 | } 15 | 16 | // Color format enumeration (equivalent to NDIlib_recv_color_format_e) 17 | public enum ColorFormat 18 | { 19 | BGRX_BGRA = 0, 20 | UYVY_BGRA = 1, 21 | RGBX_RGBA = 2, 22 | UYVY_RGBA = 3, 23 | BGRX_BGRA_Flipped = 200, 24 | Fastest = 100, 25 | Best = 101 26 | } 27 | 28 | public class Recv : SafeHandleZeroOrMinusOneIsInvalid 29 | { 30 | #region SafeHandle implementation 31 | 32 | Recv() : base(true) {} 33 | 34 | protected override bool ReleaseHandle() 35 | { 36 | _Destroy(handle); 37 | return true; 38 | } 39 | 40 | #endregion 41 | 42 | #region Public methods 43 | 44 | public static Recv Create(in Settings settings) 45 | => _Create(settings); 46 | 47 | public FrameType Capture 48 | (out VideoFrame video, IntPtr audio, IntPtr metadata, uint timeout) 49 | => _Capture(this, out video, audio, metadata, timeout); 50 | 51 | public void FreeVideoFrame(in VideoFrame frame) 52 | => _FreeVideo(this, frame); 53 | 54 | public bool SetTally(in Tally tally) 55 | => _SetTally(this, tally); 56 | 57 | #endregion 58 | 59 | #region Unmanaged interface 60 | 61 | // Constructor options (equivalent to NDIlib_recv_create_v3_t) 62 | [StructLayout(LayoutKind.Sequential)] 63 | public struct Settings 64 | { 65 | public Source Source; 66 | public ColorFormat ColorFormat; 67 | public Bandwidth Bandwidth; 68 | [MarshalAs(UnmanagedType.U1)] public bool AllowVideoFields; 69 | public IntPtr Name; 70 | } 71 | 72 | [DllImport(Config.DllName, EntryPoint = "NDIlib_recv_create_v3")] 73 | static extern Recv _Create(in Settings Settings); 74 | 75 | [DllImport(Config.DllName, EntryPoint = "NDIlib_recv_destroy")] 76 | static extern void _Destroy(IntPtr recv); 77 | 78 | [DllImport(Config.DllName, EntryPoint = "NDIlib_recv_capture_v2")] 79 | static extern FrameType _Capture 80 | (Recv recv, out VideoFrame video, 81 | IntPtr audio, IntPtr metadata, uint timeout); 82 | 83 | [DllImport(Config.DllName, EntryPoint = "NDIlib_recv_free_video_v2")] 84 | static extern void _FreeVideo(Recv recv, in VideoFrame data); 85 | 86 | [DllImport(Config.DllName, EntryPoint = "NDIlib_recv_set_tally")] 87 | [return: MarshalAs(UnmanagedType.U1)] 88 | static extern bool _SetTally(Recv recv, in Tally tally); 89 | 90 | #endregion 91 | } 92 | 93 | } // namespace Klak.Ndi.Interop 94 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiReceiver.cs: -------------------------------------------------------------------------------- 1 | using Unity.Collections.LowLevel.Unsafe; 2 | using UnityEngine; 3 | using IntPtr = System.IntPtr; 4 | using Marshal = System.Runtime.InteropServices.Marshal; 5 | 6 | namespace Klak.Ndi { 7 | 8 | [ExecuteInEditMode] 9 | public sealed partial class NdiReceiver : MonoBehaviour 10 | { 11 | #region Receiver objects 12 | 13 | Interop.Recv _recv; 14 | FormatConverter _converter; 15 | MaterialPropertyBlock _override; 16 | 17 | void PrepareReceiverObjects() 18 | { 19 | if (_recv == null) _recv = RecvHelper.TryCreateRecv(ndiName); 20 | if (_converter == null) _converter = new FormatConverter(_resources); 21 | if (_override == null) _override = new MaterialPropertyBlock(); 22 | } 23 | 24 | void ReleaseReceiverObjects() 25 | { 26 | _recv?.Dispose(); 27 | _recv = null; 28 | 29 | _converter?.Dispose(); 30 | _converter = null; 31 | 32 | // We don't dispose _override because it's reusable. 33 | } 34 | 35 | #endregion 36 | 37 | #region Receiver implementation 38 | 39 | RenderTexture TryReceiveFrame() 40 | { 41 | PrepareReceiverObjects(); 42 | if (_recv == null) return null; 43 | 44 | // Video frame capturing 45 | var frameOrNull = RecvHelper.TryCaptureVideoFrame(_recv); 46 | if (frameOrNull == null) return null; 47 | var frame = (Interop.VideoFrame)frameOrNull; 48 | 49 | // Pixel format conversion 50 | var rt = _converter.Decode 51 | (frame.Width, frame.Height, Util.HasAlpha(frame.FourCC), frame.Data); 52 | 53 | // Metadata retrieval 54 | if (frame.Metadata != IntPtr.Zero) 55 | metadata = Marshal.PtrToStringAnsi(frame.Metadata); 56 | else 57 | metadata = null; 58 | 59 | // Video frame release 60 | _recv.FreeVideoFrame(frame); 61 | 62 | return rt; 63 | } 64 | 65 | #endregion 66 | 67 | #region Component state controller 68 | 69 | internal void Restart() => ReleaseReceiverObjects(); 70 | 71 | #endregion 72 | 73 | #region MonoBehaviour implementation 74 | 75 | void OnDisable() => ReleaseReceiverObjects(); 76 | 77 | void Update() 78 | { 79 | var rt = TryReceiveFrame(); 80 | if (rt == null) return; 81 | 82 | // Material property override 83 | if (targetRenderer != null) 84 | { 85 | targetRenderer.GetPropertyBlock(_override); 86 | _override.SetTexture(targetMaterialProperty, rt); 87 | targetRenderer.SetPropertyBlock(_override); 88 | } 89 | 90 | // External texture update 91 | if (targetTexture != null) Graphics.Blit(rt, targetTexture); 92 | } 93 | 94 | #endregion 95 | } 96 | 97 | } // namespace Klak.Ndi 98 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Editor/NdiReceiverEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Linq; 4 | 5 | namespace Klak.Ndi.Editor { 6 | 7 | [CanEditMultipleObjects] 8 | [CustomEditor(typeof(NdiReceiver))] 9 | sealed class NdiReceiverEditor : UnityEditor.Editor 10 | { 11 | static class Labels 12 | { 13 | public static Label NdiName = "NDI Name"; 14 | public static Label Property = "Property"; 15 | public static Label Select = "Select"; 16 | } 17 | 18 | #pragma warning disable CS0649 19 | 20 | AutoProperty _ndiName; 21 | AutoProperty _targetTexture; 22 | AutoProperty _targetRenderer; 23 | AutoProperty _targetMaterialProperty; 24 | 25 | #pragma warning restore 26 | 27 | // NDI name dropdown 28 | void ShowNdiNameDropdown(Rect rect) 29 | { 30 | var menu = new GenericMenu(); 31 | var sources = NdiFinder.sourceNames; 32 | 33 | if (sources.Any()) 34 | { 35 | foreach (var name in sources) 36 | menu.AddItem(new GUIContent(name), false, OnSelectName, name); 37 | } 38 | else 39 | { 40 | menu.AddItem(new GUIContent("No source available"), false, null); 41 | } 42 | 43 | menu.DropDown(rect); 44 | } 45 | 46 | // NDI source name selection callback 47 | void OnSelectName(object name) 48 | { 49 | serializedObject.Update(); 50 | _ndiName.Target.stringValue = (string)name; 51 | serializedObject.ApplyModifiedProperties(); 52 | } 53 | 54 | void OnEnable() => AutoProperty.Scan(this); 55 | 56 | public override void OnInspectorGUI() 57 | { 58 | serializedObject.Update(); 59 | 60 | EditorGUILayout.BeginHorizontal(); 61 | 62 | // NDI Name 63 | EditorGUILayout.DelayedTextField(_ndiName, Labels.NdiName); 64 | 65 | // NDI name dropdown 66 | var rect = EditorGUILayout.GetControlRect(false, GUILayout.Width(60)); 67 | if (EditorGUI.DropdownButton(rect, Labels.Select, FocusType.Keyboard)) 68 | ShowNdiNameDropdown(rect); 69 | 70 | EditorGUILayout.EndHorizontal(); 71 | 72 | // Target Texture/Renderer 73 | EditorGUILayout.PropertyField(_targetTexture); 74 | EditorGUILayout.PropertyField(_targetRenderer); 75 | 76 | EditorGUI.indentLevel++; 77 | 78 | if (_targetRenderer.Target.hasMultipleDifferentValues) 79 | { 80 | // Multiple renderers selected: Show the simple text field. 81 | EditorGUILayout. 82 | PropertyField(_targetMaterialProperty, Labels.Property); 83 | } 84 | else if (_targetRenderer.Target.objectReferenceValue != null) 85 | { 86 | // Single renderer: Show the material property selection dropdown. 87 | MaterialPropertySelector. 88 | DropdownList(_targetRenderer, _targetMaterialProperty); 89 | } 90 | 91 | EditorGUI.indentLevel--; 92 | 93 | serializedObject.ApplyModifiedProperties(); 94 | } 95 | } 96 | 97 | } // namespace Klak.Ndi.Editor 98 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Component/NdiSender_Properties.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Klak.Ndi { 4 | 5 | public enum CaptureMethod { GameView, Camera, Texture } 6 | 7 | public sealed partial class NdiSender : MonoBehaviour 8 | { 9 | #region NDI source settings 10 | 11 | [SerializeField] string _ndiName = "NDI Sender"; 12 | string _ndiNameRuntime; 13 | 14 | public string ndiName 15 | { get => _ndiNameRuntime; 16 | set => SetNdiName(value); } 17 | 18 | void SetNdiName(string name) 19 | { 20 | if (_ndiNameRuntime == name) return; 21 | _ndiName = _ndiNameRuntime = name; 22 | Restart(); 23 | } 24 | 25 | [SerializeField] bool _keepAlpha = false; 26 | 27 | public bool keepAlpha 28 | { get => _keepAlpha; 29 | set => _keepAlpha = value; } 30 | 31 | #endregion 32 | 33 | #region Capture target settings 34 | 35 | [SerializeField] CaptureMethod _captureMethod = CaptureMethod.GameView; 36 | CaptureMethod _captureMethodRuntime; 37 | 38 | public CaptureMethod captureMethod 39 | { get => _captureMethodRuntime; 40 | set => SetCaptureMethod(value); } 41 | 42 | void SetCaptureMethod(CaptureMethod method) 43 | { 44 | if (_captureMethodRuntime == method) return; 45 | _captureMethod = _captureMethodRuntime = method; 46 | Restart(); 47 | } 48 | 49 | [SerializeField] Camera _sourceCamera = null; 50 | Camera _sourceCameraRuntime; 51 | 52 | public Camera sourceCamera 53 | { get => _sourceCamera; 54 | set => SetSourceCamera(value); } 55 | 56 | void SetSourceCamera(Camera camera) 57 | { 58 | if (_sourceCameraRuntime == camera) return; 59 | _sourceCamera = _sourceCameraRuntime = camera; 60 | ResetState(); 61 | } 62 | 63 | [SerializeField] Texture _sourceTexture = null; 64 | 65 | public Texture sourceTexture 66 | { get => _sourceTexture; 67 | set => _sourceTexture = value; } 68 | 69 | #endregion 70 | 71 | #region Runtime property 72 | 73 | public string metadata { get; set; } 74 | 75 | public Interop.Send internalSendObject => _send; 76 | 77 | #endregion 78 | 79 | #region Resources asset reference 80 | 81 | [SerializeField, HideInInspector] NdiResources _resources = null; 82 | 83 | public void SetResources(NdiResources resources) 84 | => _resources = resources; 85 | 86 | #endregion 87 | 88 | #region Editor change validation 89 | 90 | // Applies changes on the serialized fields to the runtime properties. 91 | // We use OnValidate on Editor, which also works as an initializer. 92 | // Player never call it, so we use Awake instead of it. 93 | 94 | #if UNITY_EDITOR 95 | void OnValidate() 96 | #else 97 | void Awake() 98 | #endif 99 | { 100 | ndiName = _ndiName; 101 | captureMethod = _captureMethod; 102 | sourceCamera = _sourceCamera; 103 | } 104 | 105 | #endregion 106 | } 107 | 108 | } // namespace Klak.Ndi 109 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Gradient.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-543972445948358089 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 4 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: Gradient 24 | m_Shader: {fileID: -6465566751694194690, guid: a8c703759a113434f8b6a1568791b99b, type: 3} 25 | m_ShaderKeywords: 26 | m_LightmapFlags: 4 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: -1 30 | stringTagMap: {} 31 | disabledShaderPasses: [] 32 | m_SavedProperties: 33 | serializedVersion: 3 34 | m_TexEnvs: 35 | - _BaseMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _BumpMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailAlbedoMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailMask: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DetailNormalMap: 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_Floats: 92 | - _AlphaClip: 0 93 | - _Blend: 0 94 | - _BumpScale: 1 95 | - _ClearCoatMask: 0 96 | - _ClearCoatSmoothness: 0 97 | - _Cull: 2 98 | - _Cutoff: 0.5 99 | - _DetailAlbedoMapScale: 1 100 | - _DetailNormalMapScale: 1 101 | - _DstBlend: 0 102 | - _EnvironmentReflections: 1 103 | - _GlossMapScale: 0 104 | - _Glossiness: 0 105 | - _GlossyReflections: 0 106 | - _Metallic: 0 107 | - _OcclusionStrength: 1 108 | - _Parallax: 0.005 109 | - _QueueOffset: 0 110 | - _ReceiveShadows: 1 111 | - _Smoothness: 0.5 112 | - _SmoothnessTextureChannel: 0 113 | - _SpecularHighlights: 1 114 | - _SrcBlend: 1 115 | - _Surface: 0 116 | - _WorkflowMode: 1 117 | - _ZWrite: 1 118 | m_Colors: 119 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 120 | - _Color: {r: 1, g: 1, b: 1, a: 1} 121 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 122 | - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} 123 | m_BuildTextureStacks: [] 124 | -------------------------------------------------------------------------------- /URP/Assets/Shader/Receiver.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-1086850596210098573 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 4 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: Receiver 24 | m_Shader: {fileID: -6465566751694194690, guid: 6e59dd6be419cbb4b87375f34221f6ac, type: 3} 25 | m_ShaderKeywords: 26 | m_LightmapFlags: 4 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: -1 30 | stringTagMap: {} 31 | disabledShaderPasses: [] 32 | m_SavedProperties: 33 | serializedVersion: 3 34 | m_TexEnvs: 35 | - _BaseMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _BumpMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _DetailAlbedoMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _DetailMask: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DetailNormalMap: 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_Floats: 92 | - _AlphaClip: 0 93 | - _Blend: 0 94 | - _BumpScale: 1 95 | - _ClearCoatMask: 0 96 | - _ClearCoatSmoothness: 0 97 | - _Cull: 2 98 | - _Cutoff: 0.5 99 | - _DetailAlbedoMapScale: 1 100 | - _DetailNormalMapScale: 1 101 | - _DstBlend: 0 102 | - _EnvironmentReflections: 1 103 | - _GlossMapScale: 0 104 | - _Glossiness: 0 105 | - _GlossyReflections: 0 106 | - _Metallic: 0 107 | - _OcclusionStrength: 1 108 | - _Parallax: 0.005 109 | - _QueueOffset: 0 110 | - _ReceiveShadows: 1 111 | - _Smoothness: 0.5 112 | - _SmoothnessTextureChannel: 0 113 | - _SpecularHighlights: 1 114 | - _SrcBlend: 1 115 | - _Surface: 0 116 | - _WorkflowMode: 1 117 | - _ZWrite: 1 118 | m_Colors: 119 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 120 | - _Color: {r: 1, g: 1, b: 1, a: 1} 121 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 122 | - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} 123 | m_BuildTextureStacks: [] 124 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/Decoder.compute: -------------------------------------------------------------------------------- 1 | // 2 | // Color format converter (UYVY/UYVA -> sRGB/Linear RGBA) 3 | // 4 | 5 | #pragma kernel DecodeUYVY_sRGB 6 | #pragma kernel DecodeUYVY_Linear 7 | #pragma kernel DecodeUYVA_sRGB 8 | #pragma kernel DecodeUYVA_Linear 9 | 10 | StructuredBuffer Source; 11 | RWTexture2D Destination; 12 | 13 | // sRGB to linear conversion 14 | float4 sRGB_to_Linear(float4 c) 15 | { 16 | float3 lo = c.rgb / 12.92; 17 | float3 hi = pow((abs(c.rgb) + 0.055) / 1.055, 2.4); 18 | return float4(c.rgb <= 0.04045 ? lo : hi, c.a); 19 | } 20 | 21 | // YUV to RGB conversion (based on Rec.709 constants) 22 | float3 YUV2RGB(float3 yuv) 23 | { 24 | const float K_B = 0.0722; 25 | const float K_R = 0.2126; 26 | const float K_G = 1 - K_B - K_R; 27 | 28 | float y = yuv.x; 29 | float u = yuv.y; 30 | float v = yuv.z; 31 | 32 | float r = y + v * (1 - K_R); 33 | float b = y + u * (1 - K_B); 34 | float g = (y - K_R * r - K_B * b) / K_G; 35 | 36 | return float3(r, g, b); 37 | } 38 | 39 | // Packed UYVY conversion 40 | float4 UnpackUYVY(uint v) 41 | { 42 | float4 f = uint4(v, v >> 8, v >> 16, v >> 24) & 0xff; 43 | f.yw = (f.yw - 16) / 219; // Y components (limited range) 44 | f.xz = (f.xz - 128) / 112; // UV components (limited range) 45 | return f; 46 | } 47 | 48 | // Packed alpha conversion 49 | float4 UnpackAAAA(uint v) 50 | { 51 | return (uint4(v, v >> 8, v >> 16, v >> 24) & 0xff) / 255.0; 52 | } 53 | 54 | // UYVY decoder function 55 | float2x4 DecodeUYVY(uint2 id) 56 | { 57 | uint w, h; 58 | Destination.GetDimensions(w, h); 59 | 60 | uint id_y = h - 1 - id.y; 61 | 62 | uint sp = id_y * w / 2 + id.x; 63 | float4 uyvy = UnpackUYVY(Source[sp]); 64 | 65 | return float2x4(float4(YUV2RGB(uyvy.yxz), 1), 66 | float4(YUV2RGB(uyvy.wxz), 1)); 67 | } 68 | 69 | // UYVA decoder function 70 | float4x4 DecodeUYVA(uint2 id) 71 | { 72 | uint w, h; 73 | Destination.GetDimensions(w, h); 74 | 75 | uint id_y = h - 1 - id.y; 76 | 77 | uint sp1 = id_y * w / 2 + id.x * 2; 78 | float4 uyvy01 = UnpackUYVY(Source[sp1 + 0]); 79 | float4 uyvy23 = UnpackUYVY(Source[sp1 + 1]); 80 | 81 | uint sp2 = id_y * w / 4 + id.x + w * h / 2; 82 | float4 a0123 = UnpackAAAA(Source[sp2]); 83 | 84 | return float4x4(float4(YUV2RGB(uyvy01.yxz), a0123.x), 85 | float4(YUV2RGB(uyvy01.wxz), a0123.y), 86 | float4(YUV2RGB(uyvy23.yxz), a0123.z), 87 | float4(YUV2RGB(uyvy23.wxz), a0123.w)); 88 | } 89 | 90 | // Decoder kernel entry points 91 | 92 | [numthreads(8, 8, 1)] 93 | void DecodeUYVY_sRGB(uint2 id : SV_DispatchThreadID) 94 | { 95 | float2x4 d = DecodeUYVY(id); 96 | uint2 dp = id * uint2(2, 1); 97 | Destination[dp + uint2(0, 0)] = d[0]; 98 | Destination[dp + uint2(1, 0)] = d[1]; 99 | } 100 | 101 | [numthreads(8, 8, 1)] 102 | void DecodeUYVY_Linear(uint2 id : SV_DispatchThreadID) 103 | { 104 | float2x4 d = DecodeUYVY(id); 105 | uint2 dp = id * uint2(2, 1); 106 | Destination[dp + uint2(0, 0)] = sRGB_to_Linear(d[0]); 107 | Destination[dp + uint2(1, 0)] = sRGB_to_Linear(d[1]); 108 | } 109 | 110 | [numthreads(4, 8, 1)] 111 | void DecodeUYVA_sRGB(uint2 id : SV_DispatchThreadID) 112 | { 113 | float4x4 d = DecodeUYVA(id); 114 | uint2 dp = id * uint2(4, 1); 115 | Destination[dp + uint2(0, 0)] = d[0]; 116 | Destination[dp + uint2(1, 0)] = d[1]; 117 | Destination[dp + uint2(2, 0)] = d[2]; 118 | Destination[dp + uint2(3, 0)] = d[3]; 119 | } 120 | 121 | [numthreads(4, 8, 1)] 122 | void DecodeUYVA_Linear(uint2 id : SV_DispatchThreadID) 123 | { 124 | float4x4 d = DecodeUYVA(id); 125 | uint2 dp = id * uint2(4, 1); 126 | Destination[dp + uint2(0, 0)] = sRGB_to_Linear(d[0]); 127 | Destination[dp + uint2(1, 0)] = sRGB_to_Linear(d[1]); 128 | Destination[dp + uint2(2, 0)] = sRGB_to_Linear(d[2]); 129 | Destination[dp + uint2(3, 0)] = sRGB_to_Linear(d[3]); 130 | } 131 | -------------------------------------------------------------------------------- /URP/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.mathematics": { 4 | "version": "1.1.0", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.render-pipelines.core": { 11 | "version": "10.6.0", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.ugui": "1.0.0" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.render-pipelines.universal": { 20 | "version": "10.6.0", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.mathematics": "1.1.0", 25 | "com.unity.render-pipelines.core": "10.6.0", 26 | "com.unity.shadergraph": "10.6.0" 27 | }, 28 | "url": "https://packages.unity.com" 29 | }, 30 | "com.unity.searcher": { 31 | "version": "4.3.2", 32 | "depth": 2, 33 | "source": "registry", 34 | "dependencies": {}, 35 | "url": "https://packages.unity.com" 36 | }, 37 | "com.unity.shadergraph": { 38 | "version": "10.6.0", 39 | "depth": 1, 40 | "source": "registry", 41 | "dependencies": { 42 | "com.unity.render-pipelines.core": "10.6.0", 43 | "com.unity.searcher": "4.3.2" 44 | }, 45 | "url": "https://packages.unity.com" 46 | }, 47 | "com.unity.ugui": { 48 | "version": "1.0.0", 49 | "depth": 0, 50 | "source": "builtin", 51 | "dependencies": { 52 | "com.unity.modules.ui": "1.0.0", 53 | "com.unity.modules.imgui": "1.0.0" 54 | } 55 | }, 56 | "jp.keijiro.klak.ndi": { 57 | "version": "file:../../jp.keijiro.klak.ndi", 58 | "depth": 0, 59 | "source": "local", 60 | "dependencies": { 61 | "com.unity.modules.screencapture": "1.0.0" 62 | } 63 | }, 64 | "org.nuget.system.buffers": { 65 | "version": "4.4.0", 66 | "depth": 1, 67 | "source": "registry", 68 | "dependencies": {}, 69 | "url": "https://unitynuget-registry.azurewebsites.net" 70 | }, 71 | "org.nuget.system.memory": { 72 | "version": "4.5.3", 73 | "depth": 0, 74 | "source": "registry", 75 | "dependencies": { 76 | "org.nuget.system.buffers": "4.4.0", 77 | "org.nuget.system.numerics.vectors": "4.4.0", 78 | "org.nuget.system.runtime.compilerservices.unsafe": "4.5.2" 79 | }, 80 | "url": "https://unitynuget-registry.azurewebsites.net" 81 | }, 82 | "org.nuget.system.numerics.vectors": { 83 | "version": "4.4.0", 84 | "depth": 1, 85 | "source": "registry", 86 | "dependencies": {}, 87 | "url": "https://unitynuget-registry.azurewebsites.net" 88 | }, 89 | "org.nuget.system.runtime.compilerservices.unsafe": { 90 | "version": "4.5.2", 91 | "depth": 1, 92 | "source": "registry", 93 | "dependencies": {}, 94 | "url": "https://unitynuget-registry.azurewebsites.net" 95 | }, 96 | "com.unity.modules.androidjni": { 97 | "version": "1.0.0", 98 | "depth": 0, 99 | "source": "builtin", 100 | "dependencies": {} 101 | }, 102 | "com.unity.modules.imageconversion": { 103 | "version": "1.0.0", 104 | "depth": 2, 105 | "source": "builtin", 106 | "dependencies": {} 107 | }, 108 | "com.unity.modules.imgui": { 109 | "version": "1.0.0", 110 | "depth": 1, 111 | "source": "builtin", 112 | "dependencies": {} 113 | }, 114 | "com.unity.modules.physics": { 115 | "version": "1.0.0", 116 | "depth": 0, 117 | "source": "builtin", 118 | "dependencies": {} 119 | }, 120 | "com.unity.modules.screencapture": { 121 | "version": "1.0.0", 122 | "depth": 1, 123 | "source": "builtin", 124 | "dependencies": { 125 | "com.unity.modules.imageconversion": "1.0.0" 126 | } 127 | }, 128 | "com.unity.modules.ui": { 129 | "version": "1.0.0", 130 | "depth": 1, 131 | "source": "builtin", 132 | "dependencies": {} 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Resource/Encoder.compute: -------------------------------------------------------------------------------- 1 | // 2 | // Color format converter (sRGB/Linear RGBA -> UYVY/UYVA) 3 | // 4 | 5 | #pragma kernel EncodeUYVY_sRGB 6 | #pragma kernel EncodeUYVY_Linear 7 | #pragma kernel EncodeUYVA_sRGB 8 | #pragma kernel EncodeUYVA_Linear 9 | 10 | Texture2D Source; 11 | RWStructuredBuffer Destination; 12 | float VFlip; 13 | 14 | // Linear to sRGB conversion 15 | float4 Linear_to_sRGB(float4 c) 16 | { 17 | float3 lo = c.rgb * 12.92; 18 | float3 hi = (pow(abs(c.rgb), 1 / 2.4) * 1.055) - 0.055; 19 | return float4(c.rgb <= 0.0031308 ? lo : hi, c.a); 20 | } 21 | 22 | // RGB to YUV conversion (based on Rec.709 constants) 23 | float3 RGB2YUV(float3 rgb) 24 | { 25 | const float K_B = 0.0722; 26 | const float K_R = 0.2126; 27 | const float K_G = 1 - K_B - K_R; 28 | 29 | float y = dot(float3(K_R, K_G, K_B), rgb); 30 | float u = (rgb.b - y) / (1 - K_B); 31 | float v = (rgb.r - y) / (1 - K_R); 32 | 33 | return float3(y, u, v); 34 | } 35 | 36 | // Packed UYVY conversion 37 | uint PackUYVY(float4 v) 38 | { 39 | v.yw = v.yw * 219 + 16; // Y components (limited range) 40 | v.xz = v.xz * 112 + 128; // UV components (limited range) 41 | uint4 i = (uint4)(v + 0.5); 42 | return i.x | (i.y << 8) | (i.z << 16) | (i.w << 24); 43 | } 44 | 45 | // Packed alpha conversion 46 | uint PackAAAA(float4 a) 47 | { 48 | uint4 i = (uint4)(a * 255 + 0.5); 49 | return i.x | (i.y << 8) | (i.z << 16) | (i.w << 24); 50 | } 51 | 52 | // UYVY encoder function 53 | void EncodeUYVY(uint2 id, float4 s0, float4 s1) 54 | { 55 | float3 yuv1 = RGB2YUV(s0.xyz); 56 | float3 yuv2 = RGB2YUV(s1.xyz); 57 | 58 | float u = (yuv1.y + yuv2.y) / 2; 59 | float v = (yuv1.z + yuv2.z) / 2; 60 | float4 uyvy = float4(u, yuv1.x, v, yuv2.x); 61 | 62 | uint w, h; 63 | Source.GetDimensions(w, h); 64 | 65 | uint sy = lerp(id.y, h - 1 - id.y, VFlip); 66 | Destination[sy * w / 2 + id.x] = PackUYVY(uyvy); 67 | } 68 | 69 | // UYVA encoder function 70 | void EncodeUYVA(uint2 id, float4 s0, float4 s1, float4 s2, float4 s3) 71 | { 72 | float3 yuv0 = RGB2YUV(s0.xyz); 73 | float3 yuv1 = RGB2YUV(s1.xyz); 74 | float3 yuv2 = RGB2YUV(s2.xyz); 75 | float3 yuv3 = RGB2YUV(s3.xyz); 76 | 77 | float u01 = (yuv0.y + yuv1.y) / 2; 78 | float v01 = (yuv0.z + yuv1.z) / 2; 79 | 80 | float u23 = (yuv2.y + yuv3.y) / 2; 81 | float v23 = (yuv2.z + yuv3.z) / 2; 82 | 83 | float4 uyvy01 = float4(u01, yuv0.x, v01, yuv1.x); 84 | float4 uyvy23 = float4(u23, yuv2.x, v23, yuv3.x); 85 | 86 | uint w, h; 87 | Source.GetDimensions(w, h); 88 | 89 | uint sy = lerp(id.y, h - 1 - id.y, VFlip); 90 | uint dp1 = sy * w / 2 + id.x * 2; 91 | uint dp2 = sy * w / 4 + id.x + w * h / 2; 92 | 93 | Destination[dp1 + 0] = PackUYVY(uyvy01); 94 | Destination[dp1 + 1] = PackUYVY(uyvy23); 95 | Destination[dp2] = PackAAAA(float4(s0.w, s1.w, s2.w, s3.w)); 96 | } 97 | 98 | // Encoder kernel entry points 99 | 100 | [numthreads(8, 8, 1)] 101 | void EncodeUYVY_sRGB(uint2 id : SV_DispatchThreadID) 102 | { 103 | uint2 sp = id * uint2(2, 1); 104 | float4 s0 = Source[sp + uint2(0, 0)]; 105 | float4 s1 = Source[sp + uint2(1, 0)]; 106 | EncodeUYVY(id, s0, s1); 107 | } 108 | 109 | [numthreads(8, 8, 1)] 110 | void EncodeUYVY_Linear(uint2 id : SV_DispatchThreadID) 111 | { 112 | uint2 sp = id * uint2(2, 1); 113 | float4 s0 = Linear_to_sRGB(Source[sp + uint2(0, 0)]); 114 | float4 s1 = Linear_to_sRGB(Source[sp + uint2(1, 0)]); 115 | EncodeUYVY(id, s0, s1); 116 | } 117 | 118 | [numthreads(4, 8, 1)] 119 | void EncodeUYVA_sRGB(uint2 id : SV_DispatchThreadID) 120 | { 121 | uint2 sp = id * uint2(4, 1); 122 | float4 s0 = Source[sp + uint2(0, 0)]; 123 | float4 s1 = Source[sp + uint2(1, 0)]; 124 | float4 s2 = Source[sp + uint2(2, 0)]; 125 | float4 s3 = Source[sp + uint2(3, 0)]; 126 | EncodeUYVA(id, s0, s1, s2, s3); 127 | } 128 | 129 | [numthreads(4, 8, 1)] 130 | void EncodeUYVA_Linear(uint2 id : SV_DispatchThreadID) 131 | { 132 | uint2 sp = id * uint2(4, 1); 133 | float4 s0 = Linear_to_sRGB(Source[sp + uint2(0, 0)]); 134 | float4 s1 = Linear_to_sRGB(Source[sp + uint2(1, 0)]); 135 | float4 s2 = Linear_to_sRGB(Source[sp + uint2(2, 0)]); 136 | float4 s3 = Linear_to_sRGB(Source[sp + uint2(3, 0)]); 137 | EncodeUYVA(id, s0, s1, s2, s3); 138 | } 139 | -------------------------------------------------------------------------------- /HDRP/Assets/Test.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-7178607461574563689 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 3 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 0d7593b3a9277ac4696b20006c21dde2, type: 3} 13 | m_Name: VisualEnvironment 14 | m_EditorClassIdentifier: 15 | active: 1 16 | m_AdvancedMode: 0 17 | skyType: 18 | m_OverrideState: 1 19 | m_Value: 3 20 | skyAmbientMode: 21 | m_OverrideState: 1 22 | m_Value: 1 23 | fogType: 24 | m_OverrideState: 0 25 | m_Value: 0 26 | --- !u!114 &-1514468785312180580 27 | MonoBehaviour: 28 | m_ObjectHideFlags: 3 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: a81bcacc415a1f743bfdf703afc52027, type: 3} 36 | m_Name: GradientSky 37 | m_EditorClassIdentifier: 38 | active: 1 39 | m_AdvancedMode: 0 40 | rotation: 41 | m_OverrideState: 0 42 | m_Value: 0 43 | min: 0 44 | max: 360 45 | skyIntensityMode: 46 | m_OverrideState: 0 47 | m_Value: 0 48 | exposure: 49 | m_OverrideState: 1 50 | m_Value: 0.6 51 | multiplier: 52 | m_OverrideState: 0 53 | m_Value: 1 54 | min: 0 55 | upperHemisphereLuxValue: 56 | m_OverrideState: 0 57 | m_Value: 1 58 | min: 0 59 | upperHemisphereLuxColor: 60 | m_OverrideState: 0 61 | m_Value: {x: 0, y: 0, z: 0} 62 | desiredLuxValue: 63 | m_OverrideState: 0 64 | m_Value: 20000 65 | updateMode: 66 | m_OverrideState: 0 67 | m_Value: 0 68 | updatePeriod: 69 | m_OverrideState: 0 70 | m_Value: 0 71 | min: 0 72 | includeSunInBaking: 73 | m_OverrideState: 0 74 | m_Value: 0 75 | top: 76 | m_OverrideState: 1 77 | m_Value: {r: 1, g: 1, b: 1, a: 1} 78 | hdr: 1 79 | showAlpha: 0 80 | showEyeDropper: 1 81 | middle: 82 | m_OverrideState: 1 83 | m_Value: {r: 1, g: 1, b: 1, a: 1} 84 | hdr: 1 85 | showAlpha: 0 86 | showEyeDropper: 1 87 | bottom: 88 | m_OverrideState: 1 89 | m_Value: {r: 1, g: 1, b: 1, a: 1} 90 | hdr: 1 91 | showAlpha: 0 92 | showEyeDropper: 1 93 | gradientDiffusion: 94 | m_OverrideState: 0 95 | m_Value: 1 96 | --- !u!114 &11400000 97 | MonoBehaviour: 98 | m_ObjectHideFlags: 0 99 | m_CorrespondingSourceObject: {fileID: 0} 100 | m_PrefabInstance: {fileID: 0} 101 | m_PrefabAsset: {fileID: 0} 102 | m_GameObject: {fileID: 0} 103 | m_Enabled: 1 104 | m_EditorHideFlags: 0 105 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} 106 | m_Name: Test 107 | m_EditorClassIdentifier: 108 | components: 109 | - {fileID: -7178607461574563689} 110 | - {fileID: -1514468785312180580} 111 | - {fileID: 7180736275486333556} 112 | --- !u!114 &7180736275486333556 113 | MonoBehaviour: 114 | m_ObjectHideFlags: 3 115 | m_CorrespondingSourceObject: {fileID: 0} 116 | m_PrefabInstance: {fileID: 0} 117 | m_PrefabAsset: {fileID: 0} 118 | m_GameObject: {fileID: 0} 119 | m_Enabled: 1 120 | m_EditorHideFlags: 0 121 | m_Script: {fileID: 11500000, guid: 9008a067f4d626c4d8bc4bc48f04bb89, type: 3} 122 | m_Name: AmbientOcclusion 123 | m_EditorClassIdentifier: 124 | active: 1 125 | m_AdvancedMode: 0 126 | quality: 127 | m_OverrideState: 0 128 | m_Value: 1 129 | rayTracing: 130 | m_OverrideState: 0 131 | m_Value: 0 132 | intensity: 133 | m_OverrideState: 1 134 | m_Value: 3 135 | min: 0 136 | max: 4 137 | directLightingStrength: 138 | m_OverrideState: 1 139 | m_Value: 1 140 | min: 0 141 | max: 1 142 | radius: 143 | m_OverrideState: 0 144 | m_Value: 2 145 | min: 0.25 146 | max: 5 147 | spatialBilateralAggressiveness: 148 | m_OverrideState: 0 149 | m_Value: 0.15 150 | min: 0 151 | max: 1 152 | temporalAccumulation: 153 | m_OverrideState: 0 154 | m_Value: 1 155 | ghostingReduction: 156 | m_OverrideState: 0 157 | m_Value: 0.5 158 | min: 0 159 | max: 1 160 | blurSharpness: 161 | m_OverrideState: 0 162 | m_Value: 0.1 163 | min: 0 164 | max: 1 165 | layerMask: 166 | m_OverrideState: 0 167 | m_Value: 168 | serializedVersion: 2 169 | m_Bits: 4294967295 170 | m_StepCount: 171 | m_OverrideState: 0 172 | m_Value: 6 173 | min: 2 174 | max: 32 175 | m_FullResolution: 176 | m_OverrideState: 0 177 | m_Value: 0 178 | m_MaximumRadiusInPixels: 179 | m_OverrideState: 0 180 | m_Value: 40 181 | min: 16 182 | max: 256 183 | m_BilateralUpsample: 184 | m_OverrideState: 0 185 | m_Value: 1 186 | m_DirectionCount: 187 | m_OverrideState: 0 188 | m_Value: 2 189 | min: 1 190 | max: 6 191 | m_RayLength: 192 | m_OverrideState: 0 193 | m_Value: 3 194 | min: 0 195 | m_SampleCount: 196 | m_OverrideState: 0 197 | m_Value: 2 198 | min: 1 199 | max: 64 200 | m_Denoise: 201 | m_OverrideState: 0 202 | m_Value: 1 203 | m_DenoiserRadius: 204 | m_OverrideState: 0 205 | m_Value: 0.5 206 | min: 0.001 207 | max: 1 208 | -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/Runtime/Internal/ReadbackPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using Unity.Collections; 5 | using Unity.Collections.LowLevel.Unsafe; 6 | using UnityEngine; 7 | using UnityEngine.Rendering; 8 | 9 | namespace Klak.Ndi { 10 | 11 | // 12 | // Frame readback entry class 13 | // 14 | // Stores information about single-frame readback. 15 | // 16 | // We need this class because: 17 | // - Async GPU readback requires a NativeArray as a destination. 18 | // - A readback request only carries a data pointer; We have to store other 19 | // information (dimensions, metadata, etc.) elsewhere. 20 | // 21 | // This class is reusable; You can call Allocate after Deallocate. 22 | // 23 | sealed class ReadbackEntry 24 | { 25 | #region Private members 26 | 27 | NativeArray _image; 28 | IntPtr _metadata; 29 | int _width, _height; 30 | bool _alpha; 31 | 32 | ~ReadbackEntry() 33 | { 34 | if (_image.IsCreated) 35 | Debug.LogWarning("ReadbackEntry leakage was detected."); 36 | } 37 | 38 | #endregion 39 | 40 | #region Public accessors 41 | 42 | public int Width => _width; 43 | public int Stride => _width * 2; 44 | public int Height => _height; 45 | 46 | public IntPtr MetadataPointer => _metadata; 47 | public unsafe IntPtr ImagePointer 48 | => (IntPtr)NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(_image); 49 | 50 | public Interop.FourCC FourCC 51 | => _alpha ? Interop.FourCC.UYVA : Interop.FourCC.UYVY; 52 | 53 | #endregion 54 | 55 | #region Resource allocation/deallocation 56 | 57 | public void Allocate(int width, int height, bool alpha, string metadata) 58 | { 59 | // Image buffer 60 | _image = new NativeArray 61 | (Util.FrameDataSize(width, height, alpha), 62 | Allocator.Persistent, NativeArrayOptions.UninitializedMemory); 63 | 64 | // Metadata string on heap 65 | if (string.IsNullOrEmpty(metadata)) 66 | _metadata = IntPtr.Zero; 67 | else 68 | _metadata = Marshal.StringToHGlobalAnsi(metadata); 69 | 70 | // Frame settings 71 | (_width, _height, _alpha) = (width, height, alpha); 72 | } 73 | 74 | public void Deallocate() 75 | { 76 | if (_image.IsCreated) 77 | { 78 | _image.Dispose(); 79 | _image = default(NativeArray); 80 | } 81 | 82 | if (_metadata != IntPtr.Zero) 83 | { 84 | Marshal.FreeHGlobal(_metadata); 85 | _metadata = IntPtr.Zero; 86 | } 87 | 88 | (_width, _height, _alpha) = (0, 0, false); 89 | } 90 | 91 | #endregion 92 | 93 | #region Readback request initiators 94 | 95 | public void RequestReadback 96 | (ComputeBuffer source, Action callback) 97 | => AsyncGPUReadback.RequestIntoNativeArray(ref _image, source, callback); 98 | 99 | public void RequestReadback 100 | (CommandBuffer command, ComputeBuffer source, Action callback) 101 | => command.RequestAsyncReadbackIntoNativeArray(ref _image, source, callback); 102 | 103 | #endregion 104 | } 105 | 106 | // 107 | // Frame readback pool class 108 | // 109 | // Stores ongoing readback entries (hot) and recycled entries (cold). 110 | // 111 | // There is a tricky part: The "Marked" entry holds an entry that has been 112 | // completed but still under processing by the NDI async sender. It's expected 113 | // to be freed in the next frame by calling FreeMarked. 114 | // 115 | sealed class ReadbackPool : IDisposable 116 | { 117 | #region Private members 118 | 119 | List _hot = new List(); 120 | Stack _cold = new Stack(); 121 | ReadbackEntry _marked; 122 | 123 | #endregion 124 | 125 | #region IDisposable implementation 126 | 127 | public void Dispose() 128 | { 129 | foreach (var e in _hot ) e.Deallocate(); 130 | foreach (var e in _cold) e.Deallocate(); 131 | _hot .Clear(); 132 | _cold.Clear(); 133 | } 134 | 135 | #endregion 136 | 137 | #region Pool operations 138 | 139 | public ReadbackEntry 140 | NewEntry(int width, int height, bool alpha, string metadata) 141 | { 142 | var entry = _cold.Count > 0 ? _cold.Pop() : new ReadbackEntry(); 143 | entry.Allocate(width, height, alpha, metadata); 144 | _hot.Add(entry); 145 | return entry; 146 | } 147 | 148 | public void Free(ReadbackEntry entry) 149 | { 150 | entry.Deallocate(); 151 | _hot.Remove(entry); 152 | _cold.Push(entry); 153 | } 154 | 155 | public unsafe ReadbackEntry FindEntry(in NativeArray buffer) 156 | { 157 | var p = (IntPtr)NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(buffer); 158 | foreach (var entry in _hot) if (entry.ImagePointer == p) return entry; 159 | return null; 160 | } 161 | 162 | public void Mark(ReadbackEntry entry) 163 | { 164 | Debug.Assert(_marked == null, "Marked twice."); 165 | _marked = entry; 166 | } 167 | 168 | public void FreeMarkedEntry() 169 | { 170 | if (_marked == null) return; 171 | Free(_marked); 172 | _marked = null; 173 | } 174 | 175 | #endregion 176 | } 177 | 178 | } // namespace Klak.Ndi 179 | -------------------------------------------------------------------------------- /HDRP/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.render-pipelines.core": { 4 | "version": "10.6.0", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.ugui": "1.0.0" 9 | }, 10 | "url": "https://packages.unity.com" 11 | }, 12 | "com.unity.render-pipelines.high-definition": { 13 | "version": "10.6.0", 14 | "depth": 0, 15 | "source": "registry", 16 | "dependencies": { 17 | "com.unity.render-pipelines.core": "10.6.0", 18 | "com.unity.shadergraph": "10.6.0", 19 | "com.unity.visualeffectgraph": "10.6.0", 20 | "com.unity.render-pipelines.high-definition-config": "10.6.0" 21 | }, 22 | "url": "https://packages.unity.com" 23 | }, 24 | "com.unity.render-pipelines.high-definition-config": { 25 | "version": "10.6.0", 26 | "depth": 1, 27 | "source": "registry", 28 | "dependencies": { 29 | "com.unity.render-pipelines.core": "10.6.0" 30 | }, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.searcher": { 34 | "version": "4.3.2", 35 | "depth": 2, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.shadergraph": { 41 | "version": "10.6.0", 42 | "depth": 1, 43 | "source": "registry", 44 | "dependencies": { 45 | "com.unity.render-pipelines.core": "10.6.0", 46 | "com.unity.searcher": "4.3.2" 47 | }, 48 | "url": "https://packages.unity.com" 49 | }, 50 | "com.unity.ugui": { 51 | "version": "1.0.0", 52 | "depth": 0, 53 | "source": "builtin", 54 | "dependencies": { 55 | "com.unity.modules.ui": "1.0.0", 56 | "com.unity.modules.imgui": "1.0.0" 57 | } 58 | }, 59 | "com.unity.visualeffectgraph": { 60 | "version": "10.6.0", 61 | "depth": 1, 62 | "source": "registry", 63 | "dependencies": { 64 | "com.unity.shadergraph": "10.6.0", 65 | "com.unity.render-pipelines.core": "10.6.0" 66 | }, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "jp.keijiro.klak.ndi": { 70 | "version": "file:../../jp.keijiro.klak.ndi", 71 | "depth": 0, 72 | "source": "local", 73 | "dependencies": { 74 | "com.unity.modules.screencapture": "1.0.0" 75 | } 76 | }, 77 | "org.nuget.system.buffers": { 78 | "version": "4.4.0", 79 | "depth": 1, 80 | "source": "registry", 81 | "dependencies": {}, 82 | "url": "https://unitynuget-registry.azurewebsites.net" 83 | }, 84 | "org.nuget.system.memory": { 85 | "version": "4.5.3", 86 | "depth": 0, 87 | "source": "registry", 88 | "dependencies": { 89 | "org.nuget.system.buffers": "4.4.0", 90 | "org.nuget.system.numerics.vectors": "4.4.0", 91 | "org.nuget.system.runtime.compilerservices.unsafe": "4.5.2" 92 | }, 93 | "url": "https://unitynuget-registry.azurewebsites.net" 94 | }, 95 | "org.nuget.system.numerics.vectors": { 96 | "version": "4.4.0", 97 | "depth": 1, 98 | "source": "registry", 99 | "dependencies": {}, 100 | "url": "https://unitynuget-registry.azurewebsites.net" 101 | }, 102 | "org.nuget.system.runtime.compilerservices.unsafe": { 103 | "version": "4.5.2", 104 | "depth": 1, 105 | "source": "registry", 106 | "dependencies": {}, 107 | "url": "https://unitynuget-registry.azurewebsites.net" 108 | }, 109 | "com.unity.modules.animation": { 110 | "version": "1.0.0", 111 | "depth": 0, 112 | "source": "builtin", 113 | "dependencies": {} 114 | }, 115 | "com.unity.modules.audio": { 116 | "version": "1.0.0", 117 | "depth": 1, 118 | "source": "builtin", 119 | "dependencies": {} 120 | }, 121 | "com.unity.modules.imageconversion": { 122 | "version": "1.0.0", 123 | "depth": 0, 124 | "source": "builtin", 125 | "dependencies": {} 126 | }, 127 | "com.unity.modules.imgui": { 128 | "version": "1.0.0", 129 | "depth": 1, 130 | "source": "builtin", 131 | "dependencies": {} 132 | }, 133 | "com.unity.modules.jsonserialize": { 134 | "version": "1.0.0", 135 | "depth": 0, 136 | "source": "builtin", 137 | "dependencies": {} 138 | }, 139 | "com.unity.modules.physics": { 140 | "version": "1.0.0", 141 | "depth": 0, 142 | "source": "builtin", 143 | "dependencies": {} 144 | }, 145 | "com.unity.modules.screencapture": { 146 | "version": "1.0.0", 147 | "depth": 1, 148 | "source": "builtin", 149 | "dependencies": { 150 | "com.unity.modules.imageconversion": "1.0.0" 151 | } 152 | }, 153 | "com.unity.modules.ui": { 154 | "version": "1.0.0", 155 | "depth": 1, 156 | "source": "builtin", 157 | "dependencies": {} 158 | }, 159 | "com.unity.modules.unitywebrequest": { 160 | "version": "1.0.0", 161 | "depth": 1, 162 | "source": "builtin", 163 | "dependencies": {} 164 | }, 165 | "com.unity.modules.video": { 166 | "version": "1.0.0", 167 | "depth": 0, 168 | "source": "builtin", 169 | "dependencies": { 170 | "com.unity.modules.audio": "1.0.0", 171 | "com.unity.modules.ui": "1.0.0", 172 | "com.unity.modules.unitywebrequest": "1.0.0" 173 | } 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /HDRP/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 | } -------------------------------------------------------------------------------- /URP/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 | } -------------------------------------------------------------------------------- /jp.keijiro.klak.ndi/README.md: -------------------------------------------------------------------------------- 1 | KlakNDI 2 | ======= 3 | 4 | ![gif](https://i.imgur.com/I1ZMSY8.gif) 5 | 6 | **KlakNDI** is a Unity plugin that allows sending/receiving video streams 7 | between several devices using [NDI]®. 8 | 9 | [NDI]® (Network Device Interface) is a standard developed by [NewTek], Inc that 10 | enables applications to deliver video streams via a local area network. Please 11 | refer to [ndi.tv][NDI] for further information about the technology. 12 | 13 | [NDI]: https://www.ndi.tv/ 14 | [NewTek]: https://www.newtek.com/ 15 | 16 | System Requirements 17 | ------------------- 18 | 19 | - Unity 2019.4 20 | - .NET Standard 2.0 or 2.1 21 | 22 | Desktop platforms: 23 | 24 | - Windows: x64, D3D11/D3D12 25 | - macOS: x64 or arm64 (M1), Metal 26 | - Linux: x64, Vulkan 27 | 28 | Mobile platforms: 29 | 30 | - iOS: arm64, Metal 31 | - Android: arm64, Vulkan 32 | 33 | KlakNDI runs without the NDI SDK on most supported platforms, but only the iOS 34 | platform requires the SDK to build on Xcode. Please download and install the NDI 35 | Advanced SDK for iOS in advance of building. 36 | 37 | Known Issues and Limitations 38 | ---------------------------- 39 | 40 | - At the moment, KlakNDI doesn't run on Unity 2021.2/2022.1 with HDRP due to the 41 | [Searcher package issue]. Wait for the fix to the Searcher package. 42 | 43 | [Searcher package issue]: 44 | https://forum.unity.com/threads/2021-2-0b6-and-system-memory-readonlyspan-under-net-4-8.1152104/ 45 | 46 | - Dimensions of frame images should be multiples of 16x8. This limitation causes 47 | glitches on several mobile devices when using the Game View capture method. 48 | 49 | - KlakNDI doesn't support audio streaming. There are several technical 50 | difficulties to implement without perceptible noise or delay, so there is no 51 | plan to implement it. 52 | 53 | How To Install 54 | -------------- 55 | 56 | This package uses the [scoped registry] feature to resolve package 57 | dependencies. Add the following lines to the manifest file 58 | (`Packages/manifest.json`). 59 | 60 | [scoped registry]: https://docs.unity3d.com/Manual/upm-scoped.html 61 | 62 |
63 | .NET Standard 2.0 (Unity 2021.1 or earlier) 64 | 65 | To the `scopedRegistries` section: 66 | 67 | ``` 68 | { 69 | "name": "Unity NuGet", 70 | "url": "https://unitynuget-registry.azurewebsites.net", 71 | "scopes": [ "org.nuget" ] 72 | }, 73 | { 74 | "name": "Keijiro", 75 | "url": "https://registry.npmjs.com", 76 | "scopes": [ "jp.keijiro" ] 77 | } 78 | ``` 79 | 80 | To the `dependencies` section: 81 | 82 | ``` 83 | "org.nuget.system.memory": "4.5.3", 84 | "jp.keijiro.klak.ndi": "2.0.0" 85 | ``` 86 | 87 | After the changes, the manifest file should look like: 88 | 89 | ``` 90 | { 91 | "scopedRegistries": [ 92 | { 93 | "name": "Unity NuGet", 94 | "url": "https://unitynuget-registry.azurewebsites.net", 95 | "scopes": [ "org.nuget" ] 96 | }, 97 | { 98 | "name": "Keijiro", 99 | "url": "https://registry.npmjs.com", 100 | "scopes": [ "jp.keijiro" ] 101 | } 102 | ], 103 | "dependencies": { 104 | "org.nuget.system.memory": "4.5.3", 105 | "jp.keijiro.klak.ndi": "2.0.0", 106 | ... 107 | ``` 108 |
109 | 110 |
111 | .NET Standard 2.1 (Unity 2021.2 or later) 112 | 113 | To the `scopedRegistries` section: 114 | 115 | ``` 116 | { 117 | "name": "Keijiro", 118 | "url": "https://registry.npmjs.com", 119 | "scopes": [ "jp.keijiro" ] 120 | } 121 | ``` 122 | 123 | To the `dependencies` section: 124 | 125 | ``` 126 | "jp.keijiro.klak.ndi": "2.0.0" 127 | ``` 128 | 129 | After the changes, the manifest file should look like: 130 | 131 | ``` 132 | { 133 | "scopedRegistries": [ 134 | { 135 | "name": "Keijiro", 136 | "url": "https://registry.npmjs.com", 137 | "scopes": [ "jp.keijiro" ] 138 | } 139 | ], 140 | "dependencies": { 141 | "jp.keijiro.klak.ndi": "2.0.0", 142 | ... 143 | ``` 144 |
145 | 146 | NDI Sender Component 147 | -------------------- 148 | 149 | ![screenshot](https://i.imgur.com/kUnWqeZ.png) 150 | 151 | The **NDI Sender** component (`NdiSender`) sends a video stream from a given 152 | video source. 153 | 154 | **NDI Name** - Specify the name of the NDI endpoint (only available in the 155 | Camera/Texture capture method). 156 | 157 | **Keep Alpha** - Enable this checkbox to make the stream contain the alpha 158 | channel. You can disable it to reduce the bandwidth. 159 | 160 | **Capture Method** - Specify how to capture the video source from the following 161 | options: 162 | 163 | - Game View - The sender captures frames from the Game View. 164 | - Camera - The sender captures frames from a given camera. This method only 165 | supports URP and HDRP. 166 | - Texture - The sender captures frames from a texture asset. You can also use 167 | a render texture with this option. 168 | 169 | You can attach metadata using the C# `.metadata` property. 170 | 171 | NDI Receiver Component 172 | ---------------------- 173 | 174 | ![screenshot](https://i.imgur.com/UmCvOK6.png) 175 | 176 | The **NDI Receiver** component (`NdiReceiver`) receives a video stream and 177 | feeds it to a renderer object or a render texture asset. 178 | 179 | **NDI Name** - Specify the name of the NDI source. You can edit the text field 180 | or use the selector to choose a name from currently available NDI sources. 181 | 182 | **Target Texture** - The receiver copies the received frames into this render 183 | texture asset. 184 | 185 | **Target Renderer** - The receiver overrides a texture property of the given 186 | renderer. 187 | 188 | You can extract metadata using the C# `.metadata` property. 189 | 190 | Tips for Scripting 191 | ------------------ 192 | 193 | You can enumerate currently available NDI sources using the NDI Finder class 194 | (`NdiFinder`). See the [Source Selector] example for usage. 195 | 196 | [Source Selector]: URP/Assets/Script/SourceSelector.cs 197 | 198 | You can instantiate the NDI Sender/Receiver component from a script but at 199 | the same time, you have to set an NDI Resources asset (`NdiResources.asset`). 200 | See the [Sender Benchmark]/[Receiver Benchmark] examples for details. 201 | 202 | [Sender Benchmark]: URP/Assets/Script/SenderBenchmark.cs 203 | [Receiver Benchmark]: URP/Assets/Script/ReceiverBenchmark.cs 204 | --------------------------------------------------------------------------------