├── .gitignore ├── Assets ├── FrameCapturerPackaging.cs ├── FrameCapturerPackaging.cs.meta ├── ML-Agents.meta └── ML-Agents │ ├── Academy.cs │ ├── Academy.cs.meta │ ├── VideoRecorder.meta │ └── VideoRecorder │ ├── Editor.meta │ ├── Editor │ ├── Misc.meta │ ├── Misc │ │ ├── BoolDrawer.cs │ │ ├── BoolDrawer.cs.meta │ │ ├── DataPathDrawer.cs │ │ └── DataPathDrawer.cs.meta │ ├── MovieRecorderEditor.cs │ ├── MovieRecorderEditor.cs.meta │ ├── VideoRecorderEditor.cs │ └── VideoRecorderEditor.cs.meta │ ├── Plugins.meta │ ├── Plugins │ ├── x86.meta │ ├── x86 │ │ └── fccore.dll.meta │ ├── x86_64.meta │ └── x86_64 │ │ ├── fccore.bundle.meta │ │ └── fccore.dll.meta │ ├── Scripts.meta │ ├── Scripts │ ├── Encoder.meta │ ├── Encoder │ │ ├── AudioEncoder.cs │ │ ├── AudioEncoder.cs.meta │ │ ├── EncoderBase.cs │ │ ├── EncoderBase.cs.meta │ │ ├── ExrEncoder.cs │ │ ├── ExrEncoder.cs.meta │ │ ├── FlacEncoder.cs │ │ ├── FlacEncoder.cs.meta │ │ ├── GifEncoder.cs │ │ ├── GifEncoder.cs.meta │ │ ├── MP4Encoder.cs │ │ ├── MP4Encoder.cs.meta │ │ ├── MovieEncoder.cs │ │ ├── MovieEncoder.cs.meta │ │ ├── OggEncoder.cs │ │ ├── OggEncoder.cs.meta │ │ ├── PngEncoder.cs │ │ ├── PngEncoder.cs.meta │ │ ├── WaveEncoder.cs │ │ ├── WaveEncoder.cs.meta │ │ ├── WebMEncoder.cs │ │ ├── WebMEncoder.cs.meta │ │ ├── fcAPI.cs │ │ └── fcAPI.cs.meta │ ├── Misc.meta │ ├── Misc │ │ ├── Bool.cs │ │ ├── Bool.cs.meta │ │ ├── DataPath.cs │ │ └── DataPath.cs.meta │ ├── MovieRecorder.cs │ ├── MovieRecorder.cs.meta │ ├── RecorderBase.cs │ ├── RecorderBase.cs.meta │ ├── VideoRecorder.cs │ └── VideoRecorder.cs.meta │ ├── Shaders.meta │ └── Shaders │ ├── CopyFrameBuffer.shader │ └── CopyFrameBuffer.shader.meta ├── Images └── VideoRecorder.png ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── VideoRecorder.unitypackage /.gitignore: -------------------------------------------------------------------------------- 1 | *.ipch 2 | *.sdf 3 | *.opendb 4 | *.db 5 | *.user 6 | *.log 7 | *.tlog 8 | 9 | *.exe 10 | *.dll 11 | *.bundle 12 | *.dylib 13 | *.so 14 | *.exr 15 | *.gif 16 | *.mp4 17 | *.h264 18 | *.aac 19 | *.webm 20 | *.ogg 21 | *.flac 22 | *.wav 23 | 24 | .vs/ 25 | .vscode/ 26 | _out/ 27 | _tmp/ 28 | _build_*/ 29 | external/ 30 | Library/ 31 | obj/ 32 | Temp/ 33 | 34 | *.csproj 35 | *.sln 36 | -------------------------------------------------------------------------------- /Assets/FrameCapturerPackaging.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using UnityEditor; 3 | 4 | 5 | public class FrameCapturerPackaging 6 | { 7 | [MenuItem("Assets/Make .unitypackage")] 8 | public static void MakePackage() 9 | { 10 | { 11 | string[] files = new string[] 12 | { 13 | "Assets/ML-Agents/VideoRecorder", 14 | }; 15 | AssetDatabase.ExportPackage(files, "VideoRecorder.unitypackage", ExportPackageOptions.Recurse); 16 | } 17 | } 18 | 19 | } 20 | #endif // UNITY_EDITOR 21 | -------------------------------------------------------------------------------- /Assets/FrameCapturerPackaging.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b7d23564374916438511a411a366bf2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ML-Agents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bb34a1bfbbe245479c690ce011657ad 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ML-Agents/Academy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MLAgents 6 | { 7 | public class Academy : MonoBehaviour 8 | { 9 | 10 | public int GetTotalStepCount(){ 11 | return 0; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/Academy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c488580140e0ae64f92a8b1294ded982 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d9f87adc6f22a9478d2bd5c48ff30e5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e8066324c8ba02488f823792218ad75 3 | folderAsset: yes 4 | timeCreated: 1493972568 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7cbd21b9490d0e4d9f828a4595c1f00 3 | folderAsset: yes 4 | timeCreated: 1494004663 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/Misc/BoolDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace UTJ.FrameCapturer 5 | { 6 | [CustomPropertyDrawer(typeof(Bool))] 7 | class BoolDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | EditorGUI.BeginProperty(position, label, property); 12 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 13 | 14 | var indent = EditorGUI.indentLevel; 15 | EditorGUI.indentLevel = 0; 16 | 17 | var p = property.FindPropertyRelative("v"); 18 | bool value = p.intValue != 0; 19 | 20 | EditorGUI.BeginChangeCheck(); 21 | value = EditorGUI.Toggle(position, value); 22 | if (EditorGUI.EndChangeCheck()) 23 | { 24 | p.intValue = value ? 1 : 0; 25 | } 26 | 27 | EditorGUI.indentLevel = indent; 28 | EditorGUI.EndProperty(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/Misc/BoolDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7234308adeab3d419817de7e29c50f1 3 | timeCreated: 1494004664 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/Misc/DataPathDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace UTJ.FrameCapturer 5 | { 6 | [CustomPropertyDrawer(typeof(DataPath))] 7 | class DataPathDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | bool ro = property.FindPropertyRelative("m_readOnly").boolValue; 12 | if(ro) { EditorGUI.BeginDisabledGroup(true); } 13 | 14 | EditorGUI.BeginProperty(position, label, property); 15 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 16 | 17 | var indent = EditorGUI.indentLevel; 18 | EditorGUI.indentLevel = 0; 19 | 20 | float buttonWidth = 22; 21 | float rootWidth = 70; 22 | float leafWidth = position.width - rootWidth - 5 - buttonWidth; 23 | var rootRect = new Rect(position.x, position.y, rootWidth, position.height); 24 | var leafRect = new Rect(position.x + rootWidth + 5, position.y, leafWidth, position.height); 25 | var buttonRect = new Rect(position.x + rootWidth + 5 + leafWidth, position.y, buttonWidth, position.height); 26 | 27 | var pRoot = property.FindPropertyRelative("m_root"); 28 | var pLeaf = property.FindPropertyRelative("m_leaf"); 29 | EditorGUI.PropertyField(rootRect, pRoot, GUIContent.none); 30 | EditorGUI.PropertyField(leafRect, pLeaf, GUIContent.none); 31 | if (GUI.Button(buttonRect, "...")) 32 | { 33 | var tmp = new DataPath((DataPath.Root)pRoot.intValue, pLeaf.stringValue); 34 | var path = EditorUtility.OpenFolderPanel("Select Directory", tmp.GetFullPath(), ""); 35 | if (path.Length > 0) 36 | { 37 | var newPath = new DataPath(path); 38 | pRoot.intValue = (int)newPath.root; 39 | pLeaf.stringValue = newPath.leaf; 40 | } 41 | } 42 | 43 | EditorGUI.indentLevel = indent; 44 | EditorGUI.EndProperty(); 45 | 46 | if (ro) { EditorGUI.EndDisabledGroup(); } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/Misc/DataPathDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2c8844522598244c853bbfcb74cf8ac 3 | timeCreated: 1494004664 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/MovieRecorderEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | [CustomEditor(typeof(MovieRecorder))] 8 | public class MovieRecorderEditor : Editor 9 | { 10 | public override void OnInspectorGUI() 11 | { 12 | var so = serializedObject; 13 | so.ApplyModifiedProperties(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/MovieRecorderEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16bccb8f58e67a348b23389b312ec2d6 3 | timeCreated: 1493972568 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/VideoRecorderEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | using UTJ.FrameCapturer; 5 | 6 | namespace MLAgents 7 | { 8 | [CustomEditor(typeof(VideoRecorder))] 9 | public class VideoRecorderEditor : Editor 10 | { 11 | 12 | 13 | public virtual void AudioConfig() 14 | { 15 | } 16 | 17 | public override void OnInspectorGUI() 18 | { 19 | //DrawDefaultInspector(); 20 | 21 | var recorder = target as VideoRecorder; 22 | var so = serializedObject; 23 | EditorGUILayout.PropertyField(so.FindProperty("outputDirectory"), true); 24 | 25 | EditorGUILayout.PropertyField(so.FindProperty("durationUnit"), true); 26 | EditorGUI.indentLevel++; 27 | EditorGUILayout.PropertyField(so.FindProperty("interval"), true); 28 | EditorGUILayout.PropertyField(so.FindProperty("duration"), true); 29 | EditorGUI.indentLevel--; 30 | 31 | EditorGUILayout.PropertyField(so.FindProperty("recordInRealtime"), true); 32 | if (recorder.duration > recorder.interval) 33 | { 34 | EditorGUILayout.HelpBox("The Duration of the video shouldn't be longer than the Interval !", MessageType.Error); 35 | } 36 | 37 | EditorGUILayout.PropertyField(so.FindProperty("resolutionWidth")); 38 | EditorGUILayout.PropertyField(so.FindProperty("resolutionHeight")); 39 | EditorGUILayout.PropertyField(so.FindProperty("captureAudio")); 40 | EditorGUILayout.PropertyField(so.FindProperty("verbose")); 41 | so.ApplyModifiedProperties(); 42 | } 43 | 44 | [MenuItem("GameObject/Create Recording Camera")] 45 | public static void AddRecordingCamera() 46 | { 47 | GameObject recordingCamera = GameObject.Instantiate(Camera.main.gameObject); 48 | recordingCamera.name = "Recording Camera"; 49 | recordingCamera.tag = "Untagged"; 50 | recordingCamera.AddComponent(); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Editor/VideoRecorderEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 073591fb552bab44bae48b42c30feea9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178d677034729554ba412d8026f03471 3 | folderAsset: yes 4 | timeCreated: 1432793503 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6a99610875e99f4a86c25c0d98826fb 3 | folderAsset: yes 4 | timeCreated: 1433034131 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins/x86/fccore.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af2eb4260adfc8648ace36d39d74522f 3 | timeCreated: 1493911880 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Editor: 0 19 | Exclude Linux: 0 20 | Exclude Linux64: 0 21 | Exclude LinuxUniversal: 0 22 | Exclude OSXIntel: 0 23 | Exclude OSXIntel64: 0 24 | Exclude OSXUniversal: 0 25 | Exclude Win: 0 26 | Exclude Win64: 1 27 | data: 28 | first: 29 | '': Editor 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: x86 34 | OS: Windows 35 | data: 36 | first: 37 | Any: 38 | second: 39 | enabled: 1 40 | settings: {} 41 | data: 42 | first: 43 | Editor: Editor 44 | second: 45 | enabled: 1 46 | settings: 47 | CPU: x86 48 | DefaultValueInitialized: true 49 | data: 50 | first: 51 | Facebook: Win 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: AnyCPU 56 | data: 57 | first: 58 | Facebook: Win64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | data: 64 | first: 65 | Standalone: Linux 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86 70 | data: 71 | first: 72 | Standalone: Linux64 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: None 77 | data: 78 | first: 79 | Standalone: LinuxUniversal 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: AnyCPU 84 | data: 85 | first: 86 | Standalone: OSXIntel 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: AnyCPU 91 | data: 92 | first: 93 | Standalone: OSXIntel64 94 | second: 95 | enabled: 1 96 | settings: 97 | CPU: None 98 | data: 99 | first: 100 | Standalone: OSXUniversal 101 | second: 102 | enabled: 1 103 | settings: 104 | CPU: AnyCPU 105 | data: 106 | first: 107 | Standalone: Win 108 | second: 109 | enabled: 1 110 | settings: 111 | CPU: AnyCPU 112 | data: 113 | first: 114 | Standalone: Win64 115 | second: 116 | enabled: 0 117 | settings: 118 | CPU: None 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb423a2251dfbf04488bb95a0f1ec0e1 3 | folderAsset: yes 4 | timeCreated: 1432793511 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins/x86_64/fccore.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 095a7aaa840de2c40b28e8f46c6527bd 3 | folderAsset: yes 4 | timeCreated: 1494431117 5 | licenseType: Pro 6 | PluginImporter: 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | data: 14 | first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux: 0 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXIntel: 1 24 | Exclude OSXIntel64: 0 25 | Exclude OSXUniversal: 0 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | data: 29 | first: 30 | Any: 31 | second: 32 | enabled: 1 33 | settings: {} 34 | data: 35 | first: 36 | Editor: Editor 37 | second: 38 | enabled: 1 39 | settings: 40 | CPU: x86_64 41 | DefaultValueInitialized: true 42 | OS: OSX 43 | data: 44 | first: 45 | Facebook: Win 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | data: 51 | first: 52 | Facebook: Win64 53 | second: 54 | enabled: 1 55 | settings: 56 | CPU: AnyCPU 57 | data: 58 | first: 59 | Standalone: Linux 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: None 64 | data: 65 | first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: x86_64 71 | data: 72 | first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 1 76 | settings: 77 | CPU: AnyCPU 78 | data: 79 | first: 80 | Standalone: OSXIntel 81 | second: 82 | enabled: 0 83 | settings: 84 | CPU: None 85 | data: 86 | first: 87 | Standalone: OSXIntel64 88 | second: 89 | enabled: 1 90 | settings: 91 | CPU: AnyCPU 92 | data: 93 | first: 94 | Standalone: OSXUniversal 95 | second: 96 | enabled: 1 97 | settings: 98 | CPU: x86_64 99 | data: 100 | first: 101 | Standalone: Win 102 | second: 103 | enabled: 1 104 | settings: 105 | CPU: None 106 | data: 107 | first: 108 | Standalone: Win64 109 | second: 110 | enabled: 1 111 | settings: 112 | CPU: AnyCPU 113 | userData: 114 | assetBundleName: 115 | assetBundleVariant: 116 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Plugins/x86_64/fccore.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dfc932324fbf314586b61e5e846c01c 3 | timeCreated: 1494024139 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Editor: 0 19 | Exclude Linux: 0 20 | Exclude Linux64: 0 21 | Exclude LinuxUniversal: 0 22 | Exclude OSXIntel: 0 23 | Exclude OSXIntel64: 0 24 | Exclude OSXUniversal: 0 25 | Exclude Win: 1 26 | Exclude Win64: 0 27 | data: 28 | first: 29 | '': Editor 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: x86_64 34 | OS: Windows 35 | data: 36 | first: 37 | Any: 38 | second: 39 | enabled: 1 40 | settings: {} 41 | data: 42 | first: 43 | Editor: Editor 44 | second: 45 | enabled: 1 46 | settings: 47 | CPU: x86_64 48 | DefaultValueInitialized: true 49 | data: 50 | first: 51 | Facebook: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | data: 57 | first: 58 | Facebook: Win64 59 | second: 60 | enabled: 1 61 | settings: 62 | CPU: AnyCPU 63 | data: 64 | first: 65 | Standalone: Linux 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: None 70 | data: 71 | first: 72 | Standalone: Linux64 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: x86_64 77 | data: 78 | first: 79 | Standalone: LinuxUniversal 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: AnyCPU 84 | data: 85 | first: 86 | Standalone: OSXIntel 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: None 91 | data: 92 | first: 93 | Standalone: OSXIntel64 94 | second: 95 | enabled: 1 96 | settings: 97 | CPU: AnyCPU 98 | data: 99 | first: 100 | Standalone: OSXUniversal 101 | second: 102 | enabled: 1 103 | settings: 104 | CPU: AnyCPU 105 | data: 106 | first: 107 | Standalone: Win 108 | second: 109 | enabled: 0 110 | settings: 111 | CPU: None 112 | data: 113 | first: 114 | Standalone: Win64 115 | second: 116 | enabled: 1 117 | settings: 118 | CPU: AnyCPU 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2eb1eb6bf0605b8469d2d383642f1fe4 3 | folderAsset: yes 4 | timeCreated: 1432793494 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fde401d160f133842addfb7db5ae4c97 3 | folderAsset: yes 4 | timeCreated: 1494318897 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/AudioEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | 6 | 7 | namespace UTJ.FrameCapturer 8 | { 9 | [Serializable] 10 | public class AudioEncoderConfigs 11 | { 12 | public AudioEncoder.Type format = AudioEncoder.Type.Flac; 13 | public fcAPI.fcWaveConfig waveEncoderSettings = fcAPI.fcWaveConfig.default_value; 14 | public fcAPI.fcOggConfig oggEncoderSettings = fcAPI.fcOggConfig.default_value; 15 | public fcAPI.fcFlacConfig flacEncoderSettings = fcAPI.fcFlacConfig.default_value; 16 | 17 | public void Setup() 18 | { 19 | } 20 | } 21 | 22 | public abstract class AudioEncoder : EncoderBase 23 | { 24 | public enum Type 25 | { 26 | Wave, 27 | Ogg, 28 | Flac, 29 | } 30 | static public Type[] GetAvailableEncoderTypes() 31 | { 32 | var ret = new List(); 33 | if (fcAPI.fcWaveIsSupported()) { ret.Add(Type.Wave); } 34 | if (fcAPI.fcOggIsSupported()) { ret.Add(Type.Ogg); } 35 | if (fcAPI.fcFlacIsSupported()) { ret.Add(Type.Flac); } 36 | return ret.ToArray(); 37 | } 38 | 39 | 40 | public abstract Type type { get; } 41 | 42 | // config: config struct (fcGifConfig, fcWebMConfig, etc) 43 | public abstract void Initialize(object config, string outPath); 44 | public abstract void AddAudioSamples(float[] samples); 45 | 46 | 47 | public static AudioEncoder Create(Type t) 48 | { 49 | switch (t) 50 | { 51 | case Type.Wave: return new WaveEncoder(); 52 | case Type.Ogg: return new OggEncoder(); 53 | case Type.Flac: return new FlacEncoder(); 54 | } 55 | return null; 56 | } 57 | 58 | public static AudioEncoder Create(AudioEncoderConfigs c, string path) 59 | { 60 | var ret = Create(c.format); 61 | switch (c.format) 62 | { 63 | case Type.Wave: ret.Initialize(c.waveEncoderSettings, path); break; 64 | case Type.Ogg: ret.Initialize(c.oggEncoderSettings, path); break; 65 | case Type.Flac: ret.Initialize(c.flacEncoderSettings, path); break; 66 | } 67 | return ret; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/AudioEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a237ca86d54fa1f4088547fad559cd49 3 | timeCreated: 1494460406 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/EncoderBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.Rendering; 4 | 5 | 6 | namespace UTJ.FrameCapturer 7 | { 8 | public abstract class EncoderBase 9 | { 10 | public EncoderBase() 11 | { 12 | AppDomain.CurrentDomain.DomainUnload += WaitAsyncDelete; 13 | } 14 | public static void WaitAsyncDelete(object sender, EventArgs e) 15 | { 16 | fcAPI.fcWaitAsyncDelete(); 17 | } 18 | 19 | public abstract void Release(); 20 | public abstract bool IsValid(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/EncoderBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5078fb266c916184bb5cd9e635b82f9d 3 | timeCreated: 1494630775 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/ExrEncoder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.Rendering; 4 | 5 | 6 | namespace UTJ.FrameCapturer 7 | { 8 | public class ExrEncoder : MovieEncoder 9 | { 10 | static readonly string[] s_channelNames = { "R", "G", "B", "A" }; 11 | fcAPI.fcExrContext m_ctx; 12 | fcAPI.fcExrConfig m_config; 13 | string m_outPath; 14 | int m_frame; 15 | 16 | public override void Release() { m_ctx.Release(); } 17 | public override bool IsValid() { return m_ctx; } 18 | public override Type type { get { return Type.Exr; } } 19 | 20 | public override void Initialize(object config, string outPath) 21 | { 22 | if (!fcAPI.fcExrIsSupported()) 23 | { 24 | Debug.LogError("Exr encoder is not available on this platform."); 25 | return; 26 | } 27 | 28 | m_config = (fcAPI.fcExrConfig)config; 29 | m_ctx = fcAPI.fcExrCreateContext(ref m_config); 30 | m_outPath = outPath; 31 | m_frame = 0; 32 | } 33 | 34 | public override void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp = -1.0) 35 | { 36 | if (m_ctx) 37 | { 38 | string path = m_outPath + "_" + m_frame.ToString("0000") + ".exr"; 39 | int channels = System.Math.Min(m_config.channels, (int)format & 7); 40 | 41 | fcAPI.fcExrBeginImage(m_ctx, path, m_config.width, m_config.height); 42 | for (int i = 0; i < channels; ++i) 43 | { 44 | fcAPI.fcExrAddLayerPixels(m_ctx, frame, format, i, s_channelNames[i]); 45 | } 46 | fcAPI.fcExrEndImage(m_ctx); 47 | } 48 | ++m_frame; 49 | } 50 | 51 | public override void AddAudioSamples(float[] samples) 52 | { 53 | // not supported 54 | } 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/ExrEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2edf1ed5e1f1c8544b925c302853bbb8 3 | timeCreated: 1494000131 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/FlacEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class FlacEncoder : AudioEncoder 8 | { 9 | fcAPI.fcFlacContext m_ctx; 10 | fcAPI.fcFlacConfig m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.Flac; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcFlacIsSupported()) 19 | { 20 | Debug.LogError("Flac encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcFlacConfig)config; 25 | m_config.sampleRate = AudioSettings.outputSampleRate; 26 | m_config.numChannels = fcAPI.fcGetNumAudioChannels(); 27 | m_ctx = fcAPI.fcFlacCreateContext(ref m_config); 28 | 29 | var path = outPath + ".flac"; 30 | var stream = fcAPI.fcCreateFileStream(path); 31 | fcAPI.fcFlacAddOutputStream(m_ctx, stream); 32 | stream.Release(); 33 | } 34 | 35 | public override void AddAudioSamples(float[] samples) 36 | { 37 | if (m_ctx) 38 | { 39 | fcAPI.fcFlacAddAudioSamples(m_ctx, samples, samples.Length); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/FlacEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de9a4cfb1e5acbf44a178668df9a378d 3 | timeCreated: 1494460081 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/GifEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class GifEncoder : MovieEncoder 8 | { 9 | fcAPI.fcGifContext m_ctx; 10 | fcAPI.fcGifConfig m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.Gif; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcGifIsSupported()) 19 | { 20 | Debug.LogError("Gif encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcGifConfig)config; 25 | m_config.numColors = Mathf.Clamp(m_config.numColors, 1, 256); 26 | m_ctx = fcAPI.fcGifCreateContext(ref m_config); 27 | 28 | var path = outPath + ".gif"; 29 | var stream = fcAPI.fcCreateFileStream(path); 30 | fcAPI.fcGifAddOutputStream(m_ctx, stream); 31 | stream.Release(); 32 | } 33 | 34 | public override void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp) 35 | { 36 | if (m_ctx) 37 | { 38 | fcAPI.fcGifAddFramePixels(m_ctx, frame, format, timestamp); 39 | } 40 | } 41 | 42 | public override void AddAudioSamples(float[] samples) 43 | { 44 | // not supported 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/GifEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e328bea6ad6257848a01305be866b33b 3 | timeCreated: 1493996447 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/MP4Encoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class MP4Encoder : MovieEncoder 8 | { 9 | fcAPI.fcMP4Context m_ctx; 10 | fcAPI.fcMP4Config m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.MP4; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcMP4OSIsSupported()) 19 | { 20 | Debug.LogError("MP4 encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcMP4Config)config; 25 | m_config.audioSampleRate = AudioSettings.outputSampleRate; 26 | m_config.audioNumChannels = fcAPI.fcGetNumAudioChannels(); 27 | 28 | var path = outPath + ".mp4"; 29 | m_ctx = fcAPI.fcMP4OSCreateContext(ref m_config, path); 30 | } 31 | 32 | public override void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp) 33 | { 34 | if (m_ctx && m_config.video) 35 | { 36 | fcAPI.fcMP4AddVideoFramePixels(m_ctx, frame, format, timestamp); 37 | } 38 | } 39 | 40 | public override void AddAudioSamples(float[] samples) 41 | { 42 | if (m_ctx && m_config.audio) 43 | { 44 | fcAPI.fcMP4AddAudioSamples(m_ctx, samples, samples.Length); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/MP4Encoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15136ad38d3c16f4d91a6c802884de03 3 | timeCreated: 1493996447 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/MovieEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | 6 | 7 | namespace UTJ.FrameCapturer 8 | { 9 | [Serializable] 10 | public class MovieEncoderConfigs 11 | { 12 | public MovieEncoder.Type format = MovieEncoder.Type.WebM; 13 | public fcAPI.fcPngConfig pngEncoderSettings = fcAPI.fcPngConfig.default_value; 14 | public fcAPI.fcExrConfig exrEncoderSettings = fcAPI.fcExrConfig.default_value; 15 | public fcAPI.fcGifConfig gifEncoderSettings = fcAPI.fcGifConfig.default_value; 16 | public fcAPI.fcWebMConfig webmEncoderSettings = fcAPI.fcWebMConfig.default_value; 17 | public fcAPI.fcMP4Config mp4EncoderSettings = fcAPI.fcMP4Config.default_value; 18 | 19 | public MovieEncoderConfigs(MovieEncoder.Type t) 20 | { 21 | format = t; 22 | } 23 | 24 | public bool supportVideo 25 | { 26 | get { 27 | return 28 | format == MovieEncoder.Type.Png || 29 | format == MovieEncoder.Type.Exr || 30 | format == MovieEncoder.Type.Gif || 31 | format == MovieEncoder.Type.WebM || 32 | format == MovieEncoder.Type.MP4; 33 | } 34 | } 35 | 36 | public bool supportAudio 37 | { 38 | get 39 | { 40 | return 41 | format == MovieEncoder.Type.WebM || 42 | format == MovieEncoder.Type.MP4; 43 | } 44 | } 45 | 46 | public bool captureVideo 47 | { 48 | get 49 | { 50 | switch (format) 51 | { 52 | case MovieEncoder.Type.Png: return true; 53 | case MovieEncoder.Type.Exr: return true; 54 | case MovieEncoder.Type.Gif: return true; 55 | case MovieEncoder.Type.WebM: return webmEncoderSettings.video; 56 | case MovieEncoder.Type.MP4: return webmEncoderSettings.video; 57 | } 58 | return false; 59 | } 60 | set 61 | { 62 | webmEncoderSettings.video = 63 | mp4EncoderSettings.video = value; 64 | } 65 | } 66 | public bool captureAudio 67 | { 68 | get 69 | { 70 | switch (format) 71 | { 72 | case MovieEncoder.Type.Png: return false; 73 | case MovieEncoder.Type.Exr: return false; 74 | case MovieEncoder.Type.Gif: return false; 75 | case MovieEncoder.Type.WebM: return webmEncoderSettings.audio; 76 | case MovieEncoder.Type.MP4: return webmEncoderSettings.audio; 77 | } 78 | return false; 79 | } 80 | set 81 | { 82 | webmEncoderSettings.audio = 83 | mp4EncoderSettings.audio = value; 84 | } 85 | } 86 | 87 | public void Setup(int w, int h, int ch = 4, int targetFrameRate = 60) 88 | { 89 | pngEncoderSettings.width = 90 | exrEncoderSettings.width = 91 | gifEncoderSettings.width = 92 | webmEncoderSettings.videoWidth = 93 | mp4EncoderSettings.videoWidth = w; 94 | 95 | pngEncoderSettings.height = 96 | exrEncoderSettings.height = 97 | gifEncoderSettings.height = 98 | webmEncoderSettings.videoHeight = 99 | mp4EncoderSettings.videoHeight = h; 100 | 101 | pngEncoderSettings.channels = 102 | exrEncoderSettings.channels = ch; 103 | 104 | webmEncoderSettings.videoTargetFramerate = 105 | mp4EncoderSettings.videoTargetFramerate = targetFrameRate; 106 | } 107 | } 108 | 109 | public abstract class MovieEncoder : EncoderBase 110 | { 111 | public enum Type 112 | { 113 | Png, 114 | Exr, 115 | Gif, 116 | WebM, 117 | MP4, 118 | } 119 | static public Type[] GetAvailableEncoderTypes() 120 | { 121 | var ret = new List(); 122 | if (fcAPI.fcPngIsSupported()) { ret.Add(Type.Png); } 123 | if (fcAPI.fcExrIsSupported()) { ret.Add(Type.Exr); } 124 | if (fcAPI.fcGifIsSupported()) { ret.Add(Type.Gif); } 125 | if (fcAPI.fcWebMIsSupported()) { ret.Add(Type.WebM); } 126 | if (fcAPI.fcMP4OSIsSupported()) { ret.Add(Type.MP4); } 127 | return ret.ToArray(); 128 | } 129 | 130 | 131 | public abstract Type type { get; } 132 | 133 | // config: config struct (fcGifConfig, fcWebMConfig, etc) 134 | public abstract void Initialize(object config, string outPath); 135 | public abstract void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp = -1.0); 136 | public abstract void AddAudioSamples(float[] samples); 137 | 138 | 139 | public static MovieEncoder Create(Type t) 140 | { 141 | switch (t) 142 | { 143 | case Type.Png: return new PngEncoder(); 144 | case Type.Exr: return new ExrEncoder(); 145 | case Type.Gif: return new GifEncoder(); 146 | case Type.WebM:return new WebMEncoder(); 147 | case Type.MP4: return new MP4Encoder(); 148 | } 149 | return null; 150 | } 151 | 152 | public static MovieEncoder Create(MovieEncoderConfigs c, string path) 153 | { 154 | var ret = Create(c.format); 155 | switch (c.format) 156 | { 157 | case Type.Png: ret.Initialize(c.pngEncoderSettings, path); break; 158 | case Type.Exr: ret.Initialize(c.exrEncoderSettings, path); break; 159 | case Type.Gif: ret.Initialize(c.gifEncoderSettings, path); break; 160 | case Type.WebM:ret.Initialize(c.webmEncoderSettings,path); break; 161 | case Type.MP4: ret.Initialize(c.mp4EncoderSettings, path); break; 162 | } 163 | return ret; 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/MovieEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05a483774a00261429ff072ba4a63bea 3 | timeCreated: 1493995555 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/OggEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class OggEncoder : AudioEncoder 8 | { 9 | fcAPI.fcOggContext m_ctx; 10 | fcAPI.fcOggConfig m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.Ogg; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcOggIsSupported()) 19 | { 20 | Debug.LogError("Ogg encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcOggConfig)config; 25 | m_config.sampleRate = AudioSettings.outputSampleRate; 26 | m_config.numChannels = fcAPI.fcGetNumAudioChannels(); 27 | m_ctx = fcAPI.fcOggCreateContext(ref m_config); 28 | 29 | var path = outPath + ".ogg"; 30 | var stream = fcAPI.fcCreateFileStream(path); 31 | fcAPI.fcOggAddOutputStream(m_ctx, stream); 32 | stream.Release(); 33 | } 34 | 35 | public override void AddAudioSamples(float[] samples) 36 | { 37 | if(m_ctx) 38 | { 39 | fcAPI.fcOggAddAudioSamples(m_ctx, samples, samples.Length); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/OggEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d73bca5c7709074dab1e33c534c5015 3 | timeCreated: 1494516452 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/PngEncoder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | 4 | namespace UTJ.FrameCapturer 5 | { 6 | public class PngEncoder : MovieEncoder 7 | { 8 | fcAPI.fcPngContext m_ctx; 9 | fcAPI.fcPngConfig m_config; 10 | string m_outPath; 11 | int m_frame; 12 | 13 | 14 | public override void Release() { m_ctx.Release(); } 15 | public override bool IsValid() { return m_ctx; } 16 | public override Type type { get { return Type.Png; } } 17 | 18 | public override void Initialize(object config, string outPath) 19 | { 20 | if (!fcAPI.fcPngIsSupported()) 21 | { 22 | Debug.LogError("Png encoder is not available on this platform."); 23 | return; 24 | } 25 | 26 | m_config = (fcAPI.fcPngConfig)config; 27 | m_ctx = fcAPI.fcPngCreateContext(ref m_config); 28 | m_outPath = outPath; 29 | m_frame = 0; 30 | } 31 | 32 | public override void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp = -1.0) 33 | { 34 | if (m_ctx) 35 | { 36 | string path = m_outPath + "_" + m_frame.ToString("0000") + ".png"; 37 | int channels = System.Math.Min(m_config.channels, (int)format & 7); 38 | fcAPI.fcPngExportPixels(m_ctx, path, frame, m_config.width, m_config.height, format, channels); 39 | } 40 | ++m_frame; 41 | } 42 | 43 | public override void AddAudioSamples(float[] samples) 44 | { 45 | // not supported 46 | } 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/PngEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb579d3ab681ded4bbcd41bac0530cb4 3 | timeCreated: 1494000131 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/WaveEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class WaveEncoder : AudioEncoder 8 | { 9 | fcAPI.fcWaveContext m_ctx; 10 | fcAPI.fcWaveConfig m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.Wave; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcWaveIsSupported()) 19 | { 20 | Debug.LogError("Wave encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcWaveConfig)config; 25 | m_config.sampleRate = AudioSettings.outputSampleRate; 26 | m_config.numChannels = fcAPI.fcGetNumAudioChannels(); 27 | m_ctx = fcAPI.fcWaveCreateContext(ref m_config); 28 | 29 | var path = outPath + ".wave"; 30 | var stream = fcAPI.fcCreateFileStream(path); 31 | fcAPI.fcWaveAddOutputStream(m_ctx, stream); 32 | stream.Release(); 33 | } 34 | 35 | public override void AddAudioSamples(float[] samples) 36 | { 37 | if(m_ctx) 38 | { 39 | fcAPI.fcWaveAddAudioSamples(m_ctx, samples, samples.Length); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/WaveEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 294b105c376faa845995d961f1e3a434 3 | timeCreated: 1494460081 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/WebMEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | public class WebMEncoder : MovieEncoder 8 | { 9 | fcAPI.fcWebMContext m_ctx; 10 | fcAPI.fcWebMConfig m_config; 11 | 12 | public override void Release() { m_ctx.Release(); } 13 | public override bool IsValid() { return m_ctx; } 14 | public override Type type { get { return Type.WebM; } } 15 | 16 | public override void Initialize(object config, string outPath) 17 | { 18 | if (!fcAPI.fcWebMIsSupported()) 19 | { 20 | Debug.LogError("WebM encoder is not available on this platform."); 21 | return; 22 | } 23 | 24 | m_config = (fcAPI.fcWebMConfig)config; 25 | if (m_config.audio && m_config.audioEncoder == fcAPI.fcWebMAudioEncoder.Opus) 26 | { 27 | var sampleRate = AudioSettings.outputSampleRate; 28 | if (sampleRate != 8000 && sampleRate != 12000 && sampleRate != 16000 && sampleRate != 24000 && sampleRate != 48000) 29 | { 30 | Debug.LogError("Current output sample rate is " + sampleRate + ". It must be 8000, 12000, 16000, 24000 or 48000 to use Opus audio encoder. Fallback to Vorbis."); 31 | m_config.audioEncoder = fcAPI.fcWebMAudioEncoder.Vorbis; 32 | } 33 | } 34 | 35 | m_config.audioSampleRate = AudioSettings.outputSampleRate; 36 | m_config.audioNumChannels = fcAPI.fcGetNumAudioChannels(); 37 | m_ctx = fcAPI.fcWebMCreateContext(ref m_config); 38 | 39 | var path = outPath + ".webm"; 40 | var stream = fcAPI.fcCreateFileStream(path); 41 | fcAPI.fcWebMAddOutputStream(m_ctx, stream); 42 | stream.Release(); 43 | } 44 | 45 | public override void AddVideoFrame(byte[] frame, fcAPI.fcPixelFormat format, double timestamp) 46 | { 47 | if (m_ctx && m_config.video) 48 | { 49 | fcAPI.fcWebMAddVideoFramePixels(m_ctx, frame, format, timestamp); 50 | } 51 | } 52 | 53 | public override void AddAudioSamples(float[] samples) 54 | { 55 | if (m_ctx && m_config.audio) 56 | { 57 | fcAPI.fcWebMAddAudioSamples(m_ctx, samples, samples.Length); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/WebMEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb89bd50fd2c9b4589670dc229526c7 3 | timeCreated: 1493996447 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/fcAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using UnityEngine; 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | namespace UTJ.FrameCapturer 9 | { 10 | public static class fcAPI 11 | { 12 | // ------------------------------------------------------------- 13 | // Foundation 14 | // ------------------------------------------------------------- 15 | 16 | public enum fcPixelFormat 17 | { 18 | Unknown = 0, 19 | 20 | ChannelMask = 0xF, 21 | TypeMask = 0xF << 4, 22 | Type_f16 = 0x1 << 4, 23 | Type_f32 = 0x2 << 4, 24 | Type_u8 = 0x3 << 4, 25 | Type_i16 = 0x4 << 4, 26 | Type_i32 = 0x5 << 4, 27 | 28 | Rf16 = Type_f16 | 1, 29 | RGf16 = Type_f16 | 2, 30 | RGBf16 = Type_f16 | 3, 31 | RGBAf16 = Type_f16 | 4, 32 | Rf32 = Type_f32 | 1, 33 | RGf32 = Type_f32 | 2, 34 | RGBf32 = Type_f32 | 3, 35 | RGBAf32 = Type_f32 | 4, 36 | Ru8 = Type_u8 | 1, 37 | RGu8 = Type_u8 | 2, 38 | RGBu8 = Type_u8 | 3, 39 | RGBAu8 = Type_u8 | 4, 40 | Ri16 = Type_i16 | 1, 41 | RGi16 = Type_i16 | 2, 42 | RGBi16 = Type_i16 | 3, 43 | RGBAi16 = Type_i16 | 4, 44 | Ri32 = Type_i32 | 1, 45 | RGi32 = Type_i32 | 2, 46 | RGBi32 = Type_i32 | 3, 47 | RGBAi32 = Type_i32 | 4, 48 | }; 49 | 50 | public enum fcBitrateMode 51 | { 52 | CBR, 53 | VBR, 54 | } 55 | 56 | public enum fcAudioBitsPerSample 57 | { 58 | _8Bits = 8, 59 | _16Bits = 16, 60 | _24Bits = 24, 61 | } 62 | 63 | 64 | 65 | [DllImport ("fccore")] public static extern void fcSetModulePath(string path); 66 | [DllImport ("fccore")] public static extern double fcGetTime(); 67 | 68 | 69 | public struct fcDeferredCall 70 | { 71 | public int handle; 72 | public void Release() { fcReleaseDeferredCall(this); handle = 0; } 73 | public static implicit operator int(fcDeferredCall v) { return v.handle; } 74 | } 75 | 76 | public struct fcStream 77 | { 78 | public IntPtr ptr; 79 | public void Release() { fcReleaseStream(this); ptr = IntPtr.Zero; } 80 | public static implicit operator bool(fcStream v) { return v.ptr != IntPtr.Zero; } 81 | } 82 | [DllImport ("fccore")] public static extern fcStream fcCreateFileStream(string path); 83 | [DllImport ("fccore")] public static extern fcStream fcCreateMemoryStream(); 84 | [DllImport ("fccore")] private static extern void fcReleaseStream(fcStream s); 85 | [DllImport ("fccore")] public static extern ulong fcStreamGetWrittenSize(fcStream s); 86 | 87 | [DllImport ("fccore")] public static extern void fcGuardBegin(); 88 | [DllImport ("fccore")] public static extern void fcGuardEnd(); 89 | [DllImport ("fccore")] public static extern fcDeferredCall fcAllocateDeferredCall(); 90 | [DllImport ("fccore")] private static extern void fcReleaseDeferredCall(fcDeferredCall dc); 91 | [DllImport ("fccore")] public static extern IntPtr fcGetRenderEventFunc(); 92 | 93 | public static void fcGuard(Action body) 94 | { 95 | fcGuardBegin(); 96 | body.Invoke(); 97 | fcGuardEnd(); 98 | } 99 | 100 | public static fcPixelFormat fcGetPixelFormat(RenderTextureFormat v) 101 | { 102 | switch (v) 103 | { 104 | case RenderTextureFormat.ARGB32: return fcPixelFormat.RGBAu8; 105 | case RenderTextureFormat.ARGBHalf: return fcPixelFormat.RGBAf16; 106 | case RenderTextureFormat.RGHalf: return fcPixelFormat.RGf16; 107 | case RenderTextureFormat.RHalf: return fcPixelFormat.Rf16; 108 | case RenderTextureFormat.ARGBFloat: return fcPixelFormat.RGBAf32; 109 | case RenderTextureFormat.RGFloat: return fcPixelFormat.RGf32; 110 | case RenderTextureFormat.RFloat: return fcPixelFormat.Rf32; 111 | case RenderTextureFormat.ARGBInt: return fcPixelFormat.RGBAi32; 112 | case RenderTextureFormat.RGInt: return fcPixelFormat.RGi32; 113 | case RenderTextureFormat.RInt: return fcPixelFormat.Ri32; 114 | } 115 | return fcPixelFormat.Unknown; 116 | } 117 | 118 | public static fcPixelFormat fcGetPixelFormat(TextureFormat v) 119 | { 120 | switch (v) 121 | { 122 | case TextureFormat.Alpha8: return fcPixelFormat.Ru8; 123 | case TextureFormat.RGB24: return fcPixelFormat.RGBu8; 124 | case TextureFormat.RGBA32: return fcPixelFormat.RGBAu8; 125 | case TextureFormat.ARGB32: return fcPixelFormat.RGBAu8; 126 | case TextureFormat.RGBAHalf: return fcPixelFormat.RGBAf16; 127 | case TextureFormat.RGHalf: return fcPixelFormat.RGf16; 128 | case TextureFormat.RHalf: return fcPixelFormat.Rf16; 129 | case TextureFormat.RGBAFloat: return fcPixelFormat.RGBAf32; 130 | case TextureFormat.RGFloat: return fcPixelFormat.RGf32; 131 | case TextureFormat.RFloat: return fcPixelFormat.Rf32; 132 | } 133 | return fcPixelFormat.Unknown; 134 | } 135 | 136 | public static int fcGetNumAudioChannels() 137 | { 138 | switch (AudioSettings.speakerMode) 139 | { 140 | case AudioSpeakerMode.Mono: return 1; 141 | case AudioSpeakerMode.Stereo: return 2; 142 | case AudioSpeakerMode.Quad: return 4; 143 | case AudioSpeakerMode.Surround: return 5; 144 | case AudioSpeakerMode.Mode5point1: return 6; 145 | case AudioSpeakerMode.Mode7point1: return 8; 146 | case AudioSpeakerMode.Prologic: return 6; 147 | } 148 | return 0; 149 | } 150 | 151 | 152 | [DllImport ("fccore")] public static extern void fcEnableAsyncReleaseContext(Bool v); 153 | [DllImport ("fccore")] public static extern void fcWaitAsyncDelete(); 154 | [DllImport ("fccore")] public static extern void fcReleaseContext(IntPtr ctx); 155 | 156 | 157 | // ------------------------------------------------------------- 158 | // PNG Exporter 159 | // ------------------------------------------------------------- 160 | 161 | public enum fcPngPixelFormat 162 | { 163 | Auto, // select optimal one for input data 164 | UInt8, 165 | UInt16, 166 | }; 167 | 168 | [Serializable] 169 | public struct fcPngConfig 170 | { 171 | public fcPngPixelFormat pixelFormat; 172 | [Range(1, 32)] public int maxTasks; 173 | // C# ext 174 | [HideInInspector] public int width; 175 | [HideInInspector] public int height; 176 | [HideInInspector] public int channels; 177 | 178 | public static fcPngConfig default_value 179 | { 180 | get 181 | { 182 | return new fcPngConfig 183 | { 184 | pixelFormat = fcPngPixelFormat.Auto, 185 | maxTasks = 2, 186 | }; 187 | } 188 | } 189 | }; 190 | 191 | public struct fcPngContext 192 | { 193 | public IntPtr ptr; 194 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 195 | public static implicit operator bool(fcPngContext v) { return v.ptr != IntPtr.Zero; } 196 | } 197 | 198 | [DllImport ("fccore")] public static extern Bool fcPngIsSupported(); 199 | [DllImport ("fccore")] public static extern fcPngContext fcPngCreateContext(ref fcPngConfig conf); 200 | [DllImport ("fccore")] public static extern Bool fcPngExportPixels(fcPngContext ctx, string path, byte[] pixels, int width, int height, fcPixelFormat fmt, int num_channels); 201 | 202 | 203 | // ------------------------------------------------------------- 204 | // EXR Exporter 205 | // ------------------------------------------------------------- 206 | 207 | public enum fcExrPixelFormat 208 | { 209 | Auto, // select optimal one for input data 210 | Half, 211 | Float, 212 | Int, 213 | }; 214 | 215 | public enum fcExrCompression 216 | { 217 | None, 218 | RLE, 219 | ZipS, // par-line 220 | Zip, // block 221 | PIZ, 222 | }; 223 | 224 | [Serializable] 225 | public struct fcExrConfig 226 | { 227 | public fcExrPixelFormat pixelFormat; 228 | public fcExrCompression compression; 229 | [Range(1, 32)] public int maxTasks; 230 | // C# ext 231 | [HideInInspector] public int width; 232 | [HideInInspector] public int height; 233 | [HideInInspector] public int channels; 234 | 235 | public static fcExrConfig default_value 236 | { 237 | get 238 | { 239 | return new fcExrConfig 240 | { 241 | pixelFormat = fcExrPixelFormat.Auto, 242 | compression = fcExrCompression.Zip, 243 | maxTasks = 2, 244 | }; 245 | } 246 | } 247 | }; 248 | 249 | public struct fcExrContext 250 | { 251 | public IntPtr ptr; 252 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 253 | public static implicit operator bool(fcExrContext v) { return v.ptr != IntPtr.Zero; } 254 | } 255 | 256 | [DllImport ("fccore")] public static extern Bool fcExrIsSupported(); 257 | [DllImport ("fccore")] public static extern fcExrContext fcExrCreateContext(ref fcExrConfig conf); 258 | [DllImport ("fccore")] public static extern Bool fcExrBeginImage(fcExrContext ctx, string path, int width, int height); 259 | [DllImport ("fccore")] public static extern Bool fcExrAddLayerPixels(fcExrContext ctx, byte[] pixels, fcPixelFormat fmt, int ch, string name); 260 | [DllImport ("fccore")] public static extern Bool fcExrEndImage(fcExrContext ctx); 261 | 262 | 263 | // ------------------------------------------------------------- 264 | // GIF Exporter 265 | // ------------------------------------------------------------- 266 | 267 | [Serializable] 268 | public struct fcGifConfig 269 | { 270 | [HideInInspector] public int width; 271 | [HideInInspector] public int height; 272 | [Range(1, 256)] public int numColors; 273 | [Range(1, 120)] public int keyframeInterval; 274 | [Range(1, 32)] public int maxTasks; 275 | 276 | public static fcGifConfig default_value 277 | { 278 | get 279 | { 280 | return new fcGifConfig 281 | { 282 | numColors = 256, 283 | maxTasks = 8, 284 | keyframeInterval = 30, 285 | }; 286 | } 287 | } 288 | }; 289 | public struct fcGifContext 290 | { 291 | public IntPtr ptr; 292 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 293 | public static implicit operator bool(fcGifContext v) { return v.ptr != IntPtr.Zero; } 294 | } 295 | 296 | [DllImport ("fccore")] public static extern Bool fcGifIsSupported(); 297 | [DllImport ("fccore")] public static extern fcGifContext fcGifCreateContext(ref fcGifConfig conf); 298 | [DllImport ("fccore")] public static extern void fcGifAddOutputStream(fcGifContext ctx, fcStream stream); 299 | [DllImport ("fccore")] public static extern Bool fcGifAddFramePixels(fcGifContext ctx, byte[] pixels, fcPixelFormat fmt, double timestamp = -1.0); 300 | 301 | 302 | // ------------------------------------------------------------- 303 | // MP4 Exporter 304 | // ------------------------------------------------------------- 305 | 306 | public enum fcMP4VideoFlags 307 | { 308 | H264NVIDIA = 1 << 1, 309 | H264AMD = 1 << 2, 310 | H264IntelHW = 1 << 3, 311 | H264IntelSW = 1 << 4, 312 | H264OpenH264= 1 << 5, 313 | H264Mask = H264NVIDIA | H264AMD | H264IntelHW | H264IntelSW | H264OpenH264, 314 | }; 315 | 316 | public enum fcMP4AudioFlags 317 | { 318 | AACIntel = 1 << 1, 319 | AACFAAC = 1 << 2, 320 | AACMask = AACIntel | AACFAAC, 321 | }; 322 | 323 | [Serializable] 324 | public struct fcMP4Config 325 | { 326 | [HideInInspector] public Bool video; 327 | [HideInInspector] public int videoWidth; 328 | [HideInInspector] public int videoHeight; 329 | [HideInInspector] public int videoTargetFramerate; 330 | public fcBitrateMode videoBitrateMode; 331 | public int videoTargetBitrate; 332 | [HideInInspector] public int videoFlags; 333 | [Range(1, 32)] public int videoMaxTasks; 334 | 335 | [HideInInspector] public Bool audio; 336 | [HideInInspector] public int audioSampleRate; 337 | [HideInInspector] public int audioNumChannels; 338 | public fcBitrateMode audioBitrateMode; 339 | public int audioTargetBitrate; 340 | [HideInInspector] public int audioFlags; 341 | [Range(1, 32)] public int audioMaxTasks; 342 | 343 | public static fcMP4Config default_value 344 | { 345 | get 346 | { 347 | return new fcMP4Config 348 | { 349 | video = true, 350 | videoBitrateMode = fcBitrateMode.VBR, 351 | videoTargetBitrate = 1024 * 1000, 352 | videoTargetFramerate = 30, 353 | videoFlags = (int)fcMP4VideoFlags.H264Mask, 354 | videoMaxTasks = 4, 355 | 356 | audio = true, 357 | audioSampleRate = 48000, 358 | audioNumChannels = 2, 359 | audioBitrateMode = fcBitrateMode.VBR, 360 | audioTargetBitrate = 128 * 1000, 361 | audioFlags = (int)fcMP4AudioFlags.AACMask, 362 | audioMaxTasks = 4, 363 | }; 364 | } 365 | } 366 | }; 367 | public struct fcMP4Context 368 | { 369 | public IntPtr ptr; 370 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 371 | public static implicit operator bool(fcMP4Context v) { return v.ptr != IntPtr.Zero; } 372 | } 373 | 374 | [DllImport ("fccore")] public static extern Bool fcMP4IsSupported(); 375 | [DllImport ("fccore")] public static extern Bool fcMP4OSIsSupported(); 376 | [DllImport ("fccore")] public static extern fcMP4Context fcMP4CreateContext(ref fcMP4Config conf); 377 | [DllImport ("fccore")] public static extern fcMP4Context fcMP4OSCreateContext(ref fcMP4Config conf, string path); 378 | [DllImport ("fccore")] public static extern void fcMP4AddOutputStream(fcMP4Context ctx, fcStream s); 379 | [DllImport ("fccore")] private static extern IntPtr fcMP4GetAudioEncoderInfo(fcMP4Context ctx); 380 | [DllImport ("fccore")] private static extern IntPtr fcMP4GetVideoEncoderInfo(fcMP4Context ctx); 381 | [DllImport ("fccore")] public static extern Bool fcMP4AddVideoFramePixels(fcMP4Context ctx, byte[] pixels, fcPixelFormat fmt, double timestamp = -1.0); 382 | [DllImport ("fccore")] public static extern Bool fcMP4AddAudioSamples(fcMP4Context ctx, float[] samples, int num_samples); 383 | 384 | public static string fcMP4GetAudioEncoderInfoS(fcMP4Context ctx) 385 | { 386 | return Marshal.PtrToStringAnsi(fcMP4GetAudioEncoderInfo(ctx)); 387 | } 388 | 389 | public static string fcMP4GetVideoEncoderInfoS(fcMP4Context ctx) 390 | { 391 | return Marshal.PtrToStringAnsi(fcMP4GetVideoEncoderInfo(ctx)); 392 | } 393 | 394 | 395 | // ------------------------------------------------------------- 396 | // WebM Exporter 397 | // ------------------------------------------------------------- 398 | 399 | public struct fcWebMContext 400 | { 401 | public IntPtr ptr; 402 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 403 | public static implicit operator bool(fcWebMContext v) { return v.ptr != IntPtr.Zero; } 404 | } 405 | 406 | public enum fcWebMVideoEncoder 407 | { 408 | VP8, 409 | VP9, 410 | VP9LossLess, 411 | }; 412 | public enum fcWebMAudioEncoder 413 | { 414 | Vorbis, 415 | Opus, 416 | }; 417 | 418 | [Serializable] 419 | public struct fcWebMConfig 420 | { 421 | [HideInInspector] public Bool video; 422 | public fcWebMVideoEncoder videoEncoder; 423 | [HideInInspector] public int videoWidth; 424 | [HideInInspector] public int videoHeight; 425 | [HideInInspector] public int videoTargetFramerate; 426 | public fcBitrateMode videoBitrateMode; 427 | public int videoTargetBitrate; 428 | [Range(1, 32)] public int videoMaxTasks; 429 | 430 | [HideInInspector] public Bool audio; 431 | public fcWebMAudioEncoder audioEncoder; 432 | [HideInInspector] public int audioSampleRate; 433 | [HideInInspector] public int audioNumChannels; 434 | public fcBitrateMode audioBitrateMode; 435 | public int audioTargetBitrate; 436 | [Range(1, 32)] public int audioMaxTasks; 437 | 438 | public static fcWebMConfig default_value 439 | { 440 | get 441 | { 442 | return new fcWebMConfig 443 | { 444 | video = true, 445 | videoEncoder = fcWebMVideoEncoder.VP8, 446 | videoTargetFramerate = 60, 447 | videoBitrateMode = fcBitrateMode.VBR, 448 | videoTargetBitrate = 1024 * 1000, 449 | videoMaxTasks = 4, 450 | 451 | audio = true, 452 | audioEncoder = fcWebMAudioEncoder.Vorbis, 453 | audioSampleRate = 48000, 454 | audioNumChannels = 2, 455 | audioBitrateMode = fcBitrateMode.VBR, 456 | audioTargetBitrate = 128 * 1000, 457 | audioMaxTasks = 4, 458 | }; 459 | } 460 | } 461 | } 462 | 463 | [DllImport ("fccore")] public static extern Bool fcWebMIsSupported(); 464 | [DllImport ("fccore")] public static extern fcWebMContext fcWebMCreateContext(ref fcWebMConfig conf); 465 | [DllImport ("fccore")] public static extern void fcWebMAddOutputStream(fcWebMContext ctx, fcStream stream); 466 | // timestamp=-1 is treated as current time. 467 | [DllImport ("fccore")] public static extern Bool fcWebMAddVideoFramePixels(fcWebMContext ctx, byte[] pixels, fcPixelFormat fmt, double timestamp = -1.0); 468 | // timestamp=-1 is treated as current time. 469 | [DllImport ("fccore")] public static extern Bool fcWebMAddAudioSamples(fcWebMContext ctx, float[] samples, int num_samples); 470 | 471 | 472 | // ------------------------------------------------------------- 473 | // Wave Exporter 474 | // ------------------------------------------------------------- 475 | public struct fcWaveContext 476 | { 477 | public IntPtr ptr; 478 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 479 | public static implicit operator bool(fcWaveContext v) { return v.ptr != IntPtr.Zero; } 480 | } 481 | 482 | [Serializable] 483 | public struct fcWaveConfig 484 | { 485 | [HideInInspector] public int sampleRate; 486 | [HideInInspector] public int numChannels; 487 | public fcAudioBitsPerSample bitsPerSample; 488 | [Range(1, 32)] public int maxTasks; 489 | 490 | public static fcWaveConfig default_value 491 | { 492 | get 493 | { 494 | return new fcWaveConfig 495 | { 496 | sampleRate = 48000, 497 | numChannels = 2, 498 | bitsPerSample = fcAudioBitsPerSample._16Bits, 499 | maxTasks = 2, 500 | }; 501 | } 502 | } 503 | } 504 | 505 | [DllImport ("fccore")] public static extern Bool fcWaveIsSupported(); 506 | [DllImport ("fccore")] public static extern fcWaveContext fcWaveCreateContext(ref fcWaveConfig conf); 507 | [DllImport ("fccore")] public static extern void fcWaveAddOutputStream(fcWaveContext ctx, fcStream stream); 508 | [DllImport ("fccore")] public static extern Bool fcWaveAddAudioSamples(fcWaveContext ctx, float[] samples, int num_samples); 509 | 510 | 511 | 512 | // ------------------------------------------------------------- 513 | // Ogg Exporter 514 | // ------------------------------------------------------------- 515 | public struct fcOggContext 516 | { 517 | public IntPtr ptr; 518 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 519 | public static implicit operator bool(fcOggContext v) { return v.ptr != IntPtr.Zero; } 520 | } 521 | 522 | [Serializable] 523 | public struct fcOggConfig 524 | { 525 | [HideInInspector] public int sampleRate; 526 | [HideInInspector] public int numChannels; 527 | public fcBitrateMode bitrateMode; 528 | public int targetBitrate; 529 | [Range(1, 32)] public int maxTasks; 530 | 531 | public static fcOggConfig default_value 532 | { 533 | get 534 | { 535 | return new fcOggConfig 536 | { 537 | sampleRate = 48000, 538 | numChannels = 2, 539 | bitrateMode = fcBitrateMode.VBR, 540 | targetBitrate = 128 * 1000, 541 | maxTasks = 2, 542 | }; 543 | } 544 | } 545 | } 546 | 547 | [DllImport ("fccore")] public static extern Bool fcOggIsSupported(); 548 | [DllImport ("fccore")] public static extern fcOggContext fcOggCreateContext(ref fcOggConfig conf); 549 | [DllImport ("fccore")] public static extern void fcOggAddOutputStream(fcOggContext ctx, fcStream stream); 550 | [DllImport ("fccore")] public static extern Bool fcOggAddAudioSamples(fcOggContext ctx, float[] samples, int num_samples); 551 | 552 | 553 | // ------------------------------------------------------------- 554 | // Flac Exporter 555 | // ------------------------------------------------------------- 556 | public struct fcFlacContext 557 | { 558 | public IntPtr ptr; 559 | public void Release() { fcReleaseContext(ptr); ptr = IntPtr.Zero; } 560 | public static implicit operator bool(fcFlacContext v) { return v.ptr != IntPtr.Zero; } 561 | } 562 | 563 | [Serializable] 564 | public struct fcFlacConfig 565 | { 566 | [HideInInspector] public int sampleRate; 567 | [HideInInspector] public int numChannels; 568 | public fcAudioBitsPerSample bitsPerSample; 569 | [Range(0,9)] public int compressionLevel; 570 | public int blockSize; 571 | [HideInInspector] public Bool verify; 572 | [Range(1, 32)] public int maxTasks; 573 | 574 | public static fcFlacConfig default_value 575 | { 576 | get 577 | { 578 | return new fcFlacConfig 579 | { 580 | sampleRate = 48000, 581 | numChannels = 2, 582 | bitsPerSample = fcAudioBitsPerSample._16Bits, 583 | compressionLevel = 5, 584 | blockSize = 0, 585 | verify = false, 586 | maxTasks = 2, 587 | }; 588 | } 589 | } 590 | } 591 | 592 | [DllImport ("fccore")] public static extern Bool fcFlacIsSupported(); 593 | [DllImport ("fccore")] public static extern fcFlacContext fcFlacCreateContext(ref fcFlacConfig conf); 594 | [DllImport ("fccore")] public static extern void fcFlacAddOutputStream(fcFlacContext ctx, fcStream stream); 595 | [DllImport ("fccore")] public static extern Bool fcFlacAddAudioSamples(fcFlacContext ctx, float[] samples, int num_samples); 596 | 597 | 598 | 599 | 600 | public static void fcLock(RenderTexture src, TextureFormat dstfmt, Action body) 601 | { 602 | var tex = new Texture2D(src.width, src.height, dstfmt, false); 603 | RenderTexture.active = src; 604 | tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false); 605 | tex.Apply(); 606 | body(tex.GetRawTextureData(), fcGetPixelFormat(tex.format)); 607 | UnityEngine.Object.Destroy(tex); 608 | } 609 | 610 | public static void fcLock(RenderTexture src, Action body) 611 | { 612 | TextureFormat dstfmt = TextureFormat.RGBA32; 613 | switch (src.format) 614 | { 615 | case RenderTextureFormat.DefaultHDR: 616 | case RenderTextureFormat.ARGB2101010: 617 | case RenderTextureFormat.RGB111110Float: 618 | case RenderTextureFormat.ARGBHalf: 619 | case RenderTextureFormat.RGHalf: 620 | case RenderTextureFormat.Depth: 621 | case RenderTextureFormat.Shadowmap: 622 | case RenderTextureFormat.RHalf: dstfmt = TextureFormat.RGBAHalf; break; 623 | case RenderTextureFormat.ARGBFloat: 624 | case RenderTextureFormat.RGFloat: 625 | case RenderTextureFormat.RFloat: dstfmt = TextureFormat.RGBAFloat; break; 626 | } 627 | fcLock(src, dstfmt, body); 628 | } 629 | 630 | public static Mesh CreateFullscreenQuad() 631 | { 632 | var r = new Mesh(); 633 | r.vertices = new Vector3[4] { 634 | new Vector3( 1.0f, 1.0f, 0.0f), 635 | new Vector3(-1.0f, 1.0f, 0.0f), 636 | new Vector3(-1.0f,-1.0f, 0.0f), 637 | new Vector3( 1.0f,-1.0f, 0.0f), 638 | }; 639 | r.triangles = new int[6] { 0, 1, 2, 2, 3, 0 }; 640 | r.UploadMeshData(true); 641 | return r; 642 | } 643 | 644 | #if UNITY_EDITOR 645 | //public static bool IsRenderingPathDeferred(Camera cam) 646 | //{ 647 | // if (cam.renderingPath == RenderingPath.DeferredShading || 648 | // (cam.renderingPath == RenderingPath.UsePlayerSettings && 649 | // UnityEditor.Rendering.EditorGraphicsSettings.GetTierSettings(EditorUserBuildSettings.selectedBuildTargetGroup, Graphics.activeTier).renderingPath == RenderingPath.DeferredShading)) 650 | // { 651 | // return true; 652 | // } 653 | // return false; 654 | //} 655 | 656 | public static Shader GetFrameBufferCopyShader() 657 | { 658 | return AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath("2283fb92223c7914c9096670e29202c8")); 659 | } 660 | #endif 661 | 662 | } 663 | } 664 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Encoder/fcAPI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6913dd8876ab8149ac67f69aba208ac 3 | timeCreated: 1432919907 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 324c02e09f53928429e39bbbd971fa1c 3 | folderAsset: yes 4 | timeCreated: 1457073395 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Misc/Bool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UTJ.FrameCapturer 5 | { 6 | // bool is marshal as int (4 byte) by default and you need ugly [MarshalAs(UnmanagedType.U1)] to pass to (or receive from) C++ code. 7 | // this struct emulates bool and marshal as byte (1 byte). this makes things bit easier in some cases. 8 | [Serializable] 9 | public struct Bool 10 | { 11 | [SerializeField] byte v; 12 | public static implicit operator bool(Bool v) { return v.v != 0; } 13 | public static implicit operator Bool(bool v) { Bool r; r.v = v ? (byte)1 : (byte)0; return r; } 14 | 15 | public static Bool True { get { Bool r; r.v = (byte)1; return r; } } 16 | } 17 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Misc/Bool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e74a0ade798956d49a6bbb833422663e 3 | timeCreated: 1457112037 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Misc/DataPath.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UTJ.FrameCapturer 6 | { 7 | [Serializable] 8 | public class DataPath 9 | { 10 | public enum Root 11 | { 12 | Absolute, 13 | Current, 14 | PersistentData, 15 | StreamingAssets, 16 | TemporaryCache, 17 | DataPath, 18 | } 19 | 20 | [SerializeField] Root m_root = Root.Current; 21 | [SerializeField] string m_leaf = string.Empty; 22 | #if UNITY_EDITOR 23 | [SerializeField] bool m_readOnly = false; // just for inspector 24 | #endif 25 | 26 | public Root root 27 | { 28 | get { return m_root; } 29 | set { m_root = value; } 30 | } 31 | public string leaf 32 | { 33 | get { return m_leaf; } 34 | set { m_leaf = value; } 35 | } 36 | public bool readOnly 37 | { 38 | #if UNITY_EDITOR 39 | get { return m_readOnly; } 40 | set { m_readOnly = value; } 41 | #else 42 | get { return false; } 43 | set { } 44 | #endif 45 | } 46 | 47 | public DataPath() { } 48 | public DataPath(Root root, string leaf) 49 | { 50 | m_root = root; 51 | m_leaf = leaf; 52 | } 53 | 54 | public DataPath(string path) 55 | { 56 | if (path.Contains(Application.streamingAssetsPath)) 57 | { 58 | m_root = Root.StreamingAssets; 59 | m_leaf = path.Replace(Application.streamingAssetsPath, "").TrimStart('/'); 60 | } 61 | else if (path.Contains(Application.dataPath)) 62 | { 63 | m_root = Root.DataPath; 64 | m_leaf = path.Replace(Application.dataPath, "").TrimStart('/'); 65 | } 66 | else if (path.Contains(Application.persistentDataPath)) 67 | { 68 | m_root = Root.PersistentData; 69 | m_leaf = path.Replace(Application.persistentDataPath, "").TrimStart('/'); 70 | } 71 | else if (path.Contains(Application.temporaryCachePath)) 72 | { 73 | m_root = Root.TemporaryCache; 74 | m_leaf = path.Replace(Application.temporaryCachePath, "").TrimStart('/'); 75 | } 76 | else 77 | { 78 | var cur = System.IO.Directory.GetCurrentDirectory().Replace("\\", "/"); 79 | if (path.Contains(cur)) 80 | { 81 | m_root = Root.Current; 82 | m_leaf = path.Replace(cur, "").TrimStart('/'); 83 | } 84 | else 85 | { 86 | m_root = Root.Absolute; 87 | m_leaf = path; 88 | } 89 | } 90 | } 91 | 92 | public string GetFullPath() 93 | { 94 | if (m_root == Root.Absolute) 95 | { 96 | return m_leaf; 97 | } 98 | if (m_root == Root.Current) 99 | { 100 | return m_leaf.Length == 0 ? "." : "./" + m_leaf; 101 | } 102 | 103 | string ret = ""; 104 | switch (m_root) 105 | { 106 | case Root.PersistentData: 107 | ret = Application.persistentDataPath; 108 | break; 109 | case Root.StreamingAssets: 110 | ret = Application.streamingAssetsPath; 111 | break; 112 | case Root.TemporaryCache: 113 | ret = Application.temporaryCachePath; 114 | break; 115 | case Root.DataPath: 116 | ret = Application.dataPath; 117 | break; 118 | } 119 | 120 | if (!m_leaf.StartsWith("/")) 121 | { 122 | ret += "/"; 123 | } 124 | ret += m_leaf; 125 | return ret; 126 | } 127 | 128 | public void CreateDirectory() 129 | { 130 | try 131 | { 132 | var path = GetFullPath(); 133 | if(path.Length > 0) 134 | { 135 | System.IO.Directory.CreateDirectory(path); 136 | } 137 | } 138 | catch(Exception) 139 | { 140 | } 141 | } 142 | } 143 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/Misc/DataPath.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fd1bcdf4e762654da9323b7b37cfecb 3 | timeCreated: 1457112037 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/MovieRecorder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | 10 | namespace UTJ.FrameCapturer 11 | { 12 | [RequireComponent(typeof(Camera))] 13 | [ExecuteInEditMode] 14 | public class MovieRecorder : RecorderBase 15 | { 16 | #region inner_types 17 | public enum CaptureTarget 18 | { 19 | FrameBuffer, 20 | RenderTexture, 21 | } 22 | #endregion 23 | 24 | 25 | #region fields 26 | [SerializeField] MovieEncoderConfigs m_encoderConfigs = new MovieEncoderConfigs(MovieEncoder.Type.WebM); 27 | [SerializeField] CaptureTarget m_captureTarget = CaptureTarget.FrameBuffer; 28 | [SerializeField] RenderTexture m_targetRT; 29 | [SerializeField] bool m_captureVideo = true; 30 | [SerializeField] bool m_captureAudio = true; 31 | 32 | [SerializeField] Shader m_shCopy; 33 | Material m_matCopy; 34 | Mesh m_quad; 35 | CommandBuffer m_cb; 36 | RenderTexture m_scratchBuffer; 37 | MovieEncoder m_encoder; 38 | #endregion 39 | 40 | 41 | #region properties 42 | public CaptureTarget captureTarget 43 | { 44 | get { return m_captureTarget; } 45 | set { m_captureTarget = value; } 46 | } 47 | public RenderTexture targetRT 48 | { 49 | get { return m_targetRT; } 50 | set { m_targetRT = value; } 51 | } 52 | public bool captureAudio 53 | { 54 | get { return m_captureAudio; } 55 | set { m_captureAudio = value; } 56 | } 57 | public bool captureVideo 58 | { 59 | get { return m_captureVideo; } 60 | set { m_captureVideo = value; } 61 | } 62 | 63 | public bool supportVideo { get { return m_encoderConfigs.supportVideo; } } 64 | public bool supportAudio { get { return m_encoderConfigs.supportAudio; } } 65 | public RenderTexture scratchBuffer { get { return m_scratchBuffer; } } 66 | #endregion 67 | 68 | 69 | public override bool BeginRecording() 70 | { 71 | return BeginRecording(DateTime.Now.ToString("yyyyMMdd_HHmmss")); 72 | } 73 | public bool BeginRecording(string videoName) 74 | { 75 | if (m_recording) { return false; } 76 | if (m_shCopy == null) 77 | { 78 | Debug.LogError("MovieRecorder: copy shader is missing!"); 79 | return false; 80 | } 81 | if (m_captureTarget == CaptureTarget.RenderTexture && m_targetRT == null) 82 | { 83 | Debug.LogError("MovieRecorder: target RenderTexture is null!"); 84 | return false; 85 | } 86 | 87 | m_outputDir.CreateDirectory(); 88 | if (m_quad == null) m_quad = fcAPI.CreateFullscreenQuad(); 89 | if (m_matCopy == null) m_matCopy = new Material(m_shCopy); 90 | 91 | var cam = GetComponent(); 92 | if (cam.targetTexture != null) 93 | { 94 | m_matCopy.EnableKeyword("OFFSCREEN"); 95 | } 96 | else 97 | { 98 | m_matCopy.DisableKeyword("OFFSCREEN"); 99 | } 100 | 101 | // create scratch buffer 102 | { 103 | int captureWidth = cam.pixelWidth; 104 | int captureHeight = cam.pixelHeight; 105 | GetCaptureResolution(ref captureWidth, ref captureHeight); 106 | if (m_encoderConfigs.format == MovieEncoder.Type.MP4 || 107 | m_encoderConfigs.format == MovieEncoder.Type.WebM) 108 | { 109 | captureWidth = (captureWidth + 1) & ~1; 110 | captureHeight = (captureHeight + 1) & ~1; 111 | } 112 | 113 | m_scratchBuffer = new RenderTexture(captureWidth, captureHeight, 0, RenderTextureFormat.ARGB32); 114 | m_scratchBuffer.wrapMode = TextureWrapMode.Repeat; 115 | m_scratchBuffer.Create(); 116 | } 117 | 118 | // initialize encoder 119 | { 120 | int targetFramerate = 60; 121 | if(m_framerateMode == FrameRateMode.Constant) 122 | { 123 | targetFramerate = m_targetFramerate; 124 | } 125 | string outPath = m_outputDir.GetFullPath() + "/" + videoName; 126 | 127 | m_encoderConfigs.captureVideo = m_captureVideo; 128 | m_encoderConfigs.captureAudio = m_captureAudio; 129 | m_encoderConfigs.Setup(m_scratchBuffer.width, m_scratchBuffer.height, 3, targetFramerate); 130 | m_encoder = MovieEncoder.Create(m_encoderConfigs, outPath); 131 | if (m_encoder == null || !m_encoder.IsValid()) 132 | { 133 | EndRecording(); 134 | return false; 135 | } 136 | } 137 | 138 | // create command buffer 139 | { 140 | int tid = Shader.PropertyToID("_TmpFrameBuffer"); 141 | m_cb = new CommandBuffer(); 142 | m_cb.name = "MovieRecorder: copy frame buffer"; 143 | 144 | if(m_captureTarget == CaptureTarget.FrameBuffer) 145 | { 146 | m_cb.GetTemporaryRT(tid, -1, -1, 0, FilterMode.Bilinear); 147 | m_cb.Blit(BuiltinRenderTextureType.CurrentActive, tid); 148 | m_cb.SetRenderTarget(m_scratchBuffer); 149 | m_cb.DrawMesh(m_quad, Matrix4x4.identity, m_matCopy, 0, 0); 150 | m_cb.ReleaseTemporaryRT(tid); 151 | } 152 | else if(m_captureTarget == CaptureTarget.RenderTexture) 153 | { 154 | m_cb.SetRenderTarget(m_scratchBuffer); 155 | m_cb.SetGlobalTexture("_TmpRenderTarget", m_targetRT); 156 | m_cb.DrawMesh(m_quad, Matrix4x4.identity, m_matCopy, 0, 1); 157 | } 158 | cam.AddCommandBuffer(CameraEvent.AfterEverything, m_cb); 159 | } 160 | 161 | base.BeginRecording(); 162 | return true; 163 | } 164 | 165 | public override void EndRecording() 166 | { 167 | if (m_encoder != null) 168 | { 169 | m_encoder.Release(); 170 | m_encoder = null; 171 | } 172 | if (m_cb != null) 173 | { 174 | GetComponent().RemoveCommandBuffer(CameraEvent.AfterEverything, m_cb); 175 | m_cb.Release(); 176 | m_cb = null; 177 | } 178 | if (m_scratchBuffer != null) 179 | { 180 | m_scratchBuffer.Release(); 181 | m_scratchBuffer = null; 182 | } 183 | 184 | base.EndRecording(); 185 | } 186 | 187 | 188 | #region impl 189 | #if UNITY_EDITOR 190 | void Reset() 191 | { 192 | m_shCopy = fcAPI.GetFrameBufferCopyShader(); 193 | } 194 | #endif // UNITY_EDITOR 195 | 196 | IEnumerator OnPostRender() 197 | { 198 | if (m_recording && m_encoder != null && Time.frameCount % m_captureEveryNthFrame == 0) 199 | { 200 | yield return new WaitForEndOfFrame(); 201 | 202 | double timestamp = Time.unscaledTime - m_initialTime; 203 | if (m_framerateMode == FrameRateMode.Constant) 204 | { 205 | timestamp = 1.0 / m_targetFramerate * m_recordedFrames; 206 | } 207 | 208 | fcAPI.fcLock(m_scratchBuffer, TextureFormat.RGB24, (data, fmt) => 209 | { 210 | m_encoder.AddVideoFrame(data, fmt, timestamp); 211 | }); 212 | ++m_recordedFrames; 213 | } 214 | ++m_frame; 215 | } 216 | 217 | void OnAudioFilterRead(float[] samples, int channels) 218 | { 219 | if (m_recording && m_encoder != null) 220 | { 221 | m_encoder.AddAudioSamples(samples); 222 | m_recordedSamples += samples.Length; 223 | } 224 | } 225 | #endregion 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/MovieRecorder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 199311a1781af854fb1334c3c195468a 3 | timeCreated: 1455634659 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/RecorderBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | 10 | namespace UTJ.FrameCapturer 11 | { 12 | [ExecuteInEditMode] 13 | public abstract class RecorderBase : MonoBehaviour 14 | { 15 | public enum ResolutionUnit 16 | { 17 | Percent, 18 | Pixels, 19 | } 20 | 21 | public enum FrameRateMode 22 | { 23 | Variable, 24 | Constant, 25 | } 26 | 27 | public enum CaptureControl 28 | { 29 | Manual, 30 | FrameRange, 31 | TimeRange, 32 | } 33 | 34 | 35 | [SerializeField] protected DataPath m_outputDir = new DataPath(DataPath.Root.Current, "Capture"); 36 | 37 | [SerializeField] protected ResolutionUnit m_resolution = ResolutionUnit.Percent; 38 | [SerializeField] [Range(1,100)] protected int m_resolutionPercent = 100; 39 | [SerializeField] protected int m_resolutionWidth = 1920; 40 | 41 | [SerializeField] protected FrameRateMode m_framerateMode = FrameRateMode.Constant; 42 | [SerializeField] protected int m_targetFramerate = 30; 43 | [SerializeField] protected bool m_fixDeltaTime = true; 44 | [SerializeField] protected bool m_waitDeltaTime = true; 45 | [SerializeField] [Range(1,10)]protected int m_captureEveryNthFrame = 1; 46 | 47 | [SerializeField] protected CaptureControl m_captureControl = CaptureControl.FrameRange; 48 | [SerializeField] protected int m_startFrame = 0; 49 | [SerializeField] protected int m_endFrame = 100; 50 | [SerializeField] protected float m_startTime = 0.0f; 51 | [SerializeField] protected float m_endTime = 10.0f; 52 | [SerializeField] bool m_recordOnStart = false; 53 | 54 | protected bool m_recording = false; 55 | protected bool m_aborted = false; 56 | protected int m_initialFrame = 0; 57 | protected float m_initialTime = 0.0f; 58 | protected float m_initialRealTime = 0.0f; 59 | protected int m_frame = 0; 60 | protected int m_recordedFrames = 0; 61 | protected int m_recordedSamples = 0; 62 | 63 | 64 | public DataPath outputDir 65 | { 66 | get { return m_outputDir; } 67 | set { m_outputDir = value; } 68 | } 69 | 70 | public ResolutionUnit resolutionUnit 71 | { 72 | get { return m_resolution; } 73 | set { m_resolution = value; } 74 | } 75 | public int resolutionPercent 76 | { 77 | get { return m_resolutionPercent; } 78 | set { m_resolutionPercent = value; } 79 | } 80 | public int resolutionWidth 81 | { 82 | get { return m_resolutionWidth; } 83 | set { m_resolutionWidth = value; } 84 | } 85 | 86 | public FrameRateMode framerateMode 87 | { 88 | get { return m_framerateMode; } 89 | set { m_framerateMode = value; } 90 | } 91 | public int targetFramerate 92 | { 93 | get { return m_targetFramerate; } 94 | set { m_targetFramerate = value; } 95 | } 96 | public bool fixDeltaTime 97 | { 98 | get { return m_fixDeltaTime; } 99 | set { m_fixDeltaTime = value; } 100 | } 101 | public bool waitDeltaTime 102 | { 103 | get { return m_waitDeltaTime; } 104 | set { m_waitDeltaTime = value; } 105 | } 106 | public int captureEveryNthFrame 107 | { 108 | get { return m_captureEveryNthFrame; } 109 | set { m_captureEveryNthFrame = value; } 110 | } 111 | 112 | public CaptureControl captureControl 113 | { 114 | get { return m_captureControl; } 115 | set { m_captureControl = value; } 116 | } 117 | public int startFrame 118 | { 119 | get { return m_startFrame; } 120 | set { m_startFrame = value; } 121 | } 122 | public int endFrame 123 | { 124 | get { return m_endFrame; } 125 | set { m_endFrame = value; } 126 | } 127 | public float startTime 128 | { 129 | get { return m_startTime; } 130 | set { m_startTime = value; } 131 | } 132 | public float endTime 133 | { 134 | get { return m_endTime; } 135 | set { m_endTime = value; } 136 | } 137 | public bool isRecording 138 | { 139 | get { return m_recording; } 140 | set { 141 | if (value) { BeginRecording(); } 142 | else { EndRecording(); } 143 | } 144 | } 145 | public bool recordOnStart { set { m_recordOnStart = value; } } 146 | 147 | 148 | 149 | public virtual bool BeginRecording() 150 | { 151 | if(m_recording) { return false; } 152 | 153 | // delta time control 154 | if (m_framerateMode == FrameRateMode.Constant && m_fixDeltaTime) 155 | { 156 | Time.maximumDeltaTime = (1.0f / m_targetFramerate); 157 | if (!m_waitDeltaTime) 158 | { 159 | Time.captureFramerate = m_targetFramerate; 160 | } 161 | } 162 | 163 | m_initialFrame = Time.renderedFrameCount; 164 | m_initialTime = Time.unscaledTime; 165 | m_initialRealTime = Time.realtimeSinceStartup; 166 | m_recordedFrames = 0; 167 | m_recordedSamples = 0; 168 | m_recording = true; 169 | return true; 170 | } 171 | 172 | public virtual void EndRecording() 173 | { 174 | if (!m_recording) { return; } 175 | 176 | if (m_framerateMode == FrameRateMode.Constant && m_fixDeltaTime) 177 | { 178 | if (!m_waitDeltaTime) 179 | { 180 | Time.captureFramerate = 0; 181 | } 182 | } 183 | 184 | m_recording = false; 185 | m_aborted = true; 186 | } 187 | 188 | 189 | protected void GetCaptureResolution(ref int w, ref int h) 190 | { 191 | if(m_resolution == ResolutionUnit.Percent) 192 | { 193 | float scale = m_resolutionPercent * 0.01f; 194 | w = (int)(w * scale); 195 | h = (int)(h * scale); 196 | } 197 | else 198 | { 199 | float aspect = (float)h / w; 200 | w = m_resolutionWidth; 201 | h = (int)(m_resolutionWidth * aspect); 202 | } 203 | } 204 | 205 | protected IEnumerator Wait() 206 | { 207 | yield return new WaitForEndOfFrame(); 208 | 209 | float wt = (1.0f / m_targetFramerate) * (Time.renderedFrameCount - m_initialFrame); 210 | while (Time.realtimeSinceStartup - m_initialRealTime < wt) 211 | { 212 | System.Threading.Thread.Sleep(1); 213 | } 214 | } 215 | 216 | #if UNITY_EDITOR 217 | protected virtual void OnValidate() 218 | { 219 | m_targetFramerate = Mathf.Max(1, m_targetFramerate); 220 | m_startFrame = Mathf.Max(0, m_startFrame); 221 | m_endFrame = Mathf.Max(m_startFrame, m_endFrame); 222 | m_startTime = Mathf.Max(0.0f, m_startTime); 223 | m_endTime = Mathf.Max(m_startTime, m_endTime); 224 | } 225 | #endif // UNITY_EDITOR 226 | 227 | protected virtual void Start() 228 | { 229 | m_initialFrame = Time.renderedFrameCount; 230 | m_initialTime = Time.unscaledTime; 231 | m_initialRealTime = Time.realtimeSinceStartup; 232 | 233 | #if UNITY_EDITOR 234 | if (EditorApplication.isPlaying) 235 | #endif 236 | { 237 | if (m_recordOnStart) 238 | { 239 | BeginRecording(); 240 | } 241 | } 242 | m_recordOnStart = false; 243 | } 244 | 245 | protected virtual void OnDisable() 246 | { 247 | #if UNITY_EDITOR 248 | if (EditorApplication.isPlaying) 249 | #endif 250 | { 251 | EndRecording(); 252 | } 253 | } 254 | 255 | protected virtual void Update() 256 | { 257 | #if UNITY_EDITOR 258 | if (EditorApplication.isPlaying) 259 | #endif 260 | { 261 | if (m_captureControl == CaptureControl.FrameRange) 262 | { 263 | if (!m_aborted && m_frame >= m_startFrame && m_frame <= m_endFrame) 264 | { 265 | if (!m_recording) { BeginRecording(); } 266 | } 267 | else if (m_recording) 268 | { 269 | EndRecording(); 270 | } 271 | } 272 | else if (m_captureControl == CaptureControl.TimeRange) 273 | { 274 | float time = Time.unscaledTime - m_initialTime; 275 | if (!m_aborted && time >= m_startTime && time <= m_endTime) 276 | { 277 | if (!m_recording) { BeginRecording(); } 278 | } 279 | else if (m_recording) 280 | { 281 | EndRecording(); 282 | } 283 | } 284 | else if (m_captureControl == CaptureControl.Manual) 285 | { 286 | } 287 | 288 | if(m_framerateMode == FrameRateMode.Constant && m_fixDeltaTime && m_waitDeltaTime) 289 | { 290 | StartCoroutine(Wait()); 291 | } 292 | } 293 | } 294 | 295 | } 296 | } 297 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/RecorderBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29ac315c95aad34439a7dc4a107c3c35 3 | timeCreated: 1494734319 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/VideoRecorder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MLAgents; 3 | using UnityEngine; 4 | using UTJ.FrameCapturer; 5 | 6 | namespace MLAgents 7 | { 8 | public enum DurationUnit 9 | { 10 | Seconds, 11 | AcademySteps 12 | } 13 | 14 | [RequireComponent(typeof(MovieRecorder))] 15 | public class VideoRecorder : MonoBehaviour 16 | { 17 | 18 | [Tooltip("The directory where the videos will be saved. Can also be an absolute path (i.e C:\\Users\\Batman\\Desktop)")] 19 | public string outputDirectory = "./Capture"; 20 | public int resolutionWidth = 640; 21 | public int resolutionHeight = 360; 22 | 23 | [Tooltip("Which unit to use for the interval and duration of videos" 24 | + " Note that academy steps will not match with training summary steps if you change the decision frequency of the agent.")] 25 | public DurationUnit durationUnit; 26 | 27 | [Tooltip("One new video will be recorded every X duration unit.")] 28 | public int interval = 600; 29 | [Tooltip("Videos will be X duration unit long.")] 30 | public int duration = 30; 31 | 32 | [Tooltip("When this is activated, the time scale will be set to 1 during recording." 33 | + " It will be set back to the previous value at the end of recording.")] 34 | public bool recordInRealtime; 35 | 36 | [Tooltip("Should the audio be recorded?")] 37 | public bool captureAudio = true; 38 | 39 | [Tooltip("Log when the recorder starts of finish recording a video")] 40 | public bool verbose; 41 | 42 | private bool isRecording = false; 43 | private int recordingStartStep = -1; 44 | private float recordingStartTime = -1; 45 | private float timeScaleWhenNotRecording; 46 | 47 | private MovieRecorder movieRecorder; 48 | 49 | private int Steps 50 | { 51 | get 52 | { 53 | return Academy.Instance.GetTotalStepCount() - 1; 54 | } 55 | } 56 | 57 | private void Awake() 58 | { 59 | movieRecorder = GetComponent(); 60 | Camera mCamera = GetComponent(); 61 | RenderTexture rt = new RenderTexture(resolutionWidth, resolutionHeight, 16, RenderTextureFormat.ARGB32); 62 | mCamera.targetTexture = rt; 63 | movieRecorder.targetRT = rt; 64 | 65 | movieRecorder.outputDir = new DataPath(DataPath.Root.Absolute, outputDirectory); 66 | movieRecorder.captureAudio = captureAudio; 67 | movieRecorder.resolutionUnit = RecorderBase.ResolutionUnit.Percent; 68 | movieRecorder.resolutionPercent = 100; 69 | movieRecorder.captureControl = RecorderBase.CaptureControl.Manual; 70 | movieRecorder.framerateMode = RecorderBase.FrameRateMode.Constant; 71 | movieRecorder.fixDeltaTime = false; 72 | movieRecorder.waitDeltaTime = false; 73 | } 74 | 75 | private void Start() 76 | { 77 | if (duration > interval) 78 | { 79 | Debug.LogError("The duration of a video should be smaller than the interval !"); 80 | } 81 | } 82 | 83 | private bool ShouldStartRecording() 84 | { 85 | if (isRecording) 86 | { 87 | return false; 88 | } 89 | 90 | switch (durationUnit) 91 | { 92 | case DurationUnit.AcademySteps: 93 | return Steps % interval == 0; 94 | case DurationUnit.Seconds: 95 | return recordingStartTime == -1 || Time.realtimeSinceStartup - recordingStartTime > interval; 96 | } 97 | Debug.LogError("Unknown duration unit " + durationUnit); 98 | return false; 99 | } 100 | 101 | private bool ShouldEndRecording() 102 | { 103 | if (!isRecording) 104 | { 105 | return false; 106 | } 107 | 108 | switch (durationUnit) 109 | { 110 | case DurationUnit.AcademySteps: 111 | return Steps - recordingStartStep > duration; 112 | case DurationUnit.Seconds: 113 | return Time.realtimeSinceStartup - recordingStartTime > duration; 114 | } 115 | Debug.LogError("Unknown duration unit " + durationUnit); 116 | return false; 117 | } 118 | 119 | private void FixedUpdate() 120 | { 121 | if (ShouldEndRecording()) 122 | { 123 | if (verbose) 124 | Debug.Log("End Recording Video " + Steps + " " + Time.realtimeSinceStartup); 125 | movieRecorder.EndRecording(); 126 | isRecording = false; 127 | 128 | if (recordInRealtime) 129 | { 130 | Time.timeScale = timeScaleWhenNotRecording; 131 | } 132 | } 133 | // Order is important in case we want to begin a recording on the same frame we ended one 134 | else if (ShouldStartRecording()) 135 | { 136 | if (verbose) 137 | Debug.Log("Begin Recording Video " + Steps + " " + Time.realtimeSinceStartup); 138 | movieRecorder.BeginRecording(DateTime.Now.ToString("dd-MM_HH'h'mm") + "_" + Steps); 139 | isRecording = true; 140 | recordingStartStep = Steps; 141 | recordingStartTime = Time.realtimeSinceStartup; 142 | 143 | if (recordInRealtime) 144 | { 145 | timeScaleWhenNotRecording = Time.timeScale; 146 | Time.timeScale = 1; 147 | } 148 | } 149 | } 150 | 151 | } 152 | } -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Scripts/VideoRecorder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e71676b4e7cb264c8c5139ea5ce7199 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e43556cd2e1f10e48ac6cc20c04e94a3 3 | folderAsset: yes 4 | timeCreated: 1432924708 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Shaders/CopyFrameBuffer.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/UTJ/FrameCapturer/CopyFrameBuffer" { 2 | 3 | CGINCLUDE 4 | #include "UnityCG.cginc" 5 | #pragma multi_compile ___ UNITY_HDR_ON 6 | #pragma multi_compile ___ OFFSCREEN 7 | 8 | sampler2D _TmpFrameBuffer; 9 | sampler2D _CameraGBufferTexture0; 10 | sampler2D _CameraGBufferTexture1; 11 | sampler2D _CameraGBufferTexture2; 12 | sampler2D _CameraGBufferTexture3; 13 | sampler2D_float _CameraDepthTexture; 14 | sampler2D_half _CameraMotionVectorsTexture; 15 | sampler2D _TmpRenderTarget; 16 | float4 _ClearColor; 17 | 18 | struct v2f { 19 | float4 pos : POSITION; 20 | float4 spos : TEXCOORD0; 21 | }; 22 | 23 | v2f vert(appdata_img v) 24 | { 25 | v2f o; 26 | o.pos = o.spos = v.vertex; 27 | return o; 28 | } 29 | 30 | 31 | float2 get_texcoord(v2f i) 32 | { 33 | float2 t = i.spos.xy * 0.5 + 0.5; 34 | return t; 35 | } 36 | 37 | float2 get_texcoord_gb(v2f i) 38 | { 39 | float2 t = i.spos.xy * 0.5 + 0.5; 40 | #if !defined(UNITY_UV_STARTS_AT_TOP) 41 | t.y = 1.0 - t.y; 42 | #endif 43 | return t; 44 | } 45 | 46 | 47 | // framebuffer 48 | struct framebuffer_out 49 | { 50 | half4 color : SV_Target0; 51 | half4 alpha : SV_Target1; 52 | }; 53 | framebuffer_out copy_framebuffer(v2f I) 54 | { 55 | float2 t = get_texcoord(I); 56 | #if !defined(OFFSCREEN) || !defined(UNITY_UV_STARTS_AT_TOP) 57 | t.y = 1.0 - t.y; 58 | #endif 59 | half4 c = tex2D(_TmpFrameBuffer, t); 60 | 61 | framebuffer_out O; 62 | O.color = half4(c.rgb, 1.0); 63 | O.alpha = half4(c.aaa, 1.0); 64 | return O; 65 | } 66 | 67 | // render target (for offscreen-recorder) 68 | half4 copy_rendertarget(v2f I) : SV_Target 69 | { 70 | half4 O = tex2D(_TmpRenderTarget, get_texcoord_gb(I)); 71 | return O; 72 | } 73 | 74 | 75 | // gbuffer 76 | struct gbuffer_out 77 | { 78 | half4 albedo : SV_Target0; 79 | half4 occlusion : SV_Target1; 80 | half4 specular : SV_Target2; 81 | half4 smoothness : SV_Target3; 82 | half4 normal : SV_Target4; 83 | half4 emission : SV_Target5; 84 | half4 depth : SV_Target6; 85 | }; 86 | gbuffer_out copy_gbuffer(v2f I) 87 | { 88 | float2 t = get_texcoord_gb(I); 89 | half4 ao = tex2D(_CameraGBufferTexture0, t); 90 | half4 ss = tex2D(_CameraGBufferTexture1, t); 91 | half4 normal = tex2D(_CameraGBufferTexture2, t); 92 | half4 emission = tex2D(_CameraGBufferTexture3, t); 93 | half depth = tex2D(_CameraDepthTexture, get_texcoord_gb(I)); 94 | #if defined(UNITY_REVERSED_Z) 95 | depth = 1.0 - depth; 96 | #endif 97 | 98 | gbuffer_out O; 99 | O.albedo = half4(ao.rgb, 1.0); 100 | O.occlusion = half4(ao.aaa, 1.0); 101 | O.specular = half4(ss.rgb, 1.0); 102 | O.smoothness = half4(ss.aaa, 1.0); 103 | O.normal = half4(normal.rgb, 1.0); 104 | O.emission = emission; 105 | #ifndef UNITY_HDR_ON 106 | O.emission.rgb = -log2(O.emission.rgb); 107 | #endif 108 | O.depth = half4(depth.rrr, 1.0); 109 | return O; 110 | } 111 | 112 | 113 | // clear 114 | half4 clear(v2f I) : SV_Target 115 | { 116 | return _ClearColor; 117 | } 118 | 119 | // velocity 120 | half4 copy_velocity(v2f I) : SV_Target 121 | { 122 | float2 t = get_texcoord_gb(I); 123 | half2 velocity = tex2D(_CameraMotionVectorsTexture, t).rg; 124 | return half4(velocity, 1.0, 1.0); 125 | } 126 | 127 | ENDCG 128 | 129 | Subshader { 130 | // Pass 0: framebuffer 131 | Pass { 132 | Blend Off Cull Off ZTest Off ZWrite Off 133 | CGPROGRAM 134 | #pragma vertex vert 135 | #pragma fragment copy_framebuffer 136 | ENDCG 137 | } 138 | 139 | // Pass 1: render target 140 | Pass { 141 | Blend Off Cull Off ZTest Off ZWrite Off 142 | CGPROGRAM 143 | #pragma vertex vert 144 | #pragma fragment copy_rendertarget 145 | ENDCG 146 | } 147 | 148 | // Pass 2: gbuffer 149 | Pass{ 150 | Blend Off Cull Off ZTest Off ZWrite Off 151 | CGPROGRAM 152 | #pragma exclude_renderers d3d9 153 | #pragma vertex vert 154 | #pragma fragment copy_gbuffer 155 | ENDCG 156 | } 157 | 158 | // Pass 3: clear 159 | Pass { 160 | Blend Off Cull Off ZTest Off ZWrite Off 161 | CGPROGRAM 162 | #pragma vertex vert 163 | #pragma fragment clear 164 | ENDCG 165 | } 166 | 167 | // Pass 4: velocity 168 | Pass{ 169 | Blend Off Cull Off ZTest Off ZWrite Off 170 | CGPROGRAM 171 | #pragma vertex vert 172 | #pragma fragment copy_velocity 173 | ENDCG 174 | } 175 | } 176 | 177 | Fallback off 178 | } 179 | -------------------------------------------------------------------------------- /Assets/ML-Agents/VideoRecorder/Shaders/CopyFrameBuffer.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2283fb92223c7914c9096670e29202c8 3 | timeCreated: 1432965900 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Images/VideoRecorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/video-recorder/fd8ed4a98ae2a6d37dc249acc6a245a79e97905f/Images/VideoRecorder.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "2.0.16", 5 | "com.unity.package-manager-ui": "1.9.11", 6 | "com.unity.purchasing": "2.0.3", 7 | "com.unity.textmeshpro": "1.2.4", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 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: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 7 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | -------------------------------------------------------------------------------- /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: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | 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 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 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_AutoSyncTransforms: 1 46 | m_AlwaysShowColliders: 0 47 | m_ShowColliderSleep: 1 48 | m_ShowColliderContacts: 0 49 | m_ShowColliderAABB: 0 50 | m_ContactArrowScale: 0.2 51 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 52 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 53 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 54 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 55 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 56 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 833f25d620e079f49af90242669c8713 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: FrameCapturer 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidBlitType: 0 67 | defaultIsNativeResolution: 1 68 | macRetinaSupport: 1 69 | runInBackground: 0 70 | captureSingleScreen: 0 71 | muteOtherAudioSources: 0 72 | Prepare IOS For Recording: 0 73 | Force IOS Speakers When Recording: 0 74 | deferSystemGesturesMode: 0 75 | hideHomeButton: 0 76 | submitAnalytics: 1 77 | usePlayerLog: 1 78 | bakeCollisionMeshes: 0 79 | forceSingleInstance: 0 80 | resizableWindow: 0 81 | useMacAppStoreValidation: 0 82 | macAppStoreCategory: public.app-category.games 83 | gpuSkinning: 0 84 | graphicsJobs: 0 85 | xboxPIXTextureCapture: 0 86 | xboxEnableAvatar: 0 87 | xboxEnableKinect: 0 88 | xboxEnableKinectAutoTracking: 0 89 | xboxEnableFitness: 0 90 | visibleInBackground: 1 91 | allowFullscreenSwitch: 1 92 | graphicsJobMode: 0 93 | fullscreenMode: 1 94 | xboxSpeechDB: 0 95 | xboxEnableHeadOrientation: 0 96 | xboxEnableGuest: 0 97 | xboxEnablePIXSampling: 0 98 | metalFramebufferOnly: 0 99 | n3dsDisableStereoscopicView: 0 100 | n3dsEnableSharedListOpt: 1 101 | n3dsEnableVSync: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOnePresentImmediateThreshold: 0 109 | switchQueueCommandMemory: 0 110 | videoMemoryForVertexBuffers: 0 111 | psp2PowerMode: 0 112 | psp2AcquireBGM: 1 113 | vulkanEnableSetSRGBWrite: 0 114 | vulkanUseSWCommandBuffers: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 1 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | enableVideoLayer: 0 136 | useProtectedVideoMemory: 0 137 | minimumSupportedHeadTracking: 0 138 | maximumSupportedHeadTracking: 1 139 | hololens: 140 | depthFormat: 1 141 | depthBufferSharingEnabled: 0 142 | oculus: 143 | sharedDepthBuffer: 0 144 | dashSupport: 0 145 | enable360StereoCapture: 0 146 | protectGraphicsMemory: 0 147 | useHDRDisplay: 0 148 | m_ColorGamuts: 00000000 149 | targetPixelDensity: 30 150 | resolutionScalingMode: 0 151 | androidSupportedAspectRatio: 1 152 | androidMaxAspectRatio: 2.1 153 | applicationIdentifier: {} 154 | buildNumber: {} 155 | AndroidBundleVersionCode: 1 156 | AndroidMinSdkVersion: 16 157 | AndroidTargetSdkVersion: 0 158 | AndroidPreferredInstallLocation: 1 159 | aotOptions: 160 | stripEngineCode: 1 161 | iPhoneStrippingLevel: 0 162 | iPhoneScriptCallOptimization: 0 163 | ForceInternetPermission: 0 164 | ForceSDCardPermission: 0 165 | CreateWallpaper: 0 166 | APKExpansionFiles: 0 167 | keepLoadedShadersAlive: 0 168 | StripUnusedMeshComponents: 0 169 | VertexChannelCompressionMask: 4054 170 | iPhoneSdkVersion: 988 171 | iOSTargetOSVersionString: 8.0 172 | tvOSSdkVersion: 0 173 | tvOSRequireExtendedGameController: 0 174 | tvOSTargetOSVersionString: 9.0 175 | uIPrerenderedIcon: 0 176 | uIRequiresPersistentWiFi: 0 177 | uIRequiresFullScreen: 1 178 | uIStatusBarHidden: 1 179 | uIExitOnSuspend: 0 180 | uIStatusBarStyle: 0 181 | iPhoneSplashScreen: {fileID: 0} 182 | iPhoneHighResSplashScreen: {fileID: 0} 183 | iPhoneTallHighResSplashScreen: {fileID: 0} 184 | iPhone47inSplashScreen: {fileID: 0} 185 | iPhone55inPortraitSplashScreen: {fileID: 0} 186 | iPhone55inLandscapeSplashScreen: {fileID: 0} 187 | iPhone58inPortraitSplashScreen: {fileID: 0} 188 | iPhone58inLandscapeSplashScreen: {fileID: 0} 189 | iPadPortraitSplashScreen: {fileID: 0} 190 | iPadHighResPortraitSplashScreen: {fileID: 0} 191 | iPadLandscapeSplashScreen: {fileID: 0} 192 | iPadHighResLandscapeSplashScreen: {fileID: 0} 193 | appleTVSplashScreen: {fileID: 0} 194 | appleTVSplashScreen2x: {fileID: 0} 195 | tvOSSmallIconLayers: [] 196 | tvOSSmallIconLayers2x: [] 197 | tvOSLargeIconLayers: [] 198 | tvOSLargeIconLayers2x: [] 199 | tvOSTopShelfImageLayers: [] 200 | tvOSTopShelfImageLayers2x: [] 201 | tvOSTopShelfImageWideLayers: [] 202 | tvOSTopShelfImageWideLayers2x: [] 203 | iOSLaunchScreenType: 0 204 | iOSLaunchScreenPortrait: {fileID: 0} 205 | iOSLaunchScreenLandscape: {fileID: 0} 206 | iOSLaunchScreenBackgroundColor: 207 | serializedVersion: 2 208 | rgba: 0 209 | iOSLaunchScreenFillPct: 100 210 | iOSLaunchScreenSize: 100 211 | iOSLaunchScreenCustomXibPath: 212 | iOSLaunchScreeniPadType: 0 213 | iOSLaunchScreeniPadImage: {fileID: 0} 214 | iOSLaunchScreeniPadBackgroundColor: 215 | serializedVersion: 2 216 | rgba: 0 217 | iOSLaunchScreeniPadFillPct: 100 218 | iOSLaunchScreeniPadSize: 100 219 | iOSLaunchScreeniPadCustomXibPath: 220 | iOSUseLaunchScreenStoryboard: 0 221 | iOSLaunchScreenCustomStoryboardPath: 222 | iOSDeviceRequirements: [] 223 | iOSURLSchemes: [] 224 | iOSBackgroundModes: 0 225 | iOSMetalForceHardShadows: 0 226 | metalEditorSupport: 1 227 | metalAPIValidation: 1 228 | iOSRenderExtraFrameOnPause: 0 229 | appleDeveloperTeamID: 230 | iOSManualSigningProvisioningProfileID: 231 | tvOSManualSigningProvisioningProfileID: 232 | iOSManualSigningProvisioningProfileType: 0 233 | tvOSManualSigningProvisioningProfileType: 0 234 | appleEnableAutomaticSigning: 0 235 | iOSRequireARKit: 0 236 | appleEnableProMotion: 0 237 | vulkanEditorSupport: 0 238 | clonedFromGUID: 00000000000000000000000000000000 239 | templatePackageId: 240 | templateDefaultScene: 241 | AndroidTargetArchitectures: 1 242 | AndroidSplashScreenScale: 0 243 | androidSplashScreen: {fileID: 0} 244 | AndroidKeystoreName: 245 | AndroidKeyaliasName: 246 | AndroidBuildApkPerCpuArchitecture: 0 247 | AndroidTVCompatibility: 1 248 | AndroidIsGame: 1 249 | AndroidEnableTango: 0 250 | androidEnableBanner: 1 251 | androidUseLowAccuracyLocation: 0 252 | m_AndroidBanners: 253 | - width: 320 254 | height: 180 255 | banner: {fileID: 0} 256 | androidGamepadSupportLevel: 0 257 | resolutionDialogBanner: {fileID: 0} 258 | m_BuildTargetIcons: [] 259 | m_BuildTargetPlatformIcons: [] 260 | m_BuildTargetBatching: [] 261 | m_BuildTargetGraphicsAPIs: [] 262 | m_BuildTargetVRSettings: [] 263 | m_BuildTargetEnableVuforiaSettings: [] 264 | openGLRequireES31: 0 265 | openGLRequireES31AEP: 0 266 | m_TemplateCustomTags: {} 267 | mobileMTRendering: 268 | Android: 1 269 | iPhone: 1 270 | tvOS: 1 271 | m_BuildTargetGroupLightmapEncodingQuality: [] 272 | m_BuildTargetGroupLightmapSettings: [] 273 | playModeTestRunnerEnabled: 0 274 | runPlayModeTestAsEditModeTest: 0 275 | actionOnDotNetUnhandledException: 1 276 | enableInternalProfiler: 0 277 | logObjCUncaughtExceptions: 1 278 | enableCrashReportAPI: 0 279 | cameraUsageDescription: 280 | locationUsageDescription: 281 | microphoneUsageDescription: 282 | switchNetLibKey: 283 | switchSocketMemoryPoolSize: 6144 284 | switchSocketAllocatorPoolSize: 128 285 | switchSocketConcurrencyLimit: 14 286 | switchScreenResolutionBehavior: 2 287 | switchUseCPUProfiler: 0 288 | switchApplicationID: 0x01004b9000490000 289 | switchNSODependencies: 290 | switchTitleNames_0: 291 | switchTitleNames_1: 292 | switchTitleNames_2: 293 | switchTitleNames_3: 294 | switchTitleNames_4: 295 | switchTitleNames_5: 296 | switchTitleNames_6: 297 | switchTitleNames_7: 298 | switchTitleNames_8: 299 | switchTitleNames_9: 300 | switchTitleNames_10: 301 | switchTitleNames_11: 302 | switchTitleNames_12: 303 | switchTitleNames_13: 304 | switchTitleNames_14: 305 | switchPublisherNames_0: 306 | switchPublisherNames_1: 307 | switchPublisherNames_2: 308 | switchPublisherNames_3: 309 | switchPublisherNames_4: 310 | switchPublisherNames_5: 311 | switchPublisherNames_6: 312 | switchPublisherNames_7: 313 | switchPublisherNames_8: 314 | switchPublisherNames_9: 315 | switchPublisherNames_10: 316 | switchPublisherNames_11: 317 | switchPublisherNames_12: 318 | switchPublisherNames_13: 319 | switchPublisherNames_14: 320 | switchIcons_0: {fileID: 0} 321 | switchIcons_1: {fileID: 0} 322 | switchIcons_2: {fileID: 0} 323 | switchIcons_3: {fileID: 0} 324 | switchIcons_4: {fileID: 0} 325 | switchIcons_5: {fileID: 0} 326 | switchIcons_6: {fileID: 0} 327 | switchIcons_7: {fileID: 0} 328 | switchIcons_8: {fileID: 0} 329 | switchIcons_9: {fileID: 0} 330 | switchIcons_10: {fileID: 0} 331 | switchIcons_11: {fileID: 0} 332 | switchIcons_12: {fileID: 0} 333 | switchIcons_13: {fileID: 0} 334 | switchIcons_14: {fileID: 0} 335 | switchSmallIcons_0: {fileID: 0} 336 | switchSmallIcons_1: {fileID: 0} 337 | switchSmallIcons_2: {fileID: 0} 338 | switchSmallIcons_3: {fileID: 0} 339 | switchSmallIcons_4: {fileID: 0} 340 | switchSmallIcons_5: {fileID: 0} 341 | switchSmallIcons_6: {fileID: 0} 342 | switchSmallIcons_7: {fileID: 0} 343 | switchSmallIcons_8: {fileID: 0} 344 | switchSmallIcons_9: {fileID: 0} 345 | switchSmallIcons_10: {fileID: 0} 346 | switchSmallIcons_11: {fileID: 0} 347 | switchSmallIcons_12: {fileID: 0} 348 | switchSmallIcons_13: {fileID: 0} 349 | switchSmallIcons_14: {fileID: 0} 350 | switchManualHTML: 351 | switchAccessibleURLs: 352 | switchLegalInformation: 353 | switchMainThreadStackSize: 1048576 354 | switchPresenceGroupId: 355 | switchLogoHandling: 0 356 | switchReleaseVersion: 0 357 | switchDisplayVersion: 1.0.0 358 | switchStartupUserAccount: 0 359 | switchTouchScreenUsage: 0 360 | switchSupportedLanguagesMask: 0 361 | switchLogoType: 0 362 | switchApplicationErrorCodeCategory: 363 | switchUserAccountSaveDataSize: 0 364 | switchUserAccountSaveDataJournalSize: 0 365 | switchApplicationAttribute: 0 366 | switchCardSpecSize: -1 367 | switchCardSpecClock: -1 368 | switchRatingsMask: 0 369 | switchRatingsInt_0: 0 370 | switchRatingsInt_1: 0 371 | switchRatingsInt_2: 0 372 | switchRatingsInt_3: 0 373 | switchRatingsInt_4: 0 374 | switchRatingsInt_5: 0 375 | switchRatingsInt_6: 0 376 | switchRatingsInt_7: 0 377 | switchRatingsInt_8: 0 378 | switchRatingsInt_9: 0 379 | switchRatingsInt_10: 0 380 | switchRatingsInt_11: 0 381 | switchLocalCommunicationIds_0: 382 | switchLocalCommunicationIds_1: 383 | switchLocalCommunicationIds_2: 384 | switchLocalCommunicationIds_3: 385 | switchLocalCommunicationIds_4: 386 | switchLocalCommunicationIds_5: 387 | switchLocalCommunicationIds_6: 388 | switchLocalCommunicationIds_7: 389 | switchParentalControl: 0 390 | switchAllowsScreenshot: 1 391 | switchAllowsVideoCapturing: 1 392 | switchAllowsRuntimeAddOnContentInstall: 0 393 | switchDataLossConfirmation: 0 394 | switchSupportedNpadStyles: 3 395 | switchNativeFsCacheSize: 32 396 | switchIsHoldTypeHorizontal: 0 397 | switchSupportedNpadCount: 8 398 | switchSocketConfigEnabled: 0 399 | switchTcpInitialSendBufferSize: 32 400 | switchTcpInitialReceiveBufferSize: 64 401 | switchTcpAutoSendBufferSizeMax: 256 402 | switchTcpAutoReceiveBufferSizeMax: 256 403 | switchUdpSendBufferSize: 9 404 | switchUdpReceiveBufferSize: 42 405 | switchSocketBufferEfficiency: 4 406 | switchSocketInitializeEnabled: 1 407 | switchNetworkInterfaceManagerInitializeEnabled: 1 408 | switchPlayerConnectionEnabled: 1 409 | ps4NPAgeRating: 12 410 | ps4NPTitleSecret: 411 | ps4NPTrophyPackPath: 412 | ps4ParentalLevel: 11 413 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 414 | ps4Category: 0 415 | ps4MasterVersion: 01.00 416 | ps4AppVersion: 01.00 417 | ps4AppType: 0 418 | ps4ParamSfxPath: 419 | ps4VideoOutPixelFormat: 0 420 | ps4VideoOutInitialWidth: 1920 421 | ps4VideoOutBaseModeInitialWidth: 1920 422 | ps4VideoOutReprojectionRate: 60 423 | ps4PronunciationXMLPath: 424 | ps4PronunciationSIGPath: 425 | ps4BackgroundImagePath: 426 | ps4StartupImagePath: 427 | ps4StartupImagesFolder: 428 | ps4IconImagesFolder: 429 | ps4SaveDataImagePath: 430 | ps4SdkOverride: 431 | ps4BGMPath: 432 | ps4ShareFilePath: 433 | ps4ShareOverlayImagePath: 434 | ps4PrivacyGuardImagePath: 435 | ps4NPtitleDatPath: 436 | ps4RemotePlayKeyAssignment: -1 437 | ps4RemotePlayKeyMappingDir: 438 | ps4PlayTogetherPlayerCount: 0 439 | ps4EnterButtonAssignment: 2 440 | ps4ApplicationParam1: 0 441 | ps4ApplicationParam2: 0 442 | ps4ApplicationParam3: 0 443 | ps4ApplicationParam4: 0 444 | ps4DownloadDataSize: 0 445 | ps4GarlicHeapSize: 2048 446 | ps4ProGarlicHeapSize: 2560 447 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 448 | ps4pnSessions: 1 449 | ps4pnPresence: 1 450 | ps4pnFriends: 1 451 | ps4pnGameCustomData: 1 452 | playerPrefsSupport: 0 453 | enableApplicationExit: 0 454 | restrictedAudioUsageRights: 0 455 | ps4UseResolutionFallback: 0 456 | ps4ReprojectionSupport: 0 457 | ps4UseAudio3dBackend: 0 458 | ps4SocialScreenEnabled: 0 459 | ps4ScriptOptimizationLevel: 2 460 | ps4Audio3dVirtualSpeakerCount: 14 461 | ps4attribCpuUsage: 0 462 | ps4PatchPkgPath: 463 | ps4PatchLatestPkgPath: 464 | ps4PatchChangeinfoPath: 465 | ps4PatchDayOne: 0 466 | ps4attribUserManagement: 0 467 | ps4attribMoveSupport: 0 468 | ps4attrib3DSupport: 0 469 | ps4attribShareSupport: 0 470 | ps4attribExclusiveVR: 0 471 | ps4disableAutoHideSplash: 0 472 | ps4videoRecordingFeaturesUsed: 0 473 | ps4contentSearchFeaturesUsed: 0 474 | ps4attribEyeToEyeDistanceSettingVR: 0 475 | ps4IncludedModules: [] 476 | monoEnv: 477 | psp2Splashimage: {fileID: 0} 478 | psp2NPTrophyPackPath: 479 | psp2NPSupportGBMorGJP: 0 480 | psp2NPAgeRating: 12 481 | psp2NPTitleDatPath: 482 | psp2NPCommsID: 483 | psp2NPCommunicationsID: 484 | psp2NPCommsPassphrase: 485 | psp2NPCommsSig: 486 | psp2ParamSfxPath: 487 | psp2ManualPath: 488 | psp2LiveAreaGatePath: 489 | psp2LiveAreaBackroundPath: 490 | psp2LiveAreaPath: 491 | psp2LiveAreaTrialPath: 492 | psp2PatchChangeInfoPath: 493 | psp2PatchOriginalPackage: 494 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 495 | psp2KeystoneFile: 496 | psp2MemoryExpansionMode: 0 497 | psp2DRMType: 0 498 | psp2StorageType: 0 499 | psp2MediaCapacity: 0 500 | psp2DLCConfigPath: 501 | psp2ThumbnailPath: 502 | psp2BackgroundPath: 503 | psp2SoundPath: 504 | psp2TrophyCommId: 505 | psp2TrophyPackagePath: 506 | psp2PackagedResourcesPath: 507 | psp2SaveDataQuota: 10240 508 | psp2ParentalLevel: 1 509 | psp2ShortTitle: Not Set 510 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 511 | psp2Category: 0 512 | psp2MasterVersion: 01.00 513 | psp2AppVersion: 01.00 514 | psp2TVBootMode: 0 515 | psp2EnterButtonAssignment: 2 516 | psp2TVDisableEmu: 0 517 | psp2AllowTwitterDialog: 1 518 | psp2Upgradable: 0 519 | psp2HealthWarning: 0 520 | psp2UseLibLocation: 0 521 | psp2InfoBarOnStartup: 0 522 | psp2InfoBarColor: 0 523 | psp2ScriptOptimizationLevel: 2 524 | splashScreenBackgroundSourceLandscape: {fileID: 0} 525 | splashScreenBackgroundSourcePortrait: {fileID: 0} 526 | spritePackerPolicy: 527 | webGLMemorySize: 256 528 | webGLExceptionSupport: 1 529 | webGLNameFilesAsHashes: 0 530 | webGLDataCaching: 1 531 | webGLDebugSymbols: 0 532 | webGLEmscriptenArgs: 533 | webGLModulesDirectory: 534 | webGLTemplate: APPLICATION:Default 535 | webGLAnalyzeBuildSize: 0 536 | webGLUseEmbeddedResources: 0 537 | webGLCompressionFormat: 1 538 | webGLLinkerTarget: 1 539 | scriptingDefineSymbols: {} 540 | platformArchitecture: {} 541 | scriptingBackend: {} 542 | il2cppCompilerConfiguration: {} 543 | incrementalIl2cppBuild: {} 544 | allowUnsafeCode: 0 545 | additionalIl2CppArgs: 546 | scriptingRuntimeVersion: 1 547 | apiCompatibilityLevelPerPlatform: {} 548 | m_RenderingPath: 1 549 | m_MobileRenderingPath: 1 550 | metroPackageName: FrameCapturer 551 | metroPackageVersion: 552 | metroCertificatePath: 553 | metroCertificatePassword: 554 | metroCertificateSubject: 555 | metroCertificateIssuer: 556 | metroCertificateNotAfter: 0000000000000000 557 | metroApplicationDescription: FrameCapturer 558 | wsaImages: {} 559 | metroTileShortName: 560 | metroTileShowName: 0 561 | metroMediumTileShowName: 0 562 | metroLargeTileShowName: 0 563 | metroWideTileShowName: 0 564 | metroDefaultTileSize: 1 565 | metroTileForegroundText: 2 566 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 567 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 568 | a: 1} 569 | metroSplashScreenUseBackgroundColor: 0 570 | platformCapabilities: {} 571 | metroFTAName: 572 | metroFTAFileTypes: [] 573 | metroProtocolName: 574 | metroCompilationOverrides: 1 575 | n3dsUseExtSaveData: 0 576 | n3dsCompressStaticMem: 1 577 | n3dsExtSaveDataNumber: 0x12345 578 | n3dsStackSize: 131072 579 | n3dsTargetPlatform: 2 580 | n3dsRegion: 7 581 | n3dsMediaSize: 0 582 | n3dsLogoStyle: 3 583 | n3dsTitle: GameName 584 | n3dsProductCode: 585 | n3dsApplicationId: 0xFF3FF 586 | XboxOneProductId: 587 | XboxOneUpdateKey: 588 | XboxOneSandboxId: 589 | XboxOneContentId: 590 | XboxOneTitleId: 591 | XboxOneSCId: 592 | XboxOneGameOsOverridePath: 593 | XboxOnePackagingOverridePath: 594 | XboxOneAppManifestOverridePath: 595 | XboxOneVersion: 1.0.0.0 596 | XboxOnePackageEncryption: 0 597 | XboxOnePackageUpdateGranularity: 2 598 | XboxOneDescription: 599 | XboxOneLanguage: 600 | - enus 601 | XboxOneCapability: [] 602 | XboxOneGameRating: {} 603 | XboxOneIsContentPackage: 0 604 | XboxOneEnableGPUVariability: 1 605 | XboxOneSockets: {} 606 | XboxOneSplashScreen: {fileID: 0} 607 | XboxOneAllowedProductIds: [] 608 | XboxOnePersistentLocalStorageSize: 0 609 | XboxOneXTitleMemory: 8 610 | xboxOneScriptCompiler: 0 611 | vrEditorSettings: 612 | daydream: 613 | daydreamIconForeground: {fileID: 0} 614 | daydreamIconBackground: {fileID: 0} 615 | cloudServicesEnabled: {} 616 | facebookSdkVersion: 7.9.4 617 | apiCompatibilityLevel: 3 618 | cloudProjectId: 619 | projectName: 620 | organizationId: 621 | cloudEnabled: 0 622 | enableNativePlatformBackendsForNewInputSystem: 0 623 | disableOldInputManagerSupport: 0 624 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.2.0f2 2 | -------------------------------------------------------------------------------- /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: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 4 41 | resolutionScalingFixedDPIFactor: 1 42 | excludedTargetPlatforms: [] 43 | - serializedVersion: 2 44 | name: Low 45 | pixelLightCount: 0 46 | shadows: 0 47 | shadowResolution: 0 48 | shadowProjection: 1 49 | shadowCascades: 1 50 | shadowDistance: 20 51 | shadowNearPlaneOffset: 3 52 | shadowCascade2Split: 0.33333334 53 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 54 | shadowmaskMode: 0 55 | blendWeights: 2 56 | textureQuality: 0 57 | anisotropicTextures: 0 58 | antiAliasing: 0 59 | softParticles: 0 60 | softVegetation: 0 61 | realtimeReflectionProbes: 0 62 | billboardsFaceCameraPosition: 0 63 | vSyncCount: 0 64 | lodBias: 0.4 65 | maximumLODLevel: 0 66 | streamingMipmapsActive: 0 67 | streamingMipmapsAddAllCameras: 1 68 | streamingMipmapsMemoryBudget: 512 69 | streamingMipmapsRenderersPerFrame: 512 70 | streamingMipmapsMaxLevelReduction: 2 71 | streamingMipmapsMaxFileIORequests: 1024 72 | particleRaycastBudget: 16 73 | asyncUploadTimeSlice: 2 74 | asyncUploadBufferSize: 4 75 | resolutionScalingFixedDPIFactor: 1 76 | excludedTargetPlatforms: [] 77 | - serializedVersion: 2 78 | name: Medium 79 | pixelLightCount: 1 80 | shadows: 1 81 | shadowResolution: 0 82 | shadowProjection: 1 83 | shadowCascades: 1 84 | shadowDistance: 20 85 | shadowNearPlaneOffset: 3 86 | shadowCascade2Split: 0.33333334 87 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 88 | shadowmaskMode: 0 89 | blendWeights: 2 90 | textureQuality: 0 91 | anisotropicTextures: 1 92 | antiAliasing: 0 93 | softParticles: 0 94 | softVegetation: 0 95 | realtimeReflectionProbes: 0 96 | billboardsFaceCameraPosition: 0 97 | vSyncCount: 1 98 | lodBias: 0.7 99 | maximumLODLevel: 0 100 | streamingMipmapsActive: 0 101 | streamingMipmapsAddAllCameras: 1 102 | streamingMipmapsMemoryBudget: 512 103 | streamingMipmapsRenderersPerFrame: 512 104 | streamingMipmapsMaxLevelReduction: 2 105 | streamingMipmapsMaxFileIORequests: 1024 106 | particleRaycastBudget: 64 107 | asyncUploadTimeSlice: 2 108 | asyncUploadBufferSize: 4 109 | resolutionScalingFixedDPIFactor: 1 110 | excludedTargetPlatforms: [] 111 | - serializedVersion: 2 112 | name: High 113 | pixelLightCount: 2 114 | shadows: 2 115 | shadowResolution: 1 116 | shadowProjection: 1 117 | shadowCascades: 2 118 | shadowDistance: 40 119 | shadowNearPlaneOffset: 3 120 | shadowCascade2Split: 0.33333334 121 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 122 | shadowmaskMode: 1 123 | blendWeights: 2 124 | textureQuality: 0 125 | anisotropicTextures: 1 126 | antiAliasing: 0 127 | softParticles: 0 128 | softVegetation: 1 129 | realtimeReflectionProbes: 1 130 | billboardsFaceCameraPosition: 1 131 | vSyncCount: 1 132 | lodBias: 1 133 | maximumLODLevel: 0 134 | streamingMipmapsActive: 0 135 | streamingMipmapsAddAllCameras: 1 136 | streamingMipmapsMemoryBudget: 512 137 | streamingMipmapsRenderersPerFrame: 512 138 | streamingMipmapsMaxLevelReduction: 2 139 | streamingMipmapsMaxFileIORequests: 1024 140 | particleRaycastBudget: 256 141 | asyncUploadTimeSlice: 2 142 | asyncUploadBufferSize: 4 143 | resolutionScalingFixedDPIFactor: 1 144 | excludedTargetPlatforms: [] 145 | - serializedVersion: 2 146 | name: Very High 147 | pixelLightCount: 3 148 | shadows: 2 149 | shadowResolution: 2 150 | shadowProjection: 1 151 | shadowCascades: 2 152 | shadowDistance: 70 153 | shadowNearPlaneOffset: 3 154 | shadowCascade2Split: 0.33333334 155 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 156 | shadowmaskMode: 1 157 | blendWeights: 4 158 | textureQuality: 0 159 | anisotropicTextures: 2 160 | antiAliasing: 2 161 | softParticles: 1 162 | softVegetation: 1 163 | realtimeReflectionProbes: 1 164 | billboardsFaceCameraPosition: 1 165 | vSyncCount: 1 166 | lodBias: 1.5 167 | maximumLODLevel: 0 168 | streamingMipmapsActive: 0 169 | streamingMipmapsAddAllCameras: 1 170 | streamingMipmapsMemoryBudget: 512 171 | streamingMipmapsRenderersPerFrame: 512 172 | streamingMipmapsMaxLevelReduction: 2 173 | streamingMipmapsMaxFileIORequests: 1024 174 | particleRaycastBudget: 1024 175 | asyncUploadTimeSlice: 2 176 | asyncUploadBufferSize: 4 177 | resolutionScalingFixedDPIFactor: 1 178 | excludedTargetPlatforms: [] 179 | - serializedVersion: 2 180 | name: Ultra 181 | pixelLightCount: 4 182 | shadows: 2 183 | shadowResolution: 2 184 | shadowProjection: 1 185 | shadowCascades: 4 186 | shadowDistance: 150 187 | shadowNearPlaneOffset: 3 188 | shadowCascade2Split: 0.33333334 189 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 190 | shadowmaskMode: 1 191 | blendWeights: 4 192 | textureQuality: 0 193 | anisotropicTextures: 2 194 | antiAliasing: 2 195 | softParticles: 1 196 | softVegetation: 1 197 | realtimeReflectionProbes: 1 198 | billboardsFaceCameraPosition: 1 199 | vSyncCount: 1 200 | lodBias: 2 201 | maximumLODLevel: 0 202 | streamingMipmapsActive: 0 203 | streamingMipmapsAddAllCameras: 1 204 | streamingMipmapsMemoryBudget: 512 205 | streamingMipmapsRenderersPerFrame: 512 206 | streamingMipmapsMaxLevelReduction: 2 207 | streamingMipmapsMaxFileIORequests: 1024 208 | particleRaycastBudget: 4096 209 | asyncUploadTimeSlice: 2 210 | asyncUploadBufferSize: 4 211 | resolutionScalingFixedDPIFactor: 1 212 | excludedTargetPlatforms: [] 213 | m_PerPlatformDefaultQuality: 214 | Android: 2 215 | Nintendo 3DS: 5 216 | Nintendo Switch: 5 217 | PS4: 5 218 | PSP2: 2 219 | Standalone: 5 220 | WebGL: 3 221 | Windows Store Apps: 5 222 | XboxOne: 5 223 | iPhone: 2 224 | tvOS: 2 225 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/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 | -------------------------------------------------------------------------------- /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 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NOTE # 2 | This repo is deprecated and may not work with newer versions of ML Agents. The most recent change will be compatible with v0.14.0. 3 | 4 | # ML-Agents VideoRecorder plugin 5 | This is a plugin for [Unity's MLAgents framework](https://github.com/Unity-Technologies/ml-agents) that allows to record videos of a scene at a given frequency. 6 | 7 | It can be used to : 8 | * Understand how the behavior of your agents evolves over time. 9 | * Debug problems that can happen when the environment has been running for a long time. 10 | * Send a video to a friend to brag that your agents are better than them at a video game. 11 | 12 | This repository is based of the [FrameCapturer plugin](https://github.com/unity3d-jp/FrameCapturer), it should work on Windows and Mac. To use it on Linux you will need to compile your own version of the plugin. 13 | At the moment the video recorder is not compatible with the new [Scriptable Render Pipeline](https://docs.unity3d.com/Manual/ScriptableRenderPipeline.html) 14 | 15 | # How to use 16 | 17 | 1. Import this package to your project: [VideoRecorder.unitypackage](https://github.com/Unity-Technologies/video-recorder/raw/master/VideoRecorder.unitypackage) 18 | 2. Add a recording camera to your scene, you can either: 19 | * Create a new camera and add the `VideoRecorder` script to it 20 | * Use the menu (GameObject -> Create Recording Camera), this will clone the main camera in your scene and add the script 21 | 3. Configure the VideoRecorder: 22 | 23 | ![Video Recorder Settings](https://github.com/Unity-Technologies/video-recorder/raw/master/Images/VideoRecorder.png) 24 | 25 | * Output Directory: Where the videos will be saved, it can be either an absolute path or a relative path. 26 | * Duration Unit: The measurement unit for the interval and the duration, either seconds or academy steps. 27 | * Interval: The time we want to wait between each video recording. If the interval is 600 seconds, a new video will start being recorded every 10 minutes. 28 | * Duration: The length of each individual video. Can't be larger than the interval. 29 | * Record in realtime: If you check this and you use a time scale different than 1, the videoRecorder will change the timescale back to 1 while it is recording and then back to the original value the rest of the time. This way your video will show your game at the normal speed, not the accelerated speed during training. Note that this will slow down training speed while the video is recording. 30 | * Resolution: Resolution of the video, can be higher than the resolution of the game window. 31 | * Capture Audio: Should the video contain audio as well? 32 | * Verbose: Log when a recording starts and ends. 33 | 34 | 4. Run your scene ! (At the moment the recording will also happen during inference and in the editor) 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /VideoRecorder.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/video-recorder/fd8ed4a98ae2a6d37dc249acc6a245a79e97905f/VideoRecorder.unitypackage --------------------------------------------------------------------------------