├── .gitattributes ├── .gitignore ├── DOTS_ECS ├── Assets │ ├── GridParticleRenderMaterial.mat │ ├── GridParticleRenderMaterial.mat.meta │ ├── GridParticleRenderingShader.shader │ ├── GridParticleRenderingShader.shader.meta │ ├── ParticlePrefabTag.cs │ ├── ParticlePrefabTag.cs.meta │ ├── SPHSystem.cs │ ├── SPHSystem.cs.meta │ ├── SpatialHashing.cs │ ├── SpatialHashing.cs.meta │ ├── WindowsClassicBuildConfiguration.buildconfiguration │ ├── WindowsClassicBuildConfiguration.buildconfiguration.meta │ ├── lowpolySphere.fbx │ ├── lowpolySphere.fbx.meta │ ├── main.unity │ └── main.unity.meta ├── Packages │ ├── manifest.json │ └── packages-lock.json └── ProjectSettings │ ├── AudioManager.asset │ ├── BurstAotSettings_StandaloneWindows.json │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── TimelineSettings.asset │ ├── URPProjectSettings.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset ├── LICENSE ├── MonoBehaviour_ComputeShader ├── Assets │ ├── ComputeShaderParticleManager.cs │ ├── ComputeShaderParticleManager.cs.meta │ ├── GridParticleRenderMaterial.mat │ ├── GridParticleRenderMaterial.mat.meta │ ├── GridParticleRenderingShader.shader │ ├── GridParticleRenderingShader.shader.meta │ ├── ParticleManager.cs │ ├── ParticleManager.cs.meta │ ├── SPH.unity │ ├── SPH.unity.meta │ ├── SPH3D.compute │ ├── SPH3D.compute.meta │ ├── SpatialHashing.cs │ ├── SpatialHashing.cs.meta │ ├── Sphere.prefab │ ├── Sphere.prefab.meta │ ├── lowpolySphere.fbx │ └── lowpolySphere.fbx.meta ├── Packages │ ├── manifest.json │ └── packages-lock.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.fbx filter=lfs diff=lfs merge=lfs -text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Ll]ogs/ 4 | [Uu]serSettings/ 5 | *.csproj 6 | *.sln 7 | *.user -------------------------------------------------------------------------------- /DOTS_ECS/Assets/GridParticleRenderMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: GridParticleRenderMaterial 11 | m_Shader: {fileID: 4800000, guid: cfc87ef6876f6c24fbe7e1e81a3af748, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/GridParticleRenderMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10724e3ee72a7754baa78fb9216b5a52 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/GridParticleRenderingShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Instanced/GridTestParticleShader" { 2 | Properties{ 3 | _MainTex("Albedo (RGB)", 2D) = "white" {} 4 | _Glossiness("Smoothness", Range(0,1)) = 0.5 5 | _Metallic("Metallic", Range(0,1)) = 0.0 6 | } 7 | SubShader{ 8 | Tags { "RenderType" = "Opaque" } 9 | LOD 200 10 | 11 | CGPROGRAM 12 | // Physically based Standard lighting model 13 | #pragma surface surf Standard addshadow fullforwardshadows 14 | #pragma multi_compile_instancing 15 | #pragma instancing_options procedural:setup 16 | 17 | sampler2D _MainTex; 18 | float _size; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | struct Particle 25 | { 26 | float3 position; 27 | float4 color; // TODO-SATJ: could probably get away with float3 28 | }; 29 | 30 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 31 | StructuredBuffer _particlesBuffer; 32 | #endif 33 | 34 | void setup() 35 | { 36 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 37 | float3 pos = _particlesBuffer[unity_InstanceID].position; 38 | float size = _size; 39 | 40 | unity_ObjectToWorld._11_21_31_41 = float4(size, 0, 0, 0); 41 | unity_ObjectToWorld._12_22_32_42 = float4(0, size, 0, 0); 42 | unity_ObjectToWorld._13_23_33_43 = float4(0, 0, size, 0); 43 | unity_ObjectToWorld._14_24_34_44 = float4(pos.xyz, 1); 44 | unity_WorldToObject = unity_ObjectToWorld; 45 | unity_WorldToObject._14_24_34 *= -1; 46 | unity_WorldToObject._11_22_33 = 1.0f / unity_WorldToObject._11_22_33; 47 | #endif 48 | } 49 | 50 | half _Glossiness; 51 | half _Metallic; 52 | 53 | void surf(Input IN, inout SurfaceOutputStandard o) { 54 | float4 col = float4(1, 1, 1, 1); 55 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 56 | col = _particlesBuffer[unity_InstanceID].color; 57 | #endif 58 | o.Albedo = col.rgb; 59 | o.Metallic = _Metallic; 60 | o.Smoothness = _Glossiness; 61 | o.Alpha = col.a; 62 | } 63 | ENDCG 64 | } 65 | FallBack "Diffuse" 66 | } -------------------------------------------------------------------------------- /DOTS_ECS/Assets/GridParticleRenderingShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfc87ef6876f6c24fbe7e1e81a3af748 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/ParticlePrefabTag.cs: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | [GenerateAuthoringComponent] 4 | public struct ParticlePrefabTag : IComponentData 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/ParticlePrefabTag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9d15c02487828446a7bdb34d7fe472e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/SPHSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 394990860f6a78d4aac7de3c885d925a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/SpatialHashing.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public static class SpatialHashing 4 | { 5 | public static float CellSize = 1f; 6 | public static int Dimensions = 10; 7 | 8 | public static Vector3Int GetCell(Vector3 position, float cellSize) 9 | { 10 | return new Vector3Int((int)( position.x / cellSize ), (int)( position.y / cellSize ), (int)( position.z / cellSize )); 11 | } 12 | 13 | public static int Hash(Vector3Int cell, int dimensions) 14 | { 15 | return cell.x + dimensions * ( cell.y + dimensions * cell.z ); 16 | } 17 | } -------------------------------------------------------------------------------- /DOTS_ECS/Assets/SpatialHashing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bce9b305ec680f4d8e94af356ac0423 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/WindowsClassicBuildConfiguration.buildconfiguration: -------------------------------------------------------------------------------- 1 | { 2 | "Dependencies": [], 3 | "Components": [ 4 | { 5 | "$type": "Unity.Build.Common.GeneralSettings, Unity.Build", 6 | "ProductName": "ECS SPH", 7 | "CompanyName": "Johannes Schatteiner", 8 | "Version": "1.0.0" 9 | }, 10 | { 11 | "$type": "Unity.Build.Common.SceneList, Unity.Build", 12 | "$version": 1, 13 | "BuildCurrentScene": true, 14 | "SceneInfos": [] 15 | }, 16 | { 17 | "$type": "Unity.Build.Classic.ClassicBuildProfile, Unity.Build.Classic", 18 | "$version": 1, 19 | "Platform": "win", 20 | "Configuration": 3 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /DOTS_ECS/Assets/WindowsClassicBuildConfiguration.buildconfiguration.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5513e8f40de6d6448c09da867255619 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 627ef77bce55554428c21a56f59002bd, type: 3} 11 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/lowpolySphere.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78eda8cbd56ebd5ad3430f2234135a44c1c50470a0a8b6af41d20752004df1ab 3 | size 22016 4 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/lowpolySphere.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46edfd622fe25d8468a2bb65f746161e 3 | ModelImporter: 4 | serializedVersion: 20101 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 1 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | sortHierarchyByName: 1 42 | importVisibility: 1 43 | importBlendShapes: 1 44 | importCameras: 1 45 | importLights: 1 46 | fileIdsGeneration: 2 47 | swapUVChannels: 0 48 | generateSecondaryUV: 0 49 | useFileUnits: 1 50 | keepQuads: 0 51 | weldVertices: 1 52 | bakeAxisConversion: 0 53 | preserveHierarchy: 0 54 | skinWeightsMode: 0 55 | maxBonesPerVertex: 4 56 | minBoneWeight: 0.001 57 | meshOptimizationFlags: -1 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVMarginMethod: 1 63 | secondaryUVMinLightmapResolution: 40 64 | secondaryUVMinObjectScale: 1 65 | secondaryUVPackMargin: 4 66 | useFileScale: 1 67 | tangentSpace: 68 | normalSmoothAngle: 60 69 | normalImportMode: 0 70 | tangentImportMode: 3 71 | normalCalculationMode: 4 72 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 73 | blendShapeNormalImportMode: 1 74 | normalSmoothingSource: 0 75 | referencedClips: [] 76 | importAnimation: 1 77 | humanDescription: 78 | serializedVersion: 3 79 | human: [] 80 | skeleton: [] 81 | armTwist: 0.5 82 | foreArmTwist: 0.5 83 | upperLegTwist: 0.5 84 | legTwist: 0.5 85 | armStretch: 0.05 86 | legStretch: 0.05 87 | feetSpacing: 0 88 | globalScale: 1 89 | rootMotionBoneName: 90 | hasTranslationDoF: 0 91 | hasExtraRoot: 0 92 | skeletonHasParents: 1 93 | lastHumanDescriptionAvatarSource: {instanceID: 0} 94 | autoGenerateAvatarMappingIfUnspecified: 1 95 | animationType: 2 96 | humanoidOversampling: 1 97 | avatarSetup: 0 98 | additionalBone: 0 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/main.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &772986785 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 772986787} 135 | - component: {fileID: 772986786} 136 | m_Layer: 0 137 | m_Name: Directional Light 138 | m_TagString: Untagged 139 | m_Icon: {fileID: 0} 140 | m_NavMeshLayer: 0 141 | m_StaticEditorFlags: 0 142 | m_IsActive: 1 143 | --- !u!108 &772986786 144 | Light: 145 | m_ObjectHideFlags: 0 146 | m_CorrespondingSourceObject: {fileID: 0} 147 | m_PrefabInstance: {fileID: 0} 148 | m_PrefabAsset: {fileID: 0} 149 | m_GameObject: {fileID: 772986785} 150 | m_Enabled: 1 151 | serializedVersion: 10 152 | m_Type: 1 153 | m_Shape: 0 154 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 155 | m_Intensity: 1 156 | m_Range: 10 157 | m_SpotAngle: 30 158 | m_InnerSpotAngle: 21.80208 159 | m_CookieSize: 10 160 | m_Shadows: 161 | m_Type: 2 162 | m_Resolution: -1 163 | m_CustomResolution: -1 164 | m_Strength: 1 165 | m_Bias: 0.05 166 | m_NormalBias: 0.4 167 | m_NearPlane: 0.2 168 | m_CullingMatrixOverride: 169 | e00: 1 170 | e01: 0 171 | e02: 0 172 | e03: 0 173 | e10: 0 174 | e11: 1 175 | e12: 0 176 | e13: 0 177 | e20: 0 178 | e21: 0 179 | e22: 1 180 | e23: 0 181 | e30: 0 182 | e31: 0 183 | e32: 0 184 | e33: 1 185 | m_UseCullingMatrixOverride: 0 186 | m_Cookie: {fileID: 0} 187 | m_DrawHalo: 0 188 | m_Flare: {fileID: 0} 189 | m_RenderMode: 0 190 | m_CullingMask: 191 | serializedVersion: 2 192 | m_Bits: 4294967295 193 | m_RenderingLayerMask: 1 194 | m_Lightmapping: 4 195 | m_LightShadowCasterMode: 0 196 | m_AreaSize: {x: 1, y: 1} 197 | m_BounceIntensity: 1 198 | m_ColorTemperature: 6570 199 | m_UseColorTemperature: 0 200 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 201 | m_UseBoundingSphereOverride: 0 202 | m_ShadowRadius: 0 203 | m_ShadowAngle: 0 204 | --- !u!4 &772986787 205 | Transform: 206 | m_ObjectHideFlags: 0 207 | m_CorrespondingSourceObject: {fileID: 0} 208 | m_PrefabInstance: {fileID: 0} 209 | m_PrefabAsset: {fileID: 0} 210 | m_GameObject: {fileID: 772986785} 211 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 212 | m_LocalPosition: {x: 0, y: 3, z: 0} 213 | m_LocalScale: {x: 1, y: 1, z: 1} 214 | m_Children: [] 215 | m_Father: {fileID: 0} 216 | m_RootOrder: 1 217 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 218 | --- !u!1001 &988435216 219 | PrefabInstance: 220 | m_ObjectHideFlags: 0 221 | serializedVersion: 2 222 | m_Modification: 223 | m_TransformParent: {fileID: 0} 224 | m_Modifications: 225 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 226 | propertyPath: m_LocalPosition.x 227 | value: -0 228 | objectReference: {fileID: 0} 229 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 230 | propertyPath: m_LocalPosition.y 231 | value: 0 232 | objectReference: {fileID: 0} 233 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 234 | propertyPath: m_LocalPosition.z 235 | value: 0 236 | objectReference: {fileID: 0} 237 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 238 | propertyPath: m_LocalRotation.x 239 | value: 0 240 | objectReference: {fileID: 0} 241 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 242 | propertyPath: m_LocalRotation.y 243 | value: -0 244 | objectReference: {fileID: 0} 245 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 246 | propertyPath: m_LocalRotation.z 247 | value: -0 248 | objectReference: {fileID: 0} 249 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 250 | propertyPath: m_LocalRotation.w 251 | value: 1 252 | objectReference: {fileID: 0} 253 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 254 | propertyPath: m_RootOrder 255 | value: 2 256 | objectReference: {fileID: 0} 257 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 258 | propertyPath: m_LocalEulerAnglesHint.x 259 | value: 0 260 | objectReference: {fileID: 0} 261 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 262 | propertyPath: m_LocalEulerAnglesHint.y 263 | value: 0 264 | objectReference: {fileID: 0} 265 | - target: {fileID: -8679921383154817045, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 266 | propertyPath: m_LocalEulerAnglesHint.z 267 | value: 0 268 | objectReference: {fileID: 0} 269 | - target: {fileID: -7511558181221131132, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 270 | propertyPath: m_Materials.Array.data[0] 271 | value: 272 | objectReference: {fileID: 2100000, guid: 10724e3ee72a7754baa78fb9216b5a52, type: 2} 273 | - target: {fileID: 919132149155446097, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 274 | propertyPath: m_Name 275 | value: lowpolySphere 276 | objectReference: {fileID: 0} 277 | m_RemovedComponents: [] 278 | m_SourcePrefab: {fileID: 100100000, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 279 | --- !u!1 &988435217 stripped 280 | GameObject: 281 | m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 46edfd622fe25d8468a2bb65f746161e, type: 3} 282 | m_PrefabInstance: {fileID: 988435216} 283 | m_PrefabAsset: {fileID: 0} 284 | --- !u!114 &988435218 285 | MonoBehaviour: 286 | m_ObjectHideFlags: 0 287 | m_CorrespondingSourceObject: {fileID: 0} 288 | m_PrefabInstance: {fileID: 0} 289 | m_PrefabAsset: {fileID: 0} 290 | m_GameObject: {fileID: 988435217} 291 | m_Enabled: 1 292 | m_EditorHideFlags: 0 293 | m_Script: {fileID: 11500000, guid: ea7d7495833204790ba1d3a8755397f8, type: 3} 294 | m_Name: 295 | m_EditorClassIdentifier: 296 | ConversionMode: 0 297 | --- !u!114 &988435219 298 | MonoBehaviour: 299 | m_ObjectHideFlags: 0 300 | m_CorrespondingSourceObject: {fileID: 0} 301 | m_PrefabInstance: {fileID: 0} 302 | m_PrefabAsset: {fileID: 0} 303 | m_GameObject: {fileID: 988435217} 304 | m_Enabled: 1 305 | m_EditorHideFlags: 0 306 | m_Script: {fileID: 11500000, guid: f9d15c02487828446a7bdb34d7fe472e, type: 3} 307 | m_Name: 308 | m_EditorClassIdentifier: 309 | --- !u!1 &1781271220 310 | GameObject: 311 | m_ObjectHideFlags: 0 312 | m_CorrespondingSourceObject: {fileID: 0} 313 | m_PrefabInstance: {fileID: 0} 314 | m_PrefabAsset: {fileID: 0} 315 | serializedVersion: 6 316 | m_Component: 317 | - component: {fileID: 1781271223} 318 | - component: {fileID: 1781271222} 319 | - component: {fileID: 1781271221} 320 | m_Layer: 0 321 | m_Name: Main Camera 322 | m_TagString: MainCamera 323 | m_Icon: {fileID: 0} 324 | m_NavMeshLayer: 0 325 | m_StaticEditorFlags: 0 326 | m_IsActive: 1 327 | --- !u!81 &1781271221 328 | AudioListener: 329 | m_ObjectHideFlags: 0 330 | m_CorrespondingSourceObject: {fileID: 0} 331 | m_PrefabInstance: {fileID: 0} 332 | m_PrefabAsset: {fileID: 0} 333 | m_GameObject: {fileID: 1781271220} 334 | m_Enabled: 1 335 | --- !u!20 &1781271222 336 | Camera: 337 | m_ObjectHideFlags: 0 338 | m_CorrespondingSourceObject: {fileID: 0} 339 | m_PrefabInstance: {fileID: 0} 340 | m_PrefabAsset: {fileID: 0} 341 | m_GameObject: {fileID: 1781271220} 342 | m_Enabled: 1 343 | serializedVersion: 2 344 | m_ClearFlags: 2 345 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 346 | m_projectionMatrixMode: 1 347 | m_GateFitMode: 2 348 | m_FOVAxisMode: 0 349 | m_SensorSize: {x: 36, y: 24} 350 | m_LensShift: {x: 0, y: 0} 351 | m_FocalLength: 50 352 | m_NormalizedViewPortRect: 353 | serializedVersion: 2 354 | x: 0 355 | y: 0 356 | width: 1 357 | height: 1 358 | near clip plane: 0.3 359 | far clip plane: 1000 360 | field of view: 60 361 | orthographic: 0 362 | orthographic size: 5 363 | m_Depth: -1 364 | m_CullingMask: 365 | serializedVersion: 2 366 | m_Bits: 4294967295 367 | m_RenderingPath: -1 368 | m_TargetTexture: {fileID: 0} 369 | m_TargetDisplay: 0 370 | m_TargetEye: 3 371 | m_HDR: 1 372 | m_AllowMSAA: 1 373 | m_AllowDynamicResolution: 0 374 | m_ForceIntoRT: 0 375 | m_OcclusionCulling: 1 376 | m_StereoConvergence: 10 377 | m_StereoSeparation: 0.022 378 | --- !u!4 &1781271223 379 | Transform: 380 | m_ObjectHideFlags: 0 381 | m_CorrespondingSourceObject: {fileID: 0} 382 | m_PrefabInstance: {fileID: 0} 383 | m_PrefabAsset: {fileID: 0} 384 | m_GameObject: {fileID: 1781271220} 385 | m_LocalRotation: {x: -0.14858186, y: 0.38802373, z: -0.06353792, w: -0.907372} 386 | m_LocalPosition: {x: 134.18073, y: 39.99636, z: -26.652863} 387 | m_LocalScale: {x: 1, y: 1, z: 1} 388 | m_Children: [] 389 | m_Father: {fileID: 0} 390 | m_RootOrder: 0 391 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 392 | -------------------------------------------------------------------------------- /DOTS_ECS/Assets/main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60ff3dc0346e4eb45918aba555aa4c09 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /DOTS_ECS/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.3.8", 4 | "com.unity.entities": "0.16.0-preview.21", 5 | "com.unity.ide.rider": "1.2.1", 6 | "com.unity.ide.visualstudio": "2.0.2", 7 | "com.unity.ide.vscode": "1.2.1", 8 | "com.unity.platforms.windows": "0.10.0-preview.10", 9 | "com.unity.render-pipelines.universal": "8.2.0", 10 | "com.unity.rendering.hybrid": "0.11.0-preview.43", 11 | "com.unity.test-framework": "1.1.16", 12 | "com.unity.textmeshpro": "3.0.1", 13 | "com.unity.timeline": "1.3.4", 14 | "com.unity.ugui": "1.0.0", 15 | "com.unity.modules.ai": "1.0.0", 16 | "com.unity.modules.androidjni": "1.0.0", 17 | "com.unity.modules.animation": "1.0.0", 18 | "com.unity.modules.assetbundle": "1.0.0", 19 | "com.unity.modules.audio": "1.0.0", 20 | "com.unity.modules.cloth": "1.0.0", 21 | "com.unity.modules.director": "1.0.0", 22 | "com.unity.modules.imageconversion": "1.0.0", 23 | "com.unity.modules.imgui": "1.0.0", 24 | "com.unity.modules.jsonserialize": "1.0.0", 25 | "com.unity.modules.particlesystem": "1.0.0", 26 | "com.unity.modules.physics": "1.0.0", 27 | "com.unity.modules.physics2d": "1.0.0", 28 | "com.unity.modules.screencapture": "1.0.0", 29 | "com.unity.modules.terrain": "1.0.0", 30 | "com.unity.modules.terrainphysics": "1.0.0", 31 | "com.unity.modules.tilemap": "1.0.0", 32 | "com.unity.modules.ui": "1.0.0", 33 | "com.unity.modules.uielements": "1.0.0", 34 | "com.unity.modules.umbra": "1.0.0", 35 | "com.unity.modules.unityanalytics": "1.0.0", 36 | "com.unity.modules.unitywebrequest": "1.0.0", 37 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 38 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 39 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 40 | "com.unity.modules.unitywebrequestwww": "1.0.0", 41 | "com.unity.modules.vehicles": "1.0.0", 42 | "com.unity.modules.video": "1.0.0", 43 | "com.unity.modules.vr": "1.0.0", 44 | "com.unity.modules.wind": "1.0.0", 45 | "com.unity.modules.xr": "1.0.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DOTS_ECS/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.burst": { 4 | "version": "1.4.1", 5 | "depth": 2, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.mathematics": "1.2.1" 9 | }, 10 | "url": "https://packages.unity.com" 11 | }, 12 | "com.unity.collab-proxy": { 13 | "version": "1.3.8", 14 | "depth": 0, 15 | "source": "registry", 16 | "dependencies": {}, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.collections": { 20 | "version": "0.15.0-preview.21", 21 | "depth": 2, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.test-framework.performance": "2.3.1-preview", 25 | "com.unity.burst": "1.4.1" 26 | }, 27 | "url": "https://packages.unity.com" 28 | }, 29 | "com.unity.entities": { 30 | "version": "0.17.0-preview.41", 31 | "depth": 1, 32 | "source": "registry", 33 | "dependencies": { 34 | "com.unity.burst": "1.4.1", 35 | "com.unity.properties": "1.5.0-preview", 36 | "com.unity.serialization": "1.5.0-preview", 37 | "com.unity.collections": "0.15.0-preview.21", 38 | "com.unity.mathematics": "1.2.1", 39 | "com.unity.modules.assetbundle": "1.0.0", 40 | "com.unity.test-framework.performance": "2.3.1-preview", 41 | "com.unity.nuget.mono-cecil": "0.1.6-preview.2", 42 | "com.unity.jobs": "0.8.0-preview.23", 43 | "com.unity.scriptablebuildpipeline": "1.9.0", 44 | "com.unity.platforms": "0.10.0-preview.10" 45 | }, 46 | "url": "https://packages.unity.com" 47 | }, 48 | "com.unity.ext.nunit": { 49 | "version": "1.0.0", 50 | "depth": 1, 51 | "source": "registry", 52 | "dependencies": {}, 53 | "url": "https://packages.unity.com" 54 | }, 55 | "com.unity.ide.rider": { 56 | "version": "1.2.1", 57 | "depth": 0, 58 | "source": "registry", 59 | "dependencies": { 60 | "com.unity.test-framework": "1.1.1" 61 | }, 62 | "url": "https://packages.unity.com" 63 | }, 64 | "com.unity.ide.visualstudio": { 65 | "version": "2.0.2", 66 | "depth": 0, 67 | "source": "registry", 68 | "dependencies": {}, 69 | "url": "https://packages.unity.com" 70 | }, 71 | "com.unity.ide.vscode": { 72 | "version": "1.2.1", 73 | "depth": 0, 74 | "source": "registry", 75 | "dependencies": {}, 76 | "url": "https://packages.unity.com" 77 | }, 78 | "com.unity.jobs": { 79 | "version": "0.8.0-preview.23", 80 | "depth": 2, 81 | "source": "registry", 82 | "dependencies": { 83 | "com.unity.collections": "0.15.0-preview.21", 84 | "com.unity.mathematics": "1.2.1" 85 | }, 86 | "url": "https://packages.unity.com" 87 | }, 88 | "com.unity.mathematics": { 89 | "version": "1.2.1", 90 | "depth": 1, 91 | "source": "registry", 92 | "dependencies": {}, 93 | "url": "https://packages.unity.com" 94 | }, 95 | "com.unity.nuget.mono-cecil": { 96 | "version": "0.1.6-preview.2", 97 | "depth": 1, 98 | "source": "registry", 99 | "dependencies": { 100 | "nuget.mono-cecil": "0.1.6-preview" 101 | }, 102 | "url": "https://packages.unity.com" 103 | }, 104 | "com.unity.nuget.newtonsoft-json": { 105 | "version": "2.0.0-preview", 106 | "depth": 2, 107 | "source": "registry", 108 | "dependencies": {}, 109 | "url": "https://packages.unity.com" 110 | }, 111 | "com.unity.platforms": { 112 | "version": "0.10.0-preview.10", 113 | "depth": 1, 114 | "source": "registry", 115 | "dependencies": { 116 | "com.unity.properties": "1.6.0-preview", 117 | "com.unity.properties.ui": "1.6.2-preview.1", 118 | "com.unity.scriptablebuildpipeline": "1.6.4-preview", 119 | "com.unity.serialization": "1.6.2-preview" 120 | }, 121 | "url": "https://packages.unity.com" 122 | }, 123 | "com.unity.platforms.desktop": { 124 | "version": "0.10.0-preview.10", 125 | "depth": 1, 126 | "source": "registry", 127 | "dependencies": { 128 | "com.unity.platforms": "0.10.0-preview.10" 129 | }, 130 | "url": "https://packages.unity.com" 131 | }, 132 | "com.unity.platforms.windows": { 133 | "version": "0.10.0-preview.10", 134 | "depth": 0, 135 | "source": "registry", 136 | "dependencies": { 137 | "com.unity.platforms": "0.10.0-preview.10", 138 | "com.unity.platforms.desktop": "0.10.0-preview.10" 139 | }, 140 | "url": "https://packages.unity.com" 141 | }, 142 | "com.unity.properties": { 143 | "version": "1.6.0-preview", 144 | "depth": 2, 145 | "source": "registry", 146 | "dependencies": { 147 | "com.unity.nuget.mono-cecil": "0.1.6-preview.2", 148 | "com.unity.test-framework.performance": "2.3.1-preview" 149 | }, 150 | "url": "https://packages.unity.com" 151 | }, 152 | "com.unity.properties.ui": { 153 | "version": "1.6.2-preview.1", 154 | "depth": 2, 155 | "source": "registry", 156 | "dependencies": { 157 | "com.unity.properties": "1.6.0-preview", 158 | "com.unity.serialization": "1.6.1-preview", 159 | "com.unity.modules.uielements": "1.0.0" 160 | }, 161 | "url": "https://packages.unity.com" 162 | }, 163 | "com.unity.render-pipelines.core": { 164 | "version": "8.2.0", 165 | "depth": 1, 166 | "source": "registry", 167 | "dependencies": { 168 | "com.unity.ugui": "1.0.0" 169 | }, 170 | "url": "https://packages.unity.com" 171 | }, 172 | "com.unity.render-pipelines.universal": { 173 | "version": "8.2.0", 174 | "depth": 0, 175 | "source": "registry", 176 | "dependencies": { 177 | "com.unity.render-pipelines.core": "8.2.0", 178 | "com.unity.shadergraph": "8.2.0" 179 | }, 180 | "url": "https://packages.unity.com" 181 | }, 182 | "com.unity.rendering.hybrid": { 183 | "version": "0.11.0-preview.43", 184 | "depth": 0, 185 | "source": "registry", 186 | "dependencies": { 187 | "com.unity.entities": "0.17.0-preview.41" 188 | }, 189 | "url": "https://packages.unity.com" 190 | }, 191 | "com.unity.scriptablebuildpipeline": { 192 | "version": "1.9.0", 193 | "depth": 1, 194 | "source": "registry", 195 | "dependencies": {}, 196 | "url": "https://packages.unity.com" 197 | }, 198 | "com.unity.searcher": { 199 | "version": "4.0.9", 200 | "depth": 2, 201 | "source": "registry", 202 | "dependencies": {}, 203 | "url": "https://packages.unity.com" 204 | }, 205 | "com.unity.serialization": { 206 | "version": "1.6.2-preview", 207 | "depth": 2, 208 | "source": "registry", 209 | "dependencies": { 210 | "com.unity.collections": "0.12.0-preview.13", 211 | "com.unity.burst": "1.3.5", 212 | "com.unity.jobs": "0.5.0-preview.14", 213 | "com.unity.properties": "1.6.0-preview", 214 | "com.unity.test-framework.performance": "2.3.1-preview" 215 | }, 216 | "url": "https://packages.unity.com" 217 | }, 218 | "com.unity.shadergraph": { 219 | "version": "8.2.0", 220 | "depth": 1, 221 | "source": "registry", 222 | "dependencies": { 223 | "com.unity.render-pipelines.core": "8.2.0", 224 | "com.unity.searcher": "4.0.9" 225 | }, 226 | "url": "https://packages.unity.com" 227 | }, 228 | "com.unity.test-framework": { 229 | "version": "1.1.16", 230 | "depth": 0, 231 | "source": "registry", 232 | "dependencies": { 233 | "com.unity.ext.nunit": "1.0.0", 234 | "com.unity.modules.imgui": "1.0.0", 235 | "com.unity.modules.jsonserialize": "1.0.0" 236 | }, 237 | "url": "https://packages.unity.com" 238 | }, 239 | "com.unity.test-framework.performance": { 240 | "version": "2.3.1-preview", 241 | "depth": 1, 242 | "source": "registry", 243 | "dependencies": { 244 | "com.unity.test-framework": "1.1.0", 245 | "com.unity.nuget.newtonsoft-json": "2.0.0-preview" 246 | }, 247 | "url": "https://packages.unity.com" 248 | }, 249 | "com.unity.textmeshpro": { 250 | "version": "3.0.1", 251 | "depth": 0, 252 | "source": "registry", 253 | "dependencies": { 254 | "com.unity.ugui": "1.0.0" 255 | }, 256 | "url": "https://packages.unity.com" 257 | }, 258 | "com.unity.timeline": { 259 | "version": "1.3.4", 260 | "depth": 0, 261 | "source": "registry", 262 | "dependencies": {}, 263 | "url": "https://packages.unity.com" 264 | }, 265 | "com.unity.ugui": { 266 | "version": "1.0.0", 267 | "depth": 0, 268 | "source": "builtin", 269 | "dependencies": { 270 | "com.unity.modules.ui": "1.0.0", 271 | "com.unity.modules.imgui": "1.0.0" 272 | } 273 | }, 274 | "nuget.mono-cecil": { 275 | "version": "0.1.6-preview", 276 | "depth": 2, 277 | "source": "registry", 278 | "dependencies": {}, 279 | "url": "https://packages.unity.com" 280 | }, 281 | "com.unity.modules.ai": { 282 | "version": "1.0.0", 283 | "depth": 0, 284 | "source": "builtin", 285 | "dependencies": {} 286 | }, 287 | "com.unity.modules.androidjni": { 288 | "version": "1.0.0", 289 | "depth": 0, 290 | "source": "builtin", 291 | "dependencies": {} 292 | }, 293 | "com.unity.modules.animation": { 294 | "version": "1.0.0", 295 | "depth": 0, 296 | "source": "builtin", 297 | "dependencies": {} 298 | }, 299 | "com.unity.modules.assetbundle": { 300 | "version": "1.0.0", 301 | "depth": 0, 302 | "source": "builtin", 303 | "dependencies": {} 304 | }, 305 | "com.unity.modules.audio": { 306 | "version": "1.0.0", 307 | "depth": 0, 308 | "source": "builtin", 309 | "dependencies": {} 310 | }, 311 | "com.unity.modules.cloth": { 312 | "version": "1.0.0", 313 | "depth": 0, 314 | "source": "builtin", 315 | "dependencies": { 316 | "com.unity.modules.physics": "1.0.0" 317 | } 318 | }, 319 | "com.unity.modules.director": { 320 | "version": "1.0.0", 321 | "depth": 0, 322 | "source": "builtin", 323 | "dependencies": { 324 | "com.unity.modules.audio": "1.0.0", 325 | "com.unity.modules.animation": "1.0.0" 326 | } 327 | }, 328 | "com.unity.modules.imageconversion": { 329 | "version": "1.0.0", 330 | "depth": 0, 331 | "source": "builtin", 332 | "dependencies": {} 333 | }, 334 | "com.unity.modules.imgui": { 335 | "version": "1.0.0", 336 | "depth": 0, 337 | "source": "builtin", 338 | "dependencies": {} 339 | }, 340 | "com.unity.modules.jsonserialize": { 341 | "version": "1.0.0", 342 | "depth": 0, 343 | "source": "builtin", 344 | "dependencies": {} 345 | }, 346 | "com.unity.modules.particlesystem": { 347 | "version": "1.0.0", 348 | "depth": 0, 349 | "source": "builtin", 350 | "dependencies": {} 351 | }, 352 | "com.unity.modules.physics": { 353 | "version": "1.0.0", 354 | "depth": 0, 355 | "source": "builtin", 356 | "dependencies": {} 357 | }, 358 | "com.unity.modules.physics2d": { 359 | "version": "1.0.0", 360 | "depth": 0, 361 | "source": "builtin", 362 | "dependencies": {} 363 | }, 364 | "com.unity.modules.screencapture": { 365 | "version": "1.0.0", 366 | "depth": 0, 367 | "source": "builtin", 368 | "dependencies": { 369 | "com.unity.modules.imageconversion": "1.0.0" 370 | } 371 | }, 372 | "com.unity.modules.subsystems": { 373 | "version": "1.0.0", 374 | "depth": 1, 375 | "source": "builtin", 376 | "dependencies": { 377 | "com.unity.modules.jsonserialize": "1.0.0" 378 | } 379 | }, 380 | "com.unity.modules.terrain": { 381 | "version": "1.0.0", 382 | "depth": 0, 383 | "source": "builtin", 384 | "dependencies": {} 385 | }, 386 | "com.unity.modules.terrainphysics": { 387 | "version": "1.0.0", 388 | "depth": 0, 389 | "source": "builtin", 390 | "dependencies": { 391 | "com.unity.modules.physics": "1.0.0", 392 | "com.unity.modules.terrain": "1.0.0" 393 | } 394 | }, 395 | "com.unity.modules.tilemap": { 396 | "version": "1.0.0", 397 | "depth": 0, 398 | "source": "builtin", 399 | "dependencies": { 400 | "com.unity.modules.physics2d": "1.0.0" 401 | } 402 | }, 403 | "com.unity.modules.ui": { 404 | "version": "1.0.0", 405 | "depth": 0, 406 | "source": "builtin", 407 | "dependencies": {} 408 | }, 409 | "com.unity.modules.uielements": { 410 | "version": "1.0.0", 411 | "depth": 0, 412 | "source": "builtin", 413 | "dependencies": { 414 | "com.unity.modules.ui": "1.0.0", 415 | "com.unity.modules.imgui": "1.0.0", 416 | "com.unity.modules.jsonserialize": "1.0.0", 417 | "com.unity.modules.uielementsnative": "1.0.0" 418 | } 419 | }, 420 | "com.unity.modules.uielementsnative": { 421 | "version": "1.0.0", 422 | "depth": 1, 423 | "source": "builtin", 424 | "dependencies": { 425 | "com.unity.modules.ui": "1.0.0", 426 | "com.unity.modules.imgui": "1.0.0", 427 | "com.unity.modules.jsonserialize": "1.0.0" 428 | } 429 | }, 430 | "com.unity.modules.umbra": { 431 | "version": "1.0.0", 432 | "depth": 0, 433 | "source": "builtin", 434 | "dependencies": {} 435 | }, 436 | "com.unity.modules.unityanalytics": { 437 | "version": "1.0.0", 438 | "depth": 0, 439 | "source": "builtin", 440 | "dependencies": { 441 | "com.unity.modules.unitywebrequest": "1.0.0", 442 | "com.unity.modules.jsonserialize": "1.0.0" 443 | } 444 | }, 445 | "com.unity.modules.unitywebrequest": { 446 | "version": "1.0.0", 447 | "depth": 0, 448 | "source": "builtin", 449 | "dependencies": {} 450 | }, 451 | "com.unity.modules.unitywebrequestassetbundle": { 452 | "version": "1.0.0", 453 | "depth": 0, 454 | "source": "builtin", 455 | "dependencies": { 456 | "com.unity.modules.assetbundle": "1.0.0", 457 | "com.unity.modules.unitywebrequest": "1.0.0" 458 | } 459 | }, 460 | "com.unity.modules.unitywebrequestaudio": { 461 | "version": "1.0.0", 462 | "depth": 0, 463 | "source": "builtin", 464 | "dependencies": { 465 | "com.unity.modules.unitywebrequest": "1.0.0", 466 | "com.unity.modules.audio": "1.0.0" 467 | } 468 | }, 469 | "com.unity.modules.unitywebrequesttexture": { 470 | "version": "1.0.0", 471 | "depth": 0, 472 | "source": "builtin", 473 | "dependencies": { 474 | "com.unity.modules.unitywebrequest": "1.0.0", 475 | "com.unity.modules.imageconversion": "1.0.0" 476 | } 477 | }, 478 | "com.unity.modules.unitywebrequestwww": { 479 | "version": "1.0.0", 480 | "depth": 0, 481 | "source": "builtin", 482 | "dependencies": { 483 | "com.unity.modules.unitywebrequest": "1.0.0", 484 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 485 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 486 | "com.unity.modules.audio": "1.0.0", 487 | "com.unity.modules.assetbundle": "1.0.0", 488 | "com.unity.modules.imageconversion": "1.0.0" 489 | } 490 | }, 491 | "com.unity.modules.vehicles": { 492 | "version": "1.0.0", 493 | "depth": 0, 494 | "source": "builtin", 495 | "dependencies": { 496 | "com.unity.modules.physics": "1.0.0" 497 | } 498 | }, 499 | "com.unity.modules.video": { 500 | "version": "1.0.0", 501 | "depth": 0, 502 | "source": "builtin", 503 | "dependencies": { 504 | "com.unity.modules.audio": "1.0.0", 505 | "com.unity.modules.ui": "1.0.0", 506 | "com.unity.modules.unitywebrequest": "1.0.0" 507 | } 508 | }, 509 | "com.unity.modules.vr": { 510 | "version": "1.0.0", 511 | "depth": 0, 512 | "source": "builtin", 513 | "dependencies": { 514 | "com.unity.modules.jsonserialize": "1.0.0", 515 | "com.unity.modules.physics": "1.0.0", 516 | "com.unity.modules.xr": "1.0.0" 517 | } 518 | }, 519 | "com.unity.modules.wind": { 520 | "version": "1.0.0", 521 | "depth": 0, 522 | "source": "builtin", 523 | "dependencies": {} 524 | }, 525 | "com.unity.modules.xr": { 526 | "version": "1.0.0", 527 | "depth": 0, 528 | "source": "builtin", 529 | "dependencies": { 530 | "com.unity.modules.physics": "1.0.0", 531 | "com.unity.modules.jsonserialize": "1.0.0", 532 | "com.unity.modules.subsystems": "1.0.0" 533 | } 534 | } 535 | } 536 | } 537 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/BurstAotSettings_StandaloneWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 3, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "UsePlatformSDKLinker": false, 9 | "CpuMinTargetX32": 0, 10 | "CpuMaxTargetX32": 0, 11 | "CpuMinTargetX64": 0, 12 | "CpuMaxTargetX64": 0, 13 | "CpuTargetsX32": 6, 14 | "CpuTargetsX64": 24 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DOTS_ECS/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 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 7 37 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/main.unity 10 | guid: 60ff3dc0346e4eb45918aba555aa4c09 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_AssetPipelineMode: 1 6 | m_ObjectHideFlags: 0 7 | serializedVersion: 10 8 | m_ExternalVersionControlSupport: Visible Meta Files 9 | m_SerializationMode: 2 10 | m_LineEndingsForNewScripts: 0 11 | m_DefaultBehaviorMode: 0 12 | m_PrefabRegularEnvironment: {fileID: 0} 13 | m_PrefabUIEnvironment: {fileID: 0} 14 | m_SpritePackerMode: 0 15 | m_SpritePackerPaddingPower: 1 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 21 | m_ProjectGenerationRootNamespace: 22 | m_CollabEditorSettings: 23 | inProgressEnabled: 1 24 | m_EnableTextureStreamingInEditMode: 1 25 | m_EnableTextureStreamingInPlayMode: 1 26 | m_AsyncShaderCompilation: 1 27 | m_EnterPlayModeOptionsEnabled: 0 28 | m_EnterPlayModeOptions: 3 29 | m_ShowLightmapResolutionOverlay: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_VideoShadersIncludeMode: 2 32 | m_AlwaysIncludedShaders: 33 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 42 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 43 | m_PreloadedShaders: [] 44 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 45 | m_CustomRenderPipeline: {fileID: 0} 46 | m_TransparencySortMode: 0 47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 48 | m_DefaultRenderingPath: 1 49 | m_DefaultMobileRenderingPath: 1 50 | m_TierSettings: [] 51 | m_LightmapStripping: 0 52 | m_FogStripping: 0 53 | m_InstancingStripping: 0 54 | m_LightmapKeepPlain: 1 55 | m_LightmapKeepDirCombined: 1 56 | m_LightmapKeepDynamicPlain: 1 57 | m_LightmapKeepDynamicDirCombined: 1 58 | m_LightmapKeepShadowMask: 1 59 | m_LightmapKeepSubtractive: 1 60 | m_FogKeepLinear: 1 61 | m_FogKeepExp: 1 62 | m_FogKeepExp2: 1 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 1 65 | m_LightsUseColorTemperature: 0 66 | m_LogWhenShaderIsCompiled: 0 67 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | - serializedVersion: 3 297 | m_Name: Enable Debug Button 1 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: left ctrl 302 | altNegativeButton: 303 | altPositiveButton: joystick button 8 304 | gravity: 0 305 | dead: 0 306 | sensitivity: 0 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | - serializedVersion: 3 313 | m_Name: Enable Debug Button 2 314 | descriptiveName: 315 | descriptiveNegativeName: 316 | negativeButton: 317 | positiveButton: backspace 318 | altNegativeButton: 319 | altPositiveButton: joystick button 9 320 | gravity: 0 321 | dead: 0 322 | sensitivity: 0 323 | snap: 0 324 | invert: 0 325 | type: 0 326 | axis: 0 327 | joyNum: 0 328 | - serializedVersion: 3 329 | m_Name: Debug Reset 330 | descriptiveName: 331 | descriptiveNegativeName: 332 | negativeButton: 333 | positiveButton: left alt 334 | altNegativeButton: 335 | altPositiveButton: joystick button 1 336 | gravity: 0 337 | dead: 0 338 | sensitivity: 0 339 | snap: 0 340 | invert: 0 341 | type: 0 342 | axis: 0 343 | joyNum: 0 344 | - serializedVersion: 3 345 | m_Name: Debug Next 346 | descriptiveName: 347 | descriptiveNegativeName: 348 | negativeButton: 349 | positiveButton: page down 350 | altNegativeButton: 351 | altPositiveButton: joystick button 5 352 | gravity: 0 353 | dead: 0 354 | sensitivity: 0 355 | snap: 0 356 | invert: 0 357 | type: 0 358 | axis: 0 359 | joyNum: 0 360 | - serializedVersion: 3 361 | m_Name: Debug Previous 362 | descriptiveName: 363 | descriptiveNegativeName: 364 | negativeButton: 365 | positiveButton: page up 366 | altNegativeButton: 367 | altPositiveButton: joystick button 4 368 | gravity: 0 369 | dead: 0 370 | sensitivity: 0 371 | snap: 0 372 | invert: 0 373 | type: 0 374 | axis: 0 375 | joyNum: 0 376 | - serializedVersion: 3 377 | m_Name: Debug Validate 378 | descriptiveName: 379 | descriptiveNegativeName: 380 | negativeButton: 381 | positiveButton: return 382 | altNegativeButton: 383 | altPositiveButton: joystick button 0 384 | gravity: 0 385 | dead: 0 386 | sensitivity: 0 387 | snap: 0 388 | invert: 0 389 | type: 0 390 | axis: 0 391 | joyNum: 0 392 | - serializedVersion: 3 393 | m_Name: Debug Persistent 394 | descriptiveName: 395 | descriptiveNegativeName: 396 | negativeButton: 397 | positiveButton: right shift 398 | altNegativeButton: 399 | altPositiveButton: joystick button 2 400 | gravity: 0 401 | dead: 0 402 | sensitivity: 0 403 | snap: 0 404 | invert: 0 405 | type: 0 406 | axis: 0 407 | joyNum: 0 408 | - serializedVersion: 3 409 | m_Name: Debug Multiplier 410 | descriptiveName: 411 | descriptiveNegativeName: 412 | negativeButton: 413 | positiveButton: left shift 414 | altNegativeButton: 415 | altPositiveButton: joystick button 3 416 | gravity: 0 417 | dead: 0 418 | sensitivity: 0 419 | snap: 0 420 | invert: 0 421 | type: 0 422 | axis: 0 423 | joyNum: 0 424 | - serializedVersion: 3 425 | m_Name: Debug Horizontal 426 | descriptiveName: 427 | descriptiveNegativeName: 428 | negativeButton: left 429 | positiveButton: right 430 | altNegativeButton: 431 | altPositiveButton: 432 | gravity: 1000 433 | dead: 0.001 434 | sensitivity: 1000 435 | snap: 0 436 | invert: 0 437 | type: 0 438 | axis: 0 439 | joyNum: 0 440 | - serializedVersion: 3 441 | m_Name: Debug Vertical 442 | descriptiveName: 443 | descriptiveNegativeName: 444 | negativeButton: down 445 | positiveButton: up 446 | altNegativeButton: 447 | altPositiveButton: 448 | gravity: 1000 449 | dead: 0.001 450 | sensitivity: 1000 451 | snap: 0 452 | invert: 0 453 | type: 0 454 | axis: 0 455 | joyNum: 0 456 | - serializedVersion: 3 457 | m_Name: Debug Vertical 458 | descriptiveName: 459 | descriptiveNegativeName: 460 | negativeButton: down 461 | positiveButton: up 462 | altNegativeButton: 463 | altPositiveButton: 464 | gravity: 1000 465 | dead: 0.001 466 | sensitivity: 1000 467 | snap: 0 468 | invert: 0 469 | type: 2 470 | axis: 6 471 | joyNum: 0 472 | - serializedVersion: 3 473 | m_Name: Debug Horizontal 474 | descriptiveName: 475 | descriptiveNegativeName: 476 | negativeButton: left 477 | positiveButton: right 478 | altNegativeButton: 479 | altPositiveButton: 480 | gravity: 1000 481 | dead: 0.001 482 | sensitivity: 1000 483 | snap: 0 484 | invert: 0 485 | type: 2 486 | axis: 5 487 | joyNum: 0 488 | -------------------------------------------------------------------------------- /DOTS_ECS/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 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 1 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | oneTimeWarningShown: 1 19 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: e7689051185d12f4298e1ebb2693a29f, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: e8537455c6c08bd4e8bf0be3707da685, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.1.3f1 2 | m_EditorVersionWithRevision: 2020.1.3f1 (cf5c4788e1d8) 3 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 2 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 20 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 2 22 | textureQuality: 0 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.4 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 16 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 11400000, guid: a31e9f9f9c9d4b9429ed0d1234e22103, type: 2} 44 | excludedTargetPlatforms: [] 45 | - serializedVersion: 2 46 | name: Medium 47 | pixelLightCount: 1 48 | shadows: 1 49 | shadowResolution: 0 50 | shadowProjection: 1 51 | shadowCascades: 1 52 | shadowDistance: 20 53 | shadowNearPlaneOffset: 3 54 | shadowCascade2Split: 0.33333334 55 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 56 | shadowmaskMode: 0 57 | skinWeights: 2 58 | textureQuality: 0 59 | anisotropicTextures: 1 60 | antiAliasing: 0 61 | softParticles: 0 62 | softVegetation: 0 63 | realtimeReflectionProbes: 0 64 | billboardsFaceCameraPosition: 0 65 | vSyncCount: 1 66 | lodBias: 0.7 67 | maximumLODLevel: 0 68 | streamingMipmapsActive: 0 69 | streamingMipmapsAddAllCameras: 1 70 | streamingMipmapsMemoryBudget: 512 71 | streamingMipmapsRenderersPerFrame: 512 72 | streamingMipmapsMaxLevelReduction: 2 73 | streamingMipmapsMaxFileIORequests: 1024 74 | particleRaycastBudget: 64 75 | asyncUploadTimeSlice: 2 76 | asyncUploadBufferSize: 16 77 | asyncUploadPersistentBuffer: 1 78 | resolutionScalingFixedDPIFactor: 1 79 | customRenderPipeline: {fileID: 11400000, guid: d847b876476d3d6468f5dfcd34266f96, type: 2} 80 | excludedTargetPlatforms: [] 81 | - serializedVersion: 2 82 | name: High 83 | pixelLightCount: 2 84 | shadows: 2 85 | shadowResolution: 1 86 | shadowProjection: 1 87 | shadowCascades: 2 88 | shadowDistance: 40 89 | shadowNearPlaneOffset: 3 90 | shadowCascade2Split: 0.33333334 91 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 92 | shadowmaskMode: 1 93 | skinWeights: 2 94 | textureQuality: 0 95 | anisotropicTextures: 1 96 | antiAliasing: 2 97 | softParticles: 0 98 | softVegetation: 1 99 | realtimeReflectionProbes: 1 100 | billboardsFaceCameraPosition: 1 101 | vSyncCount: 0 102 | lodBias: 1 103 | maximumLODLevel: 0 104 | streamingMipmapsActive: 0 105 | streamingMipmapsAddAllCameras: 1 106 | streamingMipmapsMemoryBudget: 512 107 | streamingMipmapsRenderersPerFrame: 512 108 | streamingMipmapsMaxLevelReduction: 2 109 | streamingMipmapsMaxFileIORequests: 1024 110 | particleRaycastBudget: 256 111 | asyncUploadTimeSlice: 2 112 | asyncUploadBufferSize: 16 113 | asyncUploadPersistentBuffer: 1 114 | resolutionScalingFixedDPIFactor: 1 115 | customRenderPipeline: {fileID: 0} 116 | excludedTargetPlatforms: [] 117 | m_PerPlatformDefaultQuality: 118 | Android: 1 119 | Lumin: 2 120 | Nintendo Switch: 2 121 | PS4: 2 122 | Stadia: 2 123 | Standalone: 2 124 | WebGL: 1 125 | Windows Store Apps: 2 126 | XboxOne: 2 127 | iPhone: 1 128 | tvOS: 1 129 | -------------------------------------------------------------------------------- /DOTS_ECS/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 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 1000 16 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/URPProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 2 16 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /DOTS_ECS/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Johannes Schatteiner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/ComputeShaderParticleManager.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using UnityEngine; 3 | using Random = UnityEngine.Random; 4 | 5 | public class ComputeShaderParticleManager : MonoBehaviour 6 | { 7 | [Header("Particle properties")] 8 | public float radius = 1f; // particle radius 9 | public Mesh particleMesh; 10 | public float particleRenderSize = 40f; 11 | public Material material; 12 | public float mass = 4f; 13 | public float gasConstant = 2000.0f; 14 | public float restDensity = 9f; 15 | public float viscosityCoefficient = 2.5f; 16 | public float[] g = { 0.0f, -9.81f * 2000f, 0.0f } ; 17 | public float damping = -0.37f; 18 | public float dt = 0.0008f; 19 | // ReSharper disable InconsistentNaming 20 | private float radius2; 21 | private float radius3; 22 | private float radius4; 23 | private float radius5; 24 | private float mass2; 25 | 26 | [Header("Simulation space properties")] 27 | public int numberOfParticles = 50000; 28 | public int dimensions = 100; 29 | public int maximumParticlesPerCell = 500; 30 | 31 | [Header("Debug information")] 32 | [Tooltip("Tracks how many neighbours each particleIndex has in " + nameof(_neighbourList))] 33 | public int[] _neighbourTracker; 34 | 35 | private Particle[] _particles; 36 | // Too big for feasible serialisation (crash on expand). 37 | private int[] _neighbourList; // Stores all neighbours of a particle aligned at 'particleIndex * maximumParticlesPerCell * 8' 38 | private uint[] _hashGrid; 39 | public uint[] _hashGridTracker; 40 | private float[] _densities; 41 | private float[] _pressures; 42 | private Vector3[] _velocities; 43 | private Vector3[] _forces; 44 | 45 | private ComputeBuffer _particlesBuffer; 46 | private ComputeBuffer _argsBuffer; 47 | private ComputeBuffer _neighbourListBuffer; 48 | private ComputeBuffer _neighbourTrackerBuffer; 49 | private ComputeBuffer _hashGridBuffer; 50 | private ComputeBuffer _hashGridTrackerBuffer; 51 | private ComputeBuffer _densitiesBuffer; 52 | private ComputeBuffer _pressuresBuffer; 53 | private ComputeBuffer _velocitiesBuffer; 54 | private ComputeBuffer _forcesBuffer; 55 | private static readonly int SizeProperty = Shader.PropertyToID("_size"); 56 | private static readonly int ParticlesBufferProperty = Shader.PropertyToID("_particlesBuffer"); 57 | 58 | public ComputeShader computeShader; 59 | private int clearHashGridKernel; 60 | private int recalculateHashGridKernel; 61 | private int buildNeighbourListKernel; 62 | private int computeDensityPressureKernel; 63 | private int computeForcesKernel; 64 | private int integrateKernel; 65 | // ReSharper restore InconsistentNaming 66 | 67 | [Tooltip("The absolute accumulated simulation steps")] 68 | public int elapsedSimulationSteps; 69 | 70 | [StructLayout(LayoutKind.Sequential, Size=28)] 71 | private struct Particle 72 | { 73 | public Vector3 Position; 74 | public Vector4 Color; 75 | } 76 | 77 | private void Awake() 78 | { 79 | radius2 = radius * radius; 80 | radius3 = radius2 * radius; 81 | radius4 = radius3 * radius; 82 | radius5 = radius4 * radius; 83 | mass2 = mass * mass; 84 | 85 | RespawnParticles(); 86 | FindKernels(); 87 | InitComputeShader(); 88 | InitComputeBuffers(); 89 | } 90 | 91 | #region Initialisation 92 | 93 | private void RespawnParticles() 94 | { 95 | _particles = new Particle[numberOfParticles]; 96 | _densities = new float[numberOfParticles]; 97 | _pressures = new float[numberOfParticles]; 98 | _velocities = new Vector3[numberOfParticles]; 99 | _forces = new Vector3[numberOfParticles]; 100 | 101 | int particlesPerDimension = Mathf.CeilToInt(Mathf.Pow(numberOfParticles, 1f / 3f)); 102 | 103 | int counter = 0; 104 | while (counter < numberOfParticles) 105 | { 106 | for (int x = 0; x < particlesPerDimension; x++) 107 | for (int y = 0; y < particlesPerDimension; y++) 108 | for (int z = 0; z < particlesPerDimension; z++) 109 | { 110 | Vector3 startPos = new Vector3(dimensions - 1, dimensions - 1, dimensions - 1) - new Vector3(x / 2f, y / 2f, z / 2f) - new Vector3(Random.Range(0f, 0.01f), Random.Range(0f, 0.01f), Random.Range(0f, 0.01f)); 111 | _particles[counter] = new Particle 112 | { 113 | Position = startPos, 114 | Color = Color.white 115 | }; 116 | _densities[counter] = -1f; 117 | _pressures[counter] = 0.0f; 118 | _forces[counter] = Vector3.zero; 119 | _velocities[counter] = Vector3.down * 50; 120 | 121 | if (++counter == numberOfParticles) 122 | { 123 | return; 124 | } 125 | } 126 | } 127 | } 128 | 129 | private void FindKernels() 130 | { 131 | clearHashGridKernel = computeShader.FindKernel("ClearHashGrid"); 132 | recalculateHashGridKernel = computeShader.FindKernel("RecalculateHashGrid"); 133 | buildNeighbourListKernel = computeShader.FindKernel("BuildNeighbourList"); 134 | computeDensityPressureKernel = computeShader.FindKernel("ComputeDensityPressure"); 135 | computeForcesKernel = computeShader.FindKernel("ComputeForces"); 136 | integrateKernel = computeShader.FindKernel("Integrate"); 137 | } 138 | 139 | private void InitComputeShader() 140 | { 141 | computeShader.SetFloat("CellSize", radius * 2 * 2); // Setting cell-size h to double particle diameter. 142 | computeShader.SetInt("Dimensions", dimensions); 143 | computeShader.SetInt("maximumParticlesPerCell", maximumParticlesPerCell); 144 | computeShader.SetFloat("radius", radius); 145 | computeShader.SetFloat("radius2", radius2); 146 | computeShader.SetFloat("radius3", radius3); 147 | computeShader.SetFloat("radius4", radius4); 148 | computeShader.SetFloat("radius5", radius5); 149 | computeShader.SetFloat("mass", mass); 150 | computeShader.SetFloat("mass2", mass2); 151 | computeShader.SetFloat("gasConstant", gasConstant); 152 | computeShader.SetFloat("restDensity", restDensity); 153 | computeShader.SetFloat("viscosityCoefficient", viscosityCoefficient); 154 | computeShader.SetFloat("damping", damping); 155 | computeShader.SetFloat("dt", dt); 156 | computeShader.SetFloats("g", g); 157 | computeShader.SetFloats("epsilon", Mathf.Epsilon); 158 | computeShader.SetFloats("pi", Mathf.PI); 159 | } 160 | 161 | void InitComputeBuffers() 162 | { 163 | uint[] args = { 164 | particleMesh.GetIndexCount(0), 165 | (uint) numberOfParticles, 166 | particleMesh.GetIndexStart(0), 167 | particleMesh.GetBaseVertex(0), 168 | 0 169 | }; 170 | _argsBuffer = new ComputeBuffer(1, args.Length * sizeof(uint), ComputeBufferType.IndirectArguments); 171 | _argsBuffer.SetData(args); 172 | 173 | _particlesBuffer = new ComputeBuffer(numberOfParticles, sizeof(float) * ( 3 + 4 )); 174 | _particlesBuffer.SetData(_particles); 175 | 176 | _neighbourList = new int[numberOfParticles * maximumParticlesPerCell * 8]; // 8 because we consider 8 cells 177 | _neighbourTracker = new int[numberOfParticles]; 178 | 179 | _hashGrid = new uint[dimensions * dimensions * dimensions * maximumParticlesPerCell]; 180 | _hashGridTracker = new uint[dimensions * dimensions * dimensions]; 181 | 182 | _neighbourListBuffer = new ComputeBuffer(numberOfParticles * maximumParticlesPerCell * 8, sizeof(int)); 183 | _neighbourListBuffer.SetData(_neighbourList); 184 | _neighbourTrackerBuffer = new ComputeBuffer(numberOfParticles, sizeof(int)); 185 | _neighbourTrackerBuffer.SetData(_neighbourTracker); 186 | 187 | _hashGridBuffer = new ComputeBuffer(dimensions * dimensions * dimensions * maximumParticlesPerCell, sizeof(uint)); 188 | _hashGridBuffer.SetData(_hashGrid); 189 | _hashGridTrackerBuffer = new ComputeBuffer(dimensions * dimensions * dimensions, sizeof(uint)); 190 | _hashGridTrackerBuffer.SetData(_hashGridTracker); 191 | 192 | _densitiesBuffer = new ComputeBuffer(numberOfParticles, sizeof(float)); 193 | _densitiesBuffer.SetData(_densities); 194 | _pressuresBuffer = new ComputeBuffer(numberOfParticles, sizeof(float)); 195 | _pressuresBuffer.SetData(_pressures); 196 | 197 | _velocitiesBuffer = new ComputeBuffer(numberOfParticles, sizeof(float) * 3); 198 | _velocitiesBuffer.SetData(_velocities); 199 | _forcesBuffer = new ComputeBuffer(numberOfParticles, sizeof(float) * 3); 200 | _forcesBuffer.SetData(_forces); 201 | 202 | computeShader.SetBuffer(clearHashGridKernel, "_hashGridTracker", _hashGridTrackerBuffer); 203 | 204 | computeShader.SetBuffer(recalculateHashGridKernel, "_particles", _particlesBuffer); 205 | computeShader.SetBuffer(recalculateHashGridKernel, "_hashGrid", _hashGridBuffer); 206 | computeShader.SetBuffer(recalculateHashGridKernel, "_hashGridTracker", _hashGridTrackerBuffer); 207 | 208 | computeShader.SetBuffer(buildNeighbourListKernel, "_particles", _particlesBuffer); 209 | computeShader.SetBuffer(buildNeighbourListKernel, "_hashGrid", _hashGridBuffer); 210 | computeShader.SetBuffer(buildNeighbourListKernel, "_hashGridTracker", _hashGridTrackerBuffer); 211 | computeShader.SetBuffer(buildNeighbourListKernel, "_neighbourList", _neighbourListBuffer); 212 | computeShader.SetBuffer(buildNeighbourListKernel, "_neighbourTracker", _neighbourTrackerBuffer); 213 | 214 | computeShader.SetBuffer(computeDensityPressureKernel, "_neighbourTracker", _neighbourTrackerBuffer); 215 | computeShader.SetBuffer(computeDensityPressureKernel, "_neighbourList", _neighbourListBuffer); 216 | computeShader.SetBuffer(computeDensityPressureKernel, "_particles", _particlesBuffer); 217 | computeShader.SetBuffer(computeDensityPressureKernel, "_densities", _densitiesBuffer); 218 | computeShader.SetBuffer(computeDensityPressureKernel, "_pressures", _pressuresBuffer); 219 | 220 | computeShader.SetBuffer(computeForcesKernel, "_neighbourTracker", _neighbourTrackerBuffer); 221 | computeShader.SetBuffer(computeForcesKernel, "_neighbourList", _neighbourListBuffer); 222 | computeShader.SetBuffer(computeForcesKernel, "_particles", _particlesBuffer); 223 | computeShader.SetBuffer(computeForcesKernel, "_densities", _densitiesBuffer); 224 | computeShader.SetBuffer(computeForcesKernel, "_pressures", _pressuresBuffer); 225 | computeShader.SetBuffer(computeForcesKernel, "_velocities", _velocitiesBuffer); 226 | computeShader.SetBuffer(computeForcesKernel, "_forces", _forcesBuffer); 227 | 228 | computeShader.SetBuffer(integrateKernel, "_particles", _particlesBuffer); 229 | computeShader.SetBuffer(integrateKernel, "_forces", _forcesBuffer); 230 | computeShader.SetBuffer(integrateKernel, "_velocities", _velocitiesBuffer); 231 | } 232 | 233 | #endregion 234 | 235 | void Update() 236 | { 237 | computeShader.Dispatch(clearHashGridKernel, dimensions * dimensions * dimensions / 100, 1, 1); 238 | computeShader.Dispatch(recalculateHashGridKernel, numberOfParticles / 100, 1, 1); 239 | computeShader.Dispatch(buildNeighbourListKernel, numberOfParticles / 100, 1, 1); 240 | computeShader.Dispatch(computeDensityPressureKernel, numberOfParticles / 100, 1, 1); 241 | computeShader.Dispatch(computeForcesKernel, numberOfParticles / 100, 1, 1); 242 | computeShader.Dispatch(integrateKernel, numberOfParticles / 100, 1, 1); 243 | 244 | material.SetFloat(SizeProperty, particleRenderSize); 245 | material.SetBuffer(ParticlesBufferProperty, _particlesBuffer); 246 | Graphics.DrawMeshInstancedIndirect(particleMesh, 0, material, new Bounds(Vector3.zero, new Vector3(100.0f, 100.0f, 100.0f)), _argsBuffer, castShadows: UnityEngine.Rendering.ShadowCastingMode.Off); 247 | 248 | elapsedSimulationSteps++; 249 | } 250 | 251 | private void OnDestroy() 252 | { 253 | ReleaseBuffers(); 254 | } 255 | 256 | private void ReleaseBuffers() 257 | { 258 | _particlesBuffer.Dispose(); 259 | _argsBuffer.Dispose(); 260 | _neighbourListBuffer.Dispose(); 261 | _neighbourTrackerBuffer.Dispose(); 262 | _hashGridBuffer.Dispose(); 263 | _hashGridTrackerBuffer.Dispose(); 264 | _densitiesBuffer.Dispose(); 265 | _pressuresBuffer.Dispose(); 266 | _velocitiesBuffer.Dispose(); 267 | _forcesBuffer.Dispose(); 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/ComputeShaderParticleManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95bde09b760a8594c8c5d8450c05ca78 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/GridParticleRenderMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: GridParticleRenderMaterial 11 | m_Shader: {fileID: 4800000, guid: f56c771b7e56a054fa6c2f0db3787ea2, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/GridParticleRenderMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02ff84561f4f39b4c96b39210ffc7f6f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/GridParticleRenderingShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Instanced/GridTestParticleShader" { 2 | Properties{ 3 | _MainTex("Albedo (RGB)", 2D) = "white" {} 4 | _Glossiness("Smoothness", Range(0,1)) = 0.5 5 | _Metallic("Metallic", Range(0,1)) = 0.0 6 | } 7 | SubShader{ 8 | Tags { "RenderType" = "Opaque" } 9 | LOD 200 10 | 11 | CGPROGRAM 12 | // Physically based Standard lighting model 13 | #pragma surface surf Standard addshadow fullforwardshadows 14 | #pragma multi_compile_instancing 15 | #pragma instancing_options procedural:setup 16 | 17 | sampler2D _MainTex; 18 | float _size; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | struct Particle 25 | { 26 | float3 position; 27 | float4 color; // TODO-SATJ: could probably get away with float3 28 | }; 29 | 30 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 31 | StructuredBuffer _particlesBuffer; 32 | #endif 33 | 34 | void setup() 35 | { 36 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 37 | float3 pos = _particlesBuffer[unity_InstanceID].position; 38 | float size = _size; 39 | 40 | unity_ObjectToWorld._11_21_31_41 = float4(size, 0, 0, 0); 41 | unity_ObjectToWorld._12_22_32_42 = float4(0, size, 0, 0); 42 | unity_ObjectToWorld._13_23_33_43 = float4(0, 0, size, 0); 43 | unity_ObjectToWorld._14_24_34_44 = float4(pos.xyz, 1); 44 | unity_WorldToObject = unity_ObjectToWorld; 45 | unity_WorldToObject._14_24_34 *= -1; 46 | unity_WorldToObject._11_22_33 = 1.0f / unity_WorldToObject._11_22_33; 47 | #endif 48 | } 49 | 50 | half _Glossiness; 51 | half _Metallic; 52 | 53 | void surf(Input IN, inout SurfaceOutputStandard o) { 54 | float4 col = float4(1, 1, 1, 1); 55 | #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED 56 | col = _particlesBuffer[unity_InstanceID].color; 57 | #endif 58 | o.Albedo = col.rgb; 59 | o.Metallic = _Metallic; 60 | o.Smoothness = _Glossiness; 61 | o.Alpha = col.a; 62 | } 63 | ENDCG 64 | } 65 | FallBack "Diffuse" 66 | } -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/GridParticleRenderingShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f56c771b7e56a054fa6c2f0db3787ea2 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/ParticleManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.InteropServices; 3 | using DefaultNamespace; 4 | using UnityEngine; 5 | using Debug = UnityEngine.Debug; 6 | using Random = UnityEngine.Random; 7 | 8 | public class ParticleManager : MonoBehaviour 9 | { 10 | // ReSharper disable InconsistentNaming 11 | [Header("Particle properties")] 12 | public float radius = 1f; // particle radius, interaction radius h 13 | public Mesh particleMesh; 14 | public float particleRenderSize = 40f; 15 | public Material material; 16 | public float mass = 4f; 17 | public float viscosityCoefficient = 2.5f; 18 | private static readonly Vector3 g = new Vector3(0.0f, -9.81f * 2000f, 0.0f); 19 | private const float gasConstant = 2000.0f; 20 | private const float dt = 0.0008f; 21 | [SerializeField] 22 | private float restDensity = 1f; 23 | [SerializeField] 24 | private float damping = -0.5f; 25 | 26 | [Header("Simulation space properties")] 27 | public int numberOfParticles = 1000; 28 | public int dimensions = 10; 29 | public int maximumParticlesPerCell = 500; 30 | 31 | [Header("Debug information")] 32 | [Tooltip("Tracks how many neighbours each particleIndex has in " + nameof(_neighbourList))] 33 | [SerializeField] 34 | private int[] _neighbourTracker; 35 | [Tooltip("The absolute accumulated simulation steps")] 36 | public int elapsedSimulationSteps; 37 | 38 | private Particle[] _particles; 39 | // Too big for feasible serialisation (crash on expand). 40 | private int[] _neighbourList; // Stores all neighbours of a particle aligned at 'particleIndex * maximumParticlesPerCell * 8' 41 | private readonly Dictionary> _hashGrid = new Dictionary>(); // Hash of cell to particle indices. 42 | 43 | private ComputeBuffer _particleColorPositionBuffer; 44 | private ComputeBuffer _argsBuffer; 45 | private static readonly int SizeProperty = Shader.PropertyToID("_size"); 46 | private static readonly int ParticlesBufferProperty = Shader.PropertyToID("_particlesBuffer"); 47 | 48 | private float radius2; 49 | private float radius3; 50 | private float radius4; 51 | private float radius5; 52 | // ReSharper restore InconsistentNaming 53 | 54 | [StructLayout(LayoutKind.Sequential, Size=28)] 55 | private struct Particle 56 | { 57 | public Vector3 Position; 58 | public Vector4 Color; 59 | } 60 | 61 | private float[] densities; 62 | private float[] pressures; 63 | private Vector3[] forces; 64 | private Vector3[] velocities; 65 | 66 | private void Awake() 67 | { 68 | RespawnParticles(); 69 | InitNeighbourHashing(); 70 | InitComputeBuffers(); 71 | radius2 = radius * radius; 72 | radius3 = radius2 * radius; 73 | radius4 = radius3 * radius; 74 | radius5 = radius4 * radius; 75 | } 76 | 77 | #region Initialisation 78 | 79 | private void RespawnParticles() 80 | { 81 | _particles = new Particle[numberOfParticles]; 82 | densities = new float[numberOfParticles]; 83 | pressures = new float[numberOfParticles]; 84 | forces = new Vector3[numberOfParticles]; 85 | velocities = new Vector3[numberOfParticles]; 86 | 87 | int particlesPerDimension = Mathf.CeilToInt(Mathf.Pow(numberOfParticles, 1f / 3f)); 88 | 89 | int counter = 0; 90 | while (counter < numberOfParticles) 91 | { 92 | for (int x = 0; x < particlesPerDimension; x++) 93 | for (int y = 0; y < particlesPerDimension; y++) 94 | for (int z = 0; z < particlesPerDimension; z++) 95 | { 96 | Vector3 startPos = new Vector3(dimensions - 1, dimensions - 1, dimensions - 1) - new Vector3(x / 2f, y / 2f, z / 2f) - new Vector3(Random.Range(0f, 0.01f), Random.Range(0f, 0.01f), Random.Range(0f, 0.01f)); 97 | _particles[counter] = new Particle 98 | { 99 | Position = startPos, 100 | Color = Color.white 101 | }; 102 | densities[counter] = -1f; 103 | pressures[counter] = 0.0f; 104 | forces[counter] = Vector3.zero; 105 | velocities[counter] = Vector3.zero; 106 | 107 | if (++counter == numberOfParticles) 108 | { 109 | return; 110 | } 111 | } 112 | } 113 | } 114 | 115 | private void InitNeighbourHashing() 116 | { 117 | _hashGrid.Clear(); // Only needed when resetting the simulation via testBattery approach. 118 | _neighbourList = new int[numberOfParticles * maximumParticlesPerCell * 8]; // 8 because we consider 8 cells 119 | _neighbourTracker = new int[numberOfParticles]; 120 | SpatialHashing.CellSize = radius * 2; // Setting cell-size h to particle diameter. 121 | SpatialHashing.CellSize = radius * 2 * 2; // Setting cell-size h to double particle diameter. 122 | SpatialHashing.Dimensions = dimensions; 123 | for (int i = 0; i < dimensions; i++) 124 | for (int j = 0; j < dimensions; j++) 125 | for (int k = 0; k < dimensions; k++) 126 | { 127 | _hashGrid.Add(SpatialHashing.Hash(new Vector3Int(i, j, k)), new List()); 128 | } 129 | } 130 | 131 | void InitComputeBuffers() 132 | { 133 | uint[] args = { 134 | particleMesh.GetIndexCount(0), 135 | (uint) numberOfParticles, 136 | particleMesh.GetIndexStart(0), 137 | particleMesh.GetBaseVertex(0), 138 | 0 139 | }; 140 | _argsBuffer = new ComputeBuffer(1, args.Length * sizeof(uint), ComputeBufferType.IndirectArguments); 141 | _argsBuffer.SetData(args); 142 | 143 | _particleColorPositionBuffer = new ComputeBuffer(numberOfParticles, sizeof(float) * ( 3 + 4 )); 144 | if (_particles != null) 145 | { 146 | _particleColorPositionBuffer.SetData(_particles); 147 | } 148 | else 149 | { 150 | Debug.Log("Particles are null during compute buffer initialisation. Are you initialising the ParticleManager in the direct order?"); 151 | } 152 | } 153 | 154 | #endregion 155 | 156 | void Update() 157 | { 158 | // Calculate hash of all particles and build neighboring list. 159 | // 1. Clear HashGrid 160 | foreach (var cell in _hashGrid) 161 | { 162 | cell.Value.Clear(); 163 | } 164 | // 2. Recalculate hashes of each particle. 165 | for (int i = 0; i < _particles.Length; i++) 166 | { 167 | var hash = SpatialHashing.Hash(SpatialHashing.GetCell(_particles[i].Position)); 168 | if (_hashGrid[hash].Count == maximumParticlesPerCell) continue; // Prevent potential UB in neighbourList if more than maxParticlesPerCell are in a cell. 169 | _hashGrid[hash].Add(i); 170 | } 171 | // 3. For each particle go through all their 8 neighbouring cells. 172 | // Check each particle in those neighbouring cells for interference radius r and store the interfering ones inside the particles neighbour list. 173 | for (int particleIndex = 0; particleIndex < _particles.Length; particleIndex++) 174 | { 175 | _neighbourTracker[particleIndex] = 0; 176 | var cell = SpatialHashing.GetCell(_particles[particleIndex].Position); 177 | var cells = GetNearbyKeys(cell, _particles[particleIndex].Position); 178 | 179 | // ReSharper disable once ForCanBeConvertedToForeach 180 | for (int j = 0; j < cells.Length; j++) 181 | { 182 | if (!_hashGrid.ContainsKey(cells[j])) continue; 183 | var neighbourCell = _hashGrid[cells[j]]; 184 | foreach (var potentialNeighbour in neighbourCell) 185 | { 186 | if (potentialNeighbour == particleIndex) continue; 187 | // if (( _particles[potentialNeighbour].Position - _particles[particleIndex].Position ).magnitude < radius) // Using magnitude for debug purposes. 188 | if (( _particles[potentialNeighbour].Position - _particles[particleIndex].Position ).sqrMagnitude < radius2) // Using squared length instead of magnitude for performance 189 | { 190 | _neighbourList[particleIndex * maximumParticlesPerCell * 8 + _neighbourTracker[particleIndex]++] = potentialNeighbour; 191 | } 192 | } 193 | } 194 | } 195 | // 4. The Neighbouring-list should be n-particles big, each index containing a list of each particles neighbours in radius r. 196 | 197 | ComputeDensityPressure(); 198 | ComputeForces(); 199 | Integrate(); 200 | elapsedSimulationSteps++; 201 | 202 | _particleColorPositionBuffer.SetData(_particles); 203 | material.SetFloat(SizeProperty, particleRenderSize); 204 | material.SetBuffer(ParticlesBufferProperty, _particleColorPositionBuffer); 205 | Graphics.DrawMeshInstancedIndirect(particleMesh, 0, material, new Bounds(Vector3.zero, new Vector3(100.0f, 100.0f, 100.0f)), _argsBuffer, castShadows: UnityEngine.Rendering.ShadowCastingMode.On); 206 | } 207 | 208 | // https://lucasschuermann.com/writing/implementing-sph-in-2d 209 | private void Integrate() 210 | { 211 | for (int i = 0; i < numberOfParticles; i++) 212 | { 213 | // forward Euler integration 214 | velocities[i] += dt * forces[i] / mass; 215 | _particles[i].Position += dt * velocities[i]; 216 | 217 | // enforce boundary conditions 218 | if (_particles[i].Position.x - float.Epsilon < 0.0f) 219 | { 220 | velocities[i].x *= damping; 221 | _particles[i].Position.x = float.Epsilon; 222 | } 223 | else if(_particles[i].Position.x + float.Epsilon > dimensions - 1f) 224 | { 225 | velocities[i].x *= damping; 226 | _particles[i].Position.x = dimensions - 1 - float.Epsilon; 227 | } 228 | 229 | if (_particles[i].Position.y - float.Epsilon < 0.0f) 230 | { 231 | velocities[i].y *= damping; 232 | _particles[i].Position.y = float.Epsilon; 233 | } 234 | else if(_particles[i].Position.y + float.Epsilon > dimensions - 1f) 235 | { 236 | velocities[i].y *= damping; 237 | _particles[i].Position.y = dimensions - 1 - float.Epsilon; 238 | } 239 | 240 | if (_particles[i].Position.z - float.Epsilon < 0.0f) 241 | { 242 | velocities[i].z *= damping; 243 | _particles[i].Position.z = float.Epsilon; 244 | } 245 | else if(_particles[i].Position.z + float.Epsilon > dimensions - 1f) 246 | { 247 | velocities[i].z *= damping; 248 | _particles[i].Position.z = dimensions - 1 - float.Epsilon; 249 | } 250 | } 251 | } 252 | 253 | private void ComputeForces() 254 | { 255 | float mass2 = mass * mass; 256 | for (int i = 0; i < _particles.Length; i++) 257 | { 258 | forces[i] = Vector3.zero; 259 | var particleDensity2 = densities[i] * densities[i]; 260 | for (int j = 0; j < _neighbourTracker[i]; j++) 261 | { 262 | int neighbourIndex = _neighbourList[i * maximumParticlesPerCell * 8 + j]; 263 | float distance = ( _particles[i].Position - _particles[neighbourIndex].Position ).magnitude; 264 | if (distance > 0.0f) 265 | { 266 | var direction = ( _particles[i].Position - _particles[neighbourIndex].Position ) / distance; 267 | // 7. Compute pressure gradient force (Doyub Kim page 136) 268 | forces[i] -= mass2 * ( pressures[i] / particleDensity2 + pressures[neighbourIndex] / ( densities[neighbourIndex] * densities[neighbourIndex] ) ) * SpikyKernelGradient(distance, direction); // Kim 269 | // 8. Compute the viscosity force 270 | forces[i] += viscosityCoefficient * mass2 * ( velocities[neighbourIndex] - velocities[i] ) / densities[neighbourIndex] * SpikyKernelSecondDerivative(distance); // Kim 271 | } 272 | } 273 | 274 | // Gravity 275 | forces[i] += g; 276 | } 277 | } 278 | 279 | private void ComputeDensityPressure() 280 | { 281 | for (int i = 0; i < _particles.Length; i++) 282 | { 283 | // Doyub Kim 121, 122, 123 284 | // 5. Compute densities 285 | Vector3 origin = _particles[i].Position; 286 | float sum = 0f; 287 | for (int j = 0; j < _neighbourTracker[i]; j++) 288 | { 289 | int neighbourIndex = _neighbourList[i * maximumParticlesPerCell * 8 + j]; 290 | float distanceSquared = ( origin - _particles[neighbourIndex].Position ).sqrMagnitude; 291 | sum += StdKernel(distanceSquared); 292 | } 293 | 294 | densities[i] = sum * mass + 0.000001f; 295 | 296 | // 6. Compute pressure based on density 297 | pressures[i] = gasConstant * ( densities[i] - restDensity ); // as described in Müller et al Equation 12 298 | } 299 | } 300 | 301 | // Kernel by Müller et al. 302 | private float StdKernel(float distanceSquared) 303 | { 304 | // Doyub Kim 305 | float x = 1.0f - distanceSquared / radius2; 306 | return 315f / ( 64f * Mathf.PI * radius3 ) * x * x * x; 307 | } 308 | 309 | // Doyub Kim page 130 310 | private float SpikyKernelFirstDerivative(float distance) 311 | { 312 | float x = 1.0f - distance / radius; 313 | return -45.0f / ( Mathf.PI * radius4 ) * x * x; 314 | } 315 | 316 | // Doyub Kim page 130 317 | private float SpikyKernelSecondDerivative(float distance) 318 | { 319 | // Btw, it derives 'distance' not 'radius' (h) 320 | float x = 1.0f - distance / radius; 321 | return 90f / ( Mathf.PI * radius5 ) * x; 322 | } 323 | 324 | // Doyub Kim page 130 325 | private Vector3 SpikyKernelGradient(float distance, Vector3 directionFromCenter) 326 | { 327 | return SpikyKernelFirstDerivative(distance) * directionFromCenter; 328 | } 329 | 330 | // Derived from Doyub Kim 331 | private int[] GetNearbyKeys(Vector3Int originIndex, Vector3 position) 332 | { 333 | Vector3Int[] nearbyBucketIndices = new Vector3Int[8]; 334 | for (int i = 0; i < 8; i++) 335 | { 336 | nearbyBucketIndices[i] = originIndex; 337 | } 338 | 339 | if (( originIndex.x + 0.5f ) * SpatialHashing.CellSize <= position.x) 340 | { 341 | nearbyBucketIndices[4].x += 1; 342 | nearbyBucketIndices[5].x += 1; 343 | nearbyBucketIndices[6].x += 1; 344 | nearbyBucketIndices[7].x += 1; 345 | } 346 | else 347 | { 348 | nearbyBucketIndices[4].x -= 1; 349 | nearbyBucketIndices[5].x -= 1; 350 | nearbyBucketIndices[6].x -= 1; 351 | nearbyBucketIndices[7].x -= 1; 352 | } 353 | 354 | if (( originIndex.y + 0.5f ) * SpatialHashing.CellSize <= position.y) 355 | { 356 | nearbyBucketIndices[2].y += 1; 357 | nearbyBucketIndices[3].y += 1; 358 | nearbyBucketIndices[6].y += 1; 359 | nearbyBucketIndices[7].y += 1; 360 | } 361 | else 362 | { 363 | nearbyBucketIndices[2].y -= 1; 364 | nearbyBucketIndices[3].y -= 1; 365 | nearbyBucketIndices[6].y -= 1; 366 | nearbyBucketIndices[7].y -= 1; 367 | } 368 | 369 | if (( originIndex.z + 0.5f ) * SpatialHashing.CellSize <= position.z) 370 | { 371 | nearbyBucketIndices[1].z += 1; 372 | nearbyBucketIndices[3].z += 1; 373 | nearbyBucketIndices[5].z += 1; 374 | nearbyBucketIndices[7].z += 1; 375 | } 376 | else 377 | { 378 | nearbyBucketIndices[1].z -= 1; 379 | nearbyBucketIndices[3].z -= 1; 380 | nearbyBucketIndices[5].z -= 1; 381 | nearbyBucketIndices[7].z -= 1; 382 | } 383 | 384 | int[] nearbyKeys = new int[8]; 385 | for (int i = 0; i < 8; i++) 386 | { 387 | nearbyKeys[i] = SpatialHashing.Hash(nearbyBucketIndices[i]); 388 | } 389 | 390 | return nearbyKeys; 391 | } 392 | 393 | private void OnDestroy() 394 | { 395 | ReleaseBuffers(); 396 | } 397 | 398 | private void ReleaseBuffers() 399 | { 400 | _particleColorPositionBuffer.Dispose(); 401 | _argsBuffer.Dispose(); 402 | } 403 | } 404 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/ParticleManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55e63dc60089610499a4a2f8876e9787 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SPH.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &348698481 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 348698482} 135 | - component: {fileID: 348698483} 136 | m_Layer: 0 137 | m_Name: ComputeShader GPU SPH 138 | m_TagString: Untagged 139 | m_Icon: {fileID: 0} 140 | m_NavMeshLayer: 0 141 | m_StaticEditorFlags: 0 142 | m_IsActive: 1 143 | --- !u!4 &348698482 144 | Transform: 145 | m_ObjectHideFlags: 0 146 | m_CorrespondingSourceObject: {fileID: 0} 147 | m_PrefabInstance: {fileID: 0} 148 | m_PrefabAsset: {fileID: 0} 149 | m_GameObject: {fileID: 348698481} 150 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 151 | m_LocalPosition: {x: 2.089705, y: -2.964465, z: 7.4575944} 152 | m_LocalScale: {x: 1, y: 1, z: 1} 153 | m_ConstrainProportionsScale: 0 154 | m_Children: [] 155 | m_Father: {fileID: 0} 156 | m_RootOrder: 3 157 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 158 | --- !u!114 &348698483 159 | MonoBehaviour: 160 | m_ObjectHideFlags: 0 161 | m_CorrespondingSourceObject: {fileID: 0} 162 | m_PrefabInstance: {fileID: 0} 163 | m_PrefabAsset: {fileID: 0} 164 | m_GameObject: {fileID: 348698481} 165 | m_Enabled: 1 166 | m_EditorHideFlags: 0 167 | m_Script: {fileID: 11500000, guid: 95bde09b760a8594c8c5d8450c05ca78, type: 3} 168 | m_Name: 169 | m_EditorClassIdentifier: 170 | radius: 1 171 | particleMesh: {fileID: 2540817853737639666, guid: 9ed0cda3b68bfda42810ac81c420e5cb, type: 3} 172 | particleRenderSize: 40 173 | material: {fileID: 2100000, guid: 02ff84561f4f39b4c96b39210ffc7f6f, type: 2} 174 | mass: 1 175 | gasConstant: 2000 176 | restDensity: 2 177 | viscosityCoefficient: 0.25 178 | g: 179 | - 0 180 | - -9.81 181 | - 0 182 | damping: -0.5 183 | dt: 0.0008 184 | numberOfParticles: 50000 185 | dimensions: 100 186 | maximumParticlesPerCell: 500 187 | _neighbourTracker: 188 | _hashGridTracker: 189 | computeShader: {fileID: 7200000, guid: f70a5880eee887640a7dff6b2e58e13a, type: 3} 190 | elapsedSimulationSteps: 0 191 | --- !u!1 &519420028 192 | GameObject: 193 | m_ObjectHideFlags: 0 194 | m_CorrespondingSourceObject: {fileID: 0} 195 | m_PrefabInstance: {fileID: 0} 196 | m_PrefabAsset: {fileID: 0} 197 | serializedVersion: 6 198 | m_Component: 199 | - component: {fileID: 519420032} 200 | - component: {fileID: 519420031} 201 | - component: {fileID: 519420029} 202 | m_Layer: 0 203 | m_Name: Main Camera 204 | m_TagString: MainCamera 205 | m_Icon: {fileID: 0} 206 | m_NavMeshLayer: 0 207 | m_StaticEditorFlags: 0 208 | m_IsActive: 1 209 | --- !u!81 &519420029 210 | AudioListener: 211 | m_ObjectHideFlags: 0 212 | m_CorrespondingSourceObject: {fileID: 0} 213 | m_PrefabInstance: {fileID: 0} 214 | m_PrefabAsset: {fileID: 0} 215 | m_GameObject: {fileID: 519420028} 216 | m_Enabled: 1 217 | --- !u!20 &519420031 218 | Camera: 219 | m_ObjectHideFlags: 0 220 | m_CorrespondingSourceObject: {fileID: 0} 221 | m_PrefabInstance: {fileID: 0} 222 | m_PrefabAsset: {fileID: 0} 223 | m_GameObject: {fileID: 519420028} 224 | m_Enabled: 1 225 | serializedVersion: 2 226 | m_ClearFlags: 2 227 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 228 | m_projectionMatrixMode: 1 229 | m_GateFitMode: 2 230 | m_FOVAxisMode: 0 231 | m_SensorSize: {x: 36, y: 24} 232 | m_LensShift: {x: 0, y: 0} 233 | m_FocalLength: 50 234 | m_NormalizedViewPortRect: 235 | serializedVersion: 2 236 | x: 0 237 | y: 0 238 | width: 1 239 | height: 1 240 | near clip plane: 0.3 241 | far clip plane: 1000 242 | field of view: 60 243 | orthographic: 0 244 | orthographic size: 5 245 | m_Depth: -1 246 | m_CullingMask: 247 | serializedVersion: 2 248 | m_Bits: 4294967295 249 | m_RenderingPath: -1 250 | m_TargetTexture: {fileID: 0} 251 | m_TargetDisplay: 0 252 | m_TargetEye: 0 253 | m_HDR: 1 254 | m_AllowMSAA: 0 255 | m_AllowDynamicResolution: 0 256 | m_ForceIntoRT: 0 257 | m_OcclusionCulling: 0 258 | m_StereoConvergence: 10 259 | m_StereoSeparation: 0.022 260 | --- !u!4 &519420032 261 | Transform: 262 | m_ObjectHideFlags: 0 263 | m_CorrespondingSourceObject: {fileID: 0} 264 | m_PrefabInstance: {fileID: 0} 265 | m_PrefabAsset: {fileID: 0} 266 | m_GameObject: {fileID: 519420028} 267 | m_LocalRotation: {x: -0.08074041, y: 0.481126, z: -0.051886957, w: -0.871382} 268 | m_LocalPosition: {x: 199, y: 57, z: -31} 269 | m_LocalScale: {x: 1, y: 1, z: 1} 270 | m_ConstrainProportionsScale: 0 271 | m_Children: [] 272 | m_Father: {fileID: 0} 273 | m_RootOrder: 1 274 | m_LocalEulerAnglesHint: {x: 10.99, y: -57.738, z: 0.743} 275 | --- !u!1 &794769527 276 | GameObject: 277 | m_ObjectHideFlags: 0 278 | m_CorrespondingSourceObject: {fileID: 0} 279 | m_PrefabInstance: {fileID: 0} 280 | m_PrefabAsset: {fileID: 0} 281 | serializedVersion: 6 282 | m_Component: 283 | - component: {fileID: 794769530} 284 | - component: {fileID: 794769529} 285 | - component: {fileID: 794769528} 286 | m_Layer: 0 287 | m_Name: EventSystem 288 | m_TagString: Untagged 289 | m_Icon: {fileID: 0} 290 | m_NavMeshLayer: 0 291 | m_StaticEditorFlags: 0 292 | m_IsActive: 1 293 | --- !u!114 &794769528 294 | MonoBehaviour: 295 | m_ObjectHideFlags: 0 296 | m_CorrespondingSourceObject: {fileID: 0} 297 | m_PrefabInstance: {fileID: 0} 298 | m_PrefabAsset: {fileID: 0} 299 | m_GameObject: {fileID: 794769527} 300 | m_Enabled: 1 301 | m_EditorHideFlags: 0 302 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 303 | m_Name: 304 | m_EditorClassIdentifier: 305 | m_HorizontalAxis: Horizontal 306 | m_VerticalAxis: Vertical 307 | m_SubmitButton: Submit 308 | m_CancelButton: Cancel 309 | m_InputActionsPerSecond: 10 310 | m_RepeatDelay: 0.5 311 | m_ForceModuleActive: 0 312 | --- !u!114 &794769529 313 | MonoBehaviour: 314 | m_ObjectHideFlags: 0 315 | m_CorrespondingSourceObject: {fileID: 0} 316 | m_PrefabInstance: {fileID: 0} 317 | m_PrefabAsset: {fileID: 0} 318 | m_GameObject: {fileID: 794769527} 319 | m_Enabled: 1 320 | m_EditorHideFlags: 0 321 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 322 | m_Name: 323 | m_EditorClassIdentifier: 324 | m_FirstSelected: {fileID: 0} 325 | m_sendNavigationEvents: 1 326 | m_DragThreshold: 10 327 | --- !u!4 &794769530 328 | Transform: 329 | m_ObjectHideFlags: 0 330 | m_CorrespondingSourceObject: {fileID: 0} 331 | m_PrefabInstance: {fileID: 0} 332 | m_PrefabAsset: {fileID: 0} 333 | m_GameObject: {fileID: 794769527} 334 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 335 | m_LocalPosition: {x: 0, y: 0, z: 0} 336 | m_LocalScale: {x: 1, y: 1, z: 1} 337 | m_ConstrainProportionsScale: 0 338 | m_Children: [] 339 | m_Father: {fileID: 0} 340 | m_RootOrder: 4 341 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 342 | --- !u!1 &1045217406 343 | GameObject: 344 | m_ObjectHideFlags: 0 345 | m_CorrespondingSourceObject: {fileID: 0} 346 | m_PrefabInstance: {fileID: 0} 347 | m_PrefabAsset: {fileID: 0} 348 | serializedVersion: 6 349 | m_Component: 350 | - component: {fileID: 1045217408} 351 | - component: {fileID: 1045217407} 352 | m_Layer: 0 353 | m_Name: Directional Light 354 | m_TagString: Untagged 355 | m_Icon: {fileID: 0} 356 | m_NavMeshLayer: 0 357 | m_StaticEditorFlags: 0 358 | m_IsActive: 1 359 | --- !u!108 &1045217407 360 | Light: 361 | m_ObjectHideFlags: 0 362 | m_CorrespondingSourceObject: {fileID: 0} 363 | m_PrefabInstance: {fileID: 0} 364 | m_PrefabAsset: {fileID: 0} 365 | m_GameObject: {fileID: 1045217406} 366 | m_Enabled: 1 367 | serializedVersion: 10 368 | m_Type: 1 369 | m_Shape: 0 370 | m_Color: {r: 1, g: 1, b: 1, a: 1} 371 | m_Intensity: 1 372 | m_Range: 10 373 | m_SpotAngle: 30 374 | m_InnerSpotAngle: 21.80208 375 | m_CookieSize: 10 376 | m_Shadows: 377 | m_Type: 0 378 | m_Resolution: -1 379 | m_CustomResolution: -1 380 | m_Strength: 1 381 | m_Bias: 0.05 382 | m_NormalBias: 0.4 383 | m_NearPlane: 0.2 384 | m_CullingMatrixOverride: 385 | e00: 1 386 | e01: 0 387 | e02: 0 388 | e03: 0 389 | e10: 0 390 | e11: 1 391 | e12: 0 392 | e13: 0 393 | e20: 0 394 | e21: 0 395 | e22: 1 396 | e23: 0 397 | e30: 0 398 | e31: 0 399 | e32: 0 400 | e33: 1 401 | m_UseCullingMatrixOverride: 0 402 | m_Cookie: {fileID: 0} 403 | m_DrawHalo: 0 404 | m_Flare: {fileID: 0} 405 | m_RenderMode: 0 406 | m_CullingMask: 407 | serializedVersion: 2 408 | m_Bits: 4294967295 409 | m_RenderingLayerMask: 1 410 | m_Lightmapping: 4 411 | m_LightShadowCasterMode: 0 412 | m_AreaSize: {x: 1, y: 1} 413 | m_BounceIntensity: 1 414 | m_ColorTemperature: 6570 415 | m_UseColorTemperature: 0 416 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 417 | m_UseBoundingSphereOverride: 0 418 | m_UseViewFrustumForShadowCasterCull: 1 419 | m_ShadowRadius: 0 420 | m_ShadowAngle: 0 421 | --- !u!4 &1045217408 422 | Transform: 423 | m_ObjectHideFlags: 0 424 | m_CorrespondingSourceObject: {fileID: 0} 425 | m_PrefabInstance: {fileID: 0} 426 | m_PrefabAsset: {fileID: 0} 427 | m_GameObject: {fileID: 1045217406} 428 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 429 | m_LocalPosition: {x: 1.0482408, y: 1.4358087, z: 0.77907646} 430 | m_LocalScale: {x: 1, y: 1, z: 1} 431 | m_ConstrainProportionsScale: 0 432 | m_Children: [] 433 | m_Father: {fileID: 0} 434 | m_RootOrder: 0 435 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 436 | --- !u!1 &2110221309 437 | GameObject: 438 | m_ObjectHideFlags: 0 439 | m_CorrespondingSourceObject: {fileID: 0} 440 | m_PrefabInstance: {fileID: 0} 441 | m_PrefabAsset: {fileID: 0} 442 | serializedVersion: 6 443 | m_Component: 444 | - component: {fileID: 2110221310} 445 | - component: {fileID: 2110221311} 446 | m_Layer: 0 447 | m_Name: MonoBehaviour CPU SPH 448 | m_TagString: Untagged 449 | m_Icon: {fileID: 0} 450 | m_NavMeshLayer: 0 451 | m_StaticEditorFlags: 0 452 | m_IsActive: 0 453 | --- !u!4 &2110221310 454 | Transform: 455 | m_ObjectHideFlags: 0 456 | m_CorrespondingSourceObject: {fileID: 0} 457 | m_PrefabInstance: {fileID: 0} 458 | m_PrefabAsset: {fileID: 0} 459 | m_GameObject: {fileID: 2110221309} 460 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 461 | m_LocalPosition: {x: 1.0482408, y: 1.4358087, z: 0.77907646} 462 | m_LocalScale: {x: 1, y: 1, z: 1} 463 | m_ConstrainProportionsScale: 0 464 | m_Children: [] 465 | m_Father: {fileID: 0} 466 | m_RootOrder: 2 467 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 468 | --- !u!114 &2110221311 469 | MonoBehaviour: 470 | m_ObjectHideFlags: 0 471 | m_CorrespondingSourceObject: {fileID: 0} 472 | m_PrefabInstance: {fileID: 0} 473 | m_PrefabAsset: {fileID: 0} 474 | m_GameObject: {fileID: 2110221309} 475 | m_Enabled: 1 476 | m_EditorHideFlags: 0 477 | m_Script: {fileID: 11500000, guid: 55e63dc60089610499a4a2f8876e9787, type: 3} 478 | m_Name: 479 | m_EditorClassIdentifier: 480 | radius: 1 481 | particleMesh: {fileID: 2540817853737639666, guid: 9ed0cda3b68bfda42810ac81c420e5cb, type: 3} 482 | particleRenderSize: 40 483 | material: {fileID: 2100000, guid: 02ff84561f4f39b4c96b39210ffc7f6f, type: 2} 484 | mass: 4 485 | viscosityCoefficient: 2.5 486 | restDensity: 7.93 487 | damping: -0.25 488 | numberOfParticles: 100 489 | dimensions: 100 490 | maximumParticlesPerCell: 500 491 | _neighbourTracker: 492 | elapsedSimulationSteps: 0 493 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SPH.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cda990e2423bbf4892e6590ba056729 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SPH3D.compute: -------------------------------------------------------------------------------- 1 | #pragma kernel ClearHashGrid 2 | #pragma kernel RecalculateHashGrid 3 | #pragma kernel BuildNeighbourList 4 | #pragma kernel ComputeDensityPressure 5 | #pragma kernel ComputeForces 6 | #pragma kernel Integrate 7 | 8 | float CellSize; 9 | int Dimensions; 10 | 11 | int3 GetCell(float3 position) 12 | { 13 | return int3(position.x / CellSize, position.y / CellSize, position.z / CellSize); 14 | } 15 | 16 | int Hash(int3 cell) 17 | { 18 | return cell.x + Dimensions * (cell.y + Dimensions * cell.z); 19 | } 20 | 21 | struct Particle 22 | { 23 | float3 Position; 24 | float4 Color; 25 | }; 26 | 27 | RWStructuredBuffer _particles; 28 | RWStructuredBuffer _neighbourList; // Stores all neighbours of a particle aligned at 'particleIndex * maximumParticlesPerCell * 8' 29 | RWStructuredBuffer _neighbourTracker; // How many neighbours does each particle contain. 30 | RWStructuredBuffer _hashGrid; // aligned at 'particleIndex * maximumParticlesPerCell * 8' + _hashGridTracker[particleIndex] 31 | RWStructuredBuffer _hashGridTracker; // How many particles at each cell. 32 | RWStructuredBuffer _densities; 33 | RWStructuredBuffer _pressures; 34 | RWStructuredBuffer _velocities; 35 | RWStructuredBuffer _forces; 36 | 37 | int maximumParticlesPerCell; 38 | float radius; // particle radius 39 | float radius2; 40 | float radius3; 41 | float radius4; 42 | float radius5; 43 | float mass; 44 | float mass2; 45 | float gasConstant; 46 | float restDensity; 47 | float viscosityCoefficient; 48 | float damping; 49 | float dt; 50 | float3 g; 51 | float epsilon; 52 | float pi; 53 | 54 | // Fake clear actually, only writes 0 to the hashGridTracker. 55 | [numthreads(100,1,1)] 56 | void ClearHashGrid(uint3 id : SV_DispatchThreadID) 57 | { 58 | _hashGridTracker[id.x] = 0; 59 | // NeighbourTracker is (fake) cleared in the neighbour-list-building kernel 60 | } 61 | 62 | [numthreads(100,1,1)] 63 | void RecalculateHashGrid(uint3 id : SV_DispatchThreadID) 64 | { 65 | int previousCount = 0; 66 | const int cellHash = Hash(GetCell(_particles[id.x].Position)); 67 | InterlockedAdd(_hashGridTracker[cellHash], 1, previousCount); 68 | if (previousCount >= maximumParticlesPerCell) 69 | { 70 | _particles[id.x].Color = float4(255, 0, 0, 255); 71 | return; 72 | } 73 | // _particles[id.x].Color = float4(255, 255, 255, 255); 74 | _hashGrid[cellHash * maximumParticlesPerCell + previousCount] = id.x; 75 | } 76 | 77 | void GetNearbyKeys(int3 originIndex, float3 position, out int nearbyKeys[8]) 78 | { 79 | int3 nearbyBucketIndices[8]; 80 | for (int i = 0; i < 8; i++) 81 | { 82 | nearbyBucketIndices[i] = originIndex; 83 | } 84 | 85 | if (( originIndex.x + 0.5f ) * CellSize <= position.x) 86 | { 87 | nearbyBucketIndices[4].x += 1; 88 | nearbyBucketIndices[5].x += 1; 89 | nearbyBucketIndices[6].x += 1; 90 | nearbyBucketIndices[7].x += 1; 91 | } 92 | else 93 | { 94 | nearbyBucketIndices[4].x -= 1; 95 | nearbyBucketIndices[5].x -= 1; 96 | nearbyBucketIndices[6].x -= 1; 97 | nearbyBucketIndices[7].x -= 1; 98 | } 99 | 100 | if (( originIndex.y + 0.5f ) * CellSize <= position.y) 101 | { 102 | nearbyBucketIndices[2].y += 1; 103 | nearbyBucketIndices[3].y += 1; 104 | nearbyBucketIndices[6].y += 1; 105 | nearbyBucketIndices[7].y += 1; 106 | } 107 | else 108 | { 109 | nearbyBucketIndices[2].y -= 1; 110 | nearbyBucketIndices[3].y -= 1; 111 | nearbyBucketIndices[6].y -= 1; 112 | nearbyBucketIndices[7].y -= 1; 113 | } 114 | 115 | if (( originIndex.z + 0.5f ) * CellSize <= position.z) 116 | { 117 | nearbyBucketIndices[1].z += 1; 118 | nearbyBucketIndices[3].z += 1; 119 | nearbyBucketIndices[5].z += 1; 120 | nearbyBucketIndices[7].z += 1; 121 | } 122 | else 123 | { 124 | nearbyBucketIndices[1].z -= 1; 125 | nearbyBucketIndices[3].z -= 1; 126 | nearbyBucketIndices[5].z -= 1; 127 | nearbyBucketIndices[7].z -= 1; 128 | } 129 | 130 | for (int j = 0; j < 8; j++) 131 | { 132 | int3 cell = nearbyBucketIndices[j]; 133 | if (cell.x < 0 || cell.x >= Dimensions || cell.y < 0 || cell.y >= Dimensions || cell.z < 0 || cell.z >= Dimensions) 134 | { 135 | nearbyKeys[j] = -1; 136 | } 137 | else 138 | { 139 | nearbyKeys[j] = Hash(nearbyBucketIndices[j]); 140 | } 141 | } 142 | } 143 | 144 | [numthreads(100,1,1)] 145 | void BuildNeighbourList(uint3 id : SV_DispatchThreadID) 146 | { 147 | _neighbourTracker[id.x] = 0; 148 | const int3 cell = GetCell(_particles[id.x].Position); 149 | int cells[8]; 150 | GetNearbyKeys(cell, _particles[id.x].Position, cells); 151 | 152 | for (uint j = 0; j < 8; j++) 153 | { 154 | if (cells[j] == -1) continue; // Grid does not contain cell. 155 | const uint numberOfParticlesInCell = min(_hashGridTracker[cells[j]], maximumParticlesPerCell); ; 156 | for (uint index = 0; index < numberOfParticlesInCell; index++) 157 | { 158 | const uint potentialNeighbour = _hashGrid[cells[j] * maximumParticlesPerCell + index]; 159 | if (potentialNeighbour == id.x) continue; 160 | const float3 v = _particles[potentialNeighbour].Position - _particles[id.x].Position; 161 | if (dot(v, v) < radius2) // Use squared length (= dot) instead of length for performance. 162 | { 163 | _neighbourList[id.x * maximumParticlesPerCell * 8 + _neighbourTracker[id.x]++] = potentialNeighbour; 164 | } 165 | } 166 | } 167 | // n. The Neighbouring-list should be n-particles big, each index containing a list of each particles neighbours in radius r. 168 | } 169 | 170 | float StdKernel(float distanceSquared) 171 | { 172 | // Doyub Kim 173 | float x = 1.0f - distanceSquared / radius2; 174 | return 315.f / ( 64.f * pi * radius3 ) * x * x * x; 175 | } 176 | 177 | 178 | [numthreads(100,1,1)] 179 | void ComputeDensityPressure(uint3 id : SV_DispatchThreadID) 180 | { 181 | // Doyub Kim 121, 122, 123 182 | // 5. Compute densities 183 | float3 origin = _particles[id.x].Position; 184 | float sum = 0.f; 185 | for (int j = 0; j < _neighbourTracker[id.x]; j++) 186 | { 187 | int neighbourIndex = _neighbourList[id.x * maximumParticlesPerCell * 8 + j]; 188 | const float3 diff = origin - _particles[neighbourIndex].Position; 189 | float distanceSquared = dot(diff, diff); 190 | sum += StdKernel(distanceSquared); 191 | } 192 | 193 | _densities[id.x] = sum * mass + 0.000001f; 194 | 195 | // 6. Compute pressure based on density 196 | _pressures[id.x] = gasConstant * ( _densities[id.x] - restDensity ); // as described in Müller et al Equation 12 197 | } 198 | 199 | // Doyub Kim page 130 200 | float SpikyKernelFirstDerivative(float distance) 201 | { 202 | float x = 1.0f - distance / radius; 203 | return -45.0f / ( pi * radius4 ) * x * x; 204 | } 205 | 206 | // Doyub Kim page 130 207 | float SpikyKernelSecondDerivative(float distance) 208 | { 209 | // Btw, it derives 'distance' not 'radius' (h) 210 | float x = 1.0f - distance / radius; 211 | return 90.f / ( pi * radius5 ) * x; 212 | } 213 | 214 | // Doyub Kim page 130 215 | float3 SpikyKernelGradient(float distance, float3 directionFromCenter) 216 | { 217 | return SpikyKernelFirstDerivative(distance) * directionFromCenter; 218 | } 219 | 220 | [numthreads(100,1,1)] 221 | void ComputeForces(uint3 id : SV_DispatchThreadID) 222 | { 223 | _forces[id.x] = float3(0, 0, 0); 224 | const float particleDensity2 = _densities[id.x] * _densities[id.x]; 225 | for (int j = 0; j < _neighbourTracker[id.x]; j++) 226 | { 227 | const int neighbourIndex = _neighbourList[id.x * maximumParticlesPerCell * 8 + j]; 228 | const float distance = length( _particles[id.x].Position - _particles[neighbourIndex].Position ); 229 | if (distance > 0.0f) 230 | { 231 | const float3 direction = ( _particles[id.x].Position - _particles[neighbourIndex].Position ) / distance; 232 | // 7. Compute pressure gradient force (Doyub Kim page 136) 233 | _forces[id.x] -= mass2 * ( _pressures[id.x] / particleDensity2 + _pressures[neighbourIndex] / ( _densities[neighbourIndex] * _densities[neighbourIndex] ) ) * SpikyKernelGradient(distance, direction); // Kim 234 | // 8. Compute the viscosity force 235 | _forces[id.x] += viscosityCoefficient * mass2 * ( _velocities[neighbourIndex] - _velocities[id.x] ) / _densities[neighbourIndex] * SpikyKernelSecondDerivative(distance); // Kim 236 | } 237 | } 238 | 239 | // Gravity 240 | _forces[id.x] += g; 241 | } 242 | 243 | [numthreads(100,1,1)] 244 | void Integrate(uint3 id : SV_DispatchThreadID) 245 | { 246 | Particle particle = _particles[id.x]; 247 | // forward Euler integration 248 | _velocities[id.x] += dt * _forces[id.x] / mass; 249 | particle.Position += dt * _velocities[id.x]; 250 | _particles[id.x] = particle; 251 | 252 | particle = _particles[id.x]; 253 | float3 velocity = _velocities[id.x]; 254 | 255 | // enforce boundary conditions 256 | if (_particles[id.x].Position.x - epsilon < 0.0f) 257 | { 258 | velocity.x *= damping; 259 | particle.Position.x = epsilon; 260 | } 261 | else if(_particles[id.x].Position.x + epsilon > Dimensions - 1.f) 262 | { 263 | velocity.x *= damping; 264 | particle.Position.x = Dimensions - 1 - epsilon; 265 | } 266 | 267 | if (_particles[id.x].Position.y - epsilon < 0.0f) 268 | { 269 | velocity.y *= damping; 270 | particle.Position.y = epsilon; 271 | } 272 | else if(_particles[id.x].Position.y + epsilon > Dimensions - 1.f) 273 | { 274 | velocity.y *= damping; 275 | particle.Position.y = Dimensions - 1 - epsilon; 276 | } 277 | 278 | if (_particles[id.x].Position.z - epsilon < 0.0f) 279 | { 280 | velocity.z *= damping; 281 | particle.Position.z = epsilon; 282 | } 283 | else if(_particles[id.x].Position.z + epsilon > Dimensions - 1.f) 284 | { 285 | velocity.z *= damping; 286 | particle.Position.z = Dimensions - 1 - epsilon; 287 | } 288 | 289 | _velocities[id.x] = velocity; 290 | _particles[id.x] = particle; 291 | } 292 | 293 | 294 | 295 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SPH3D.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f70a5880eee887640a7dff6b2e58e13a 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 4 6 | preprocessorOverride: 0 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SpatialHashing.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace DefaultNamespace 4 | { 5 | public static class SpatialHashing 6 | { 7 | public static float CellSize = 1f; 8 | public static int Dimensions = 10; 9 | 10 | public static Vector3Int GetCell(Vector3 position) 11 | { 12 | Debug.Assert(position.x >= 0f, "Position x must be greater than 0! Are you missing an offset?" + position.x.ToString()); 13 | Debug.Assert(position.y >= 0f, "Position y must be greater than 0! Are you missing an offset?" + position.y.ToString()); 14 | Debug.Assert(position.z >= 0f, "Position z must be greater than 0! Are you missing an offset?" + position.z.ToString()); 15 | return new Vector3Int((int) ( position.x / CellSize ), (int) ( position.y / CellSize ), (int) ( position.z / CellSize )); 16 | } 17 | 18 | public static int Hash(Vector3Int cell) 19 | { 20 | return cell.x + Dimensions * (cell.y + Dimensions * cell.z); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/SpatialHashing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5a0bb978b7d40c58d58bdcc45edd511 3 | timeCreated: 1622019789 -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/Sphere.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6757429936384840281 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6757429936384840285} 12 | - component: {fileID: 6757429936384840286} 13 | - component: {fileID: 6757429936384840287} 14 | m_Layer: 0 15 | m_Name: Sphere 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &6757429936384840285 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 6757429936384840281} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!33 &6757429936384840286 36 | MeshFilter: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 6757429936384840281} 42 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 43 | --- !u!23 &6757429936384840287 44 | MeshRenderer: 45 | m_ObjectHideFlags: 0 46 | m_CorrespondingSourceObject: {fileID: 0} 47 | m_PrefabInstance: {fileID: 0} 48 | m_PrefabAsset: {fileID: 0} 49 | m_GameObject: {fileID: 6757429936384840281} 50 | m_Enabled: 1 51 | m_CastShadows: 1 52 | m_ReceiveShadows: 1 53 | m_DynamicOccludee: 1 54 | m_MotionVectors: 1 55 | m_LightProbeUsage: 1 56 | m_ReflectionProbeUsage: 1 57 | m_RayTracingMode: 2 58 | m_RayTraceProcedural: 0 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_ReceiveGI: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | m_AdditionalVertexStreams: {fileID: 0} 84 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/Sphere.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bd7e71737be7a84094306ad94ba4f7d 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/lowpolySphere.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78eda8cbd56ebd5ad3430f2234135a44c1c50470a0a8b6af41d20752004df1ab 3 | size 22016 4 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Assets/lowpolySphere.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ed0cda3b68bfda42810ac81c420e5cb 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 2 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | sortHierarchyByName: 1 42 | importVisibility: 1 43 | importBlendShapes: 1 44 | importCameras: 1 45 | importLights: 1 46 | fileIdsGeneration: 2 47 | swapUVChannels: 0 48 | generateSecondaryUV: 0 49 | useFileUnits: 1 50 | keepQuads: 0 51 | weldVertices: 1 52 | bakeAxisConversion: 0 53 | preserveHierarchy: 0 54 | skinWeightsMode: 0 55 | maxBonesPerVertex: 4 56 | minBoneWeight: 0.001 57 | meshOptimizationFlags: -1 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVMarginMethod: 1 63 | secondaryUVMinLightmapResolution: 40 64 | secondaryUVMinObjectScale: 1 65 | secondaryUVPackMargin: 4 66 | useFileScale: 1 67 | tangentSpace: 68 | normalSmoothAngle: 60 69 | normalImportMode: 0 70 | tangentImportMode: 3 71 | normalCalculationMode: 4 72 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 73 | blendShapeNormalImportMode: 1 74 | normalSmoothingSource: 0 75 | referencedClips: [] 76 | importAnimation: 1 77 | humanDescription: 78 | serializedVersion: 3 79 | human: [] 80 | skeleton: [] 81 | armTwist: 0.5 82 | foreArmTwist: 0.5 83 | upperLegTwist: 0.5 84 | legTwist: 0.5 85 | armStretch: 0.05 86 | legStretch: 0.05 87 | feetSpacing: 0 88 | globalScale: 1 89 | rootMotionBoneName: 90 | hasTranslationDoF: 0 91 | hasExtraRoot: 0 92 | skeletonHasParents: 1 93 | lastHumanDescriptionAvatarSource: {instanceID: 0} 94 | autoGenerateAvatarMappingIfUnspecified: 1 95 | animationType: 2 96 | humanoidOversampling: 1 97 | avatarSetup: 0 98 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 99 | additionalBone: 0 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.animation": "5.0.4", 4 | "com.unity.2d.pixel-perfect": "4.0.1", 5 | "com.unity.2d.psdimporter": "4.0.2", 6 | "com.unity.2d.sprite": "1.0.0", 7 | "com.unity.2d.spriteshape": "5.1.1", 8 | "com.unity.2d.tilemap": "1.0.0", 9 | "com.unity.collab-proxy": "1.3.9", 10 | "com.unity.ide.rider": "2.0.7", 11 | "com.unity.ide.visualstudio": "2.0.7", 12 | "com.unity.ide.vscode": "1.2.3", 13 | "com.unity.test-framework": "1.1.24", 14 | "com.unity.textmeshpro": "3.0.1", 15 | "com.unity.timeline": "1.4.7", 16 | "com.unity.ugui": "1.0.0", 17 | "com.unity.modules.ai": "1.0.0", 18 | "com.unity.modules.androidjni": "1.0.0", 19 | "com.unity.modules.animation": "1.0.0", 20 | "com.unity.modules.assetbundle": "1.0.0", 21 | "com.unity.modules.audio": "1.0.0", 22 | "com.unity.modules.cloth": "1.0.0", 23 | "com.unity.modules.director": "1.0.0", 24 | "com.unity.modules.imageconversion": "1.0.0", 25 | "com.unity.modules.imgui": "1.0.0", 26 | "com.unity.modules.jsonserialize": "1.0.0", 27 | "com.unity.modules.particlesystem": "1.0.0", 28 | "com.unity.modules.physics": "1.0.0", 29 | "com.unity.modules.physics2d": "1.0.0", 30 | "com.unity.modules.screencapture": "1.0.0", 31 | "com.unity.modules.terrain": "1.0.0", 32 | "com.unity.modules.terrainphysics": "1.0.0", 33 | "com.unity.modules.tilemap": "1.0.0", 34 | "com.unity.modules.ui": "1.0.0", 35 | "com.unity.modules.uielements": "1.0.0", 36 | "com.unity.modules.umbra": "1.0.0", 37 | "com.unity.modules.unityanalytics": "1.0.0", 38 | "com.unity.modules.unitywebrequest": "1.0.0", 39 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 40 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 41 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 42 | "com.unity.modules.unitywebrequestwww": "1.0.0", 43 | "com.unity.modules.vehicles": "1.0.0", 44 | "com.unity.modules.video": "1.0.0", 45 | "com.unity.modules.vr": "1.0.0", 46 | "com.unity.modules.wind": "1.0.0", 47 | "com.unity.modules.xr": "1.0.0" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.animation": { 4 | "version": "5.0.4", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.2d.common": "4.0.3", 9 | "com.unity.mathematics": "1.1.0", 10 | "com.unity.2d.sprite": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.uielements": "1.0.0" 13 | }, 14 | "url": "https://packages.unity.com" 15 | }, 16 | "com.unity.2d.common": { 17 | "version": "4.0.3", 18 | "depth": 1, 19 | "source": "registry", 20 | "dependencies": { 21 | "com.unity.2d.sprite": "1.0.0", 22 | "com.unity.modules.uielements": "1.0.0" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.2d.path": { 27 | "version": "4.0.1", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.2d.pixel-perfect": { 34 | "version": "4.0.1", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.2d.psdimporter": { 41 | "version": "4.0.2", 42 | "depth": 0, 43 | "source": "registry", 44 | "dependencies": { 45 | "com.unity.2d.common": "4.0.2", 46 | "com.unity.2d.animation": "5.0.2", 47 | "com.unity.2d.sprite": "1.0.0" 48 | }, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.2d.sprite": { 52 | "version": "1.0.0", 53 | "depth": 0, 54 | "source": "builtin", 55 | "dependencies": {} 56 | }, 57 | "com.unity.2d.spriteshape": { 58 | "version": "5.1.1", 59 | "depth": 0, 60 | "source": "registry", 61 | "dependencies": { 62 | "com.unity.mathematics": "1.1.0", 63 | "com.unity.2d.common": "4.0.3", 64 | "com.unity.2d.path": "4.0.1", 65 | "com.unity.modules.physics2d": "1.0.0" 66 | }, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "com.unity.2d.tilemap": { 70 | "version": "1.0.0", 71 | "depth": 0, 72 | "source": "builtin", 73 | "dependencies": {} 74 | }, 75 | "com.unity.collab-proxy": { 76 | "version": "1.3.9", 77 | "depth": 0, 78 | "source": "registry", 79 | "dependencies": {}, 80 | "url": "https://packages.unity.com" 81 | }, 82 | "com.unity.ext.nunit": { 83 | "version": "1.0.6", 84 | "depth": 1, 85 | "source": "registry", 86 | "dependencies": {}, 87 | "url": "https://packages.unity.com" 88 | }, 89 | "com.unity.ide.rider": { 90 | "version": "2.0.7", 91 | "depth": 0, 92 | "source": "registry", 93 | "dependencies": { 94 | "com.unity.test-framework": "1.1.1" 95 | }, 96 | "url": "https://packages.unity.com" 97 | }, 98 | "com.unity.ide.visualstudio": { 99 | "version": "2.0.7", 100 | "depth": 0, 101 | "source": "registry", 102 | "dependencies": { 103 | "com.unity.test-framework": "1.1.9" 104 | }, 105 | "url": "https://packages.unity.com" 106 | }, 107 | "com.unity.ide.vscode": { 108 | "version": "1.2.3", 109 | "depth": 0, 110 | "source": "registry", 111 | "dependencies": {}, 112 | "url": "https://packages.unity.com" 113 | }, 114 | "com.unity.mathematics": { 115 | "version": "1.1.0", 116 | "depth": 1, 117 | "source": "registry", 118 | "dependencies": {}, 119 | "url": "https://packages.unity.com" 120 | }, 121 | "com.unity.test-framework": { 122 | "version": "1.1.24", 123 | "depth": 0, 124 | "source": "registry", 125 | "dependencies": { 126 | "com.unity.ext.nunit": "1.0.6", 127 | "com.unity.modules.imgui": "1.0.0", 128 | "com.unity.modules.jsonserialize": "1.0.0" 129 | }, 130 | "url": "https://packages.unity.com" 131 | }, 132 | "com.unity.textmeshpro": { 133 | "version": "3.0.1", 134 | "depth": 0, 135 | "source": "registry", 136 | "dependencies": { 137 | "com.unity.ugui": "1.0.0" 138 | }, 139 | "url": "https://packages.unity.com" 140 | }, 141 | "com.unity.timeline": { 142 | "version": "1.4.7", 143 | "depth": 0, 144 | "source": "registry", 145 | "dependencies": { 146 | "com.unity.modules.director": "1.0.0", 147 | "com.unity.modules.animation": "1.0.0", 148 | "com.unity.modules.audio": "1.0.0", 149 | "com.unity.modules.particlesystem": "1.0.0" 150 | }, 151 | "url": "https://packages.unity.com" 152 | }, 153 | "com.unity.ugui": { 154 | "version": "1.0.0", 155 | "depth": 0, 156 | "source": "builtin", 157 | "dependencies": { 158 | "com.unity.modules.ui": "1.0.0", 159 | "com.unity.modules.imgui": "1.0.0" 160 | } 161 | }, 162 | "com.unity.modules.ai": { 163 | "version": "1.0.0", 164 | "depth": 0, 165 | "source": "builtin", 166 | "dependencies": {} 167 | }, 168 | "com.unity.modules.androidjni": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": {} 173 | }, 174 | "com.unity.modules.animation": { 175 | "version": "1.0.0", 176 | "depth": 0, 177 | "source": "builtin", 178 | "dependencies": {} 179 | }, 180 | "com.unity.modules.assetbundle": { 181 | "version": "1.0.0", 182 | "depth": 0, 183 | "source": "builtin", 184 | "dependencies": {} 185 | }, 186 | "com.unity.modules.audio": { 187 | "version": "1.0.0", 188 | "depth": 0, 189 | "source": "builtin", 190 | "dependencies": {} 191 | }, 192 | "com.unity.modules.cloth": { 193 | "version": "1.0.0", 194 | "depth": 0, 195 | "source": "builtin", 196 | "dependencies": { 197 | "com.unity.modules.physics": "1.0.0" 198 | } 199 | }, 200 | "com.unity.modules.director": { 201 | "version": "1.0.0", 202 | "depth": 0, 203 | "source": "builtin", 204 | "dependencies": { 205 | "com.unity.modules.audio": "1.0.0", 206 | "com.unity.modules.animation": "1.0.0" 207 | } 208 | }, 209 | "com.unity.modules.imageconversion": { 210 | "version": "1.0.0", 211 | "depth": 0, 212 | "source": "builtin", 213 | "dependencies": {} 214 | }, 215 | "com.unity.modules.imgui": { 216 | "version": "1.0.0", 217 | "depth": 0, 218 | "source": "builtin", 219 | "dependencies": {} 220 | }, 221 | "com.unity.modules.jsonserialize": { 222 | "version": "1.0.0", 223 | "depth": 0, 224 | "source": "builtin", 225 | "dependencies": {} 226 | }, 227 | "com.unity.modules.particlesystem": { 228 | "version": "1.0.0", 229 | "depth": 0, 230 | "source": "builtin", 231 | "dependencies": {} 232 | }, 233 | "com.unity.modules.physics": { 234 | "version": "1.0.0", 235 | "depth": 0, 236 | "source": "builtin", 237 | "dependencies": {} 238 | }, 239 | "com.unity.modules.physics2d": { 240 | "version": "1.0.0", 241 | "depth": 0, 242 | "source": "builtin", 243 | "dependencies": {} 244 | }, 245 | "com.unity.modules.screencapture": { 246 | "version": "1.0.0", 247 | "depth": 0, 248 | "source": "builtin", 249 | "dependencies": { 250 | "com.unity.modules.imageconversion": "1.0.0" 251 | } 252 | }, 253 | "com.unity.modules.subsystems": { 254 | "version": "1.0.0", 255 | "depth": 1, 256 | "source": "builtin", 257 | "dependencies": { 258 | "com.unity.modules.jsonserialize": "1.0.0" 259 | } 260 | }, 261 | "com.unity.modules.terrain": { 262 | "version": "1.0.0", 263 | "depth": 0, 264 | "source": "builtin", 265 | "dependencies": {} 266 | }, 267 | "com.unity.modules.terrainphysics": { 268 | "version": "1.0.0", 269 | "depth": 0, 270 | "source": "builtin", 271 | "dependencies": { 272 | "com.unity.modules.physics": "1.0.0", 273 | "com.unity.modules.terrain": "1.0.0" 274 | } 275 | }, 276 | "com.unity.modules.tilemap": { 277 | "version": "1.0.0", 278 | "depth": 0, 279 | "source": "builtin", 280 | "dependencies": { 281 | "com.unity.modules.physics2d": "1.0.0" 282 | } 283 | }, 284 | "com.unity.modules.ui": { 285 | "version": "1.0.0", 286 | "depth": 0, 287 | "source": "builtin", 288 | "dependencies": {} 289 | }, 290 | "com.unity.modules.uielements": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.ui": "1.0.0", 296 | "com.unity.modules.imgui": "1.0.0", 297 | "com.unity.modules.jsonserialize": "1.0.0", 298 | "com.unity.modules.uielementsnative": "1.0.0" 299 | } 300 | }, 301 | "com.unity.modules.uielementsnative": { 302 | "version": "1.0.0", 303 | "depth": 1, 304 | "source": "builtin", 305 | "dependencies": { 306 | "com.unity.modules.ui": "1.0.0", 307 | "com.unity.modules.imgui": "1.0.0", 308 | "com.unity.modules.jsonserialize": "1.0.0" 309 | } 310 | }, 311 | "com.unity.modules.umbra": { 312 | "version": "1.0.0", 313 | "depth": 0, 314 | "source": "builtin", 315 | "dependencies": {} 316 | }, 317 | "com.unity.modules.unityanalytics": { 318 | "version": "1.0.0", 319 | "depth": 0, 320 | "source": "builtin", 321 | "dependencies": { 322 | "com.unity.modules.unitywebrequest": "1.0.0", 323 | "com.unity.modules.jsonserialize": "1.0.0" 324 | } 325 | }, 326 | "com.unity.modules.unitywebrequest": { 327 | "version": "1.0.0", 328 | "depth": 0, 329 | "source": "builtin", 330 | "dependencies": {} 331 | }, 332 | "com.unity.modules.unitywebrequestassetbundle": { 333 | "version": "1.0.0", 334 | "depth": 0, 335 | "source": "builtin", 336 | "dependencies": { 337 | "com.unity.modules.assetbundle": "1.0.0", 338 | "com.unity.modules.unitywebrequest": "1.0.0" 339 | } 340 | }, 341 | "com.unity.modules.unitywebrequestaudio": { 342 | "version": "1.0.0", 343 | "depth": 0, 344 | "source": "builtin", 345 | "dependencies": { 346 | "com.unity.modules.unitywebrequest": "1.0.0", 347 | "com.unity.modules.audio": "1.0.0" 348 | } 349 | }, 350 | "com.unity.modules.unitywebrequesttexture": { 351 | "version": "1.0.0", 352 | "depth": 0, 353 | "source": "builtin", 354 | "dependencies": { 355 | "com.unity.modules.unitywebrequest": "1.0.0", 356 | "com.unity.modules.imageconversion": "1.0.0" 357 | } 358 | }, 359 | "com.unity.modules.unitywebrequestwww": { 360 | "version": "1.0.0", 361 | "depth": 0, 362 | "source": "builtin", 363 | "dependencies": { 364 | "com.unity.modules.unitywebrequest": "1.0.0", 365 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 366 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 367 | "com.unity.modules.audio": "1.0.0", 368 | "com.unity.modules.assetbundle": "1.0.0", 369 | "com.unity.modules.imageconversion": "1.0.0" 370 | } 371 | }, 372 | "com.unity.modules.vehicles": { 373 | "version": "1.0.0", 374 | "depth": 0, 375 | "source": "builtin", 376 | "dependencies": { 377 | "com.unity.modules.physics": "1.0.0" 378 | } 379 | }, 380 | "com.unity.modules.video": { 381 | "version": "1.0.0", 382 | "depth": 0, 383 | "source": "builtin", 384 | "dependencies": { 385 | "com.unity.modules.audio": "1.0.0", 386 | "com.unity.modules.ui": "1.0.0", 387 | "com.unity.modules.unitywebrequest": "1.0.0" 388 | } 389 | }, 390 | "com.unity.modules.vr": { 391 | "version": "1.0.0", 392 | "depth": 0, 393 | "source": "builtin", 394 | "dependencies": { 395 | "com.unity.modules.jsonserialize": "1.0.0", 396 | "com.unity.modules.physics": "1.0.0", 397 | "com.unity.modules.xr": "1.0.0" 398 | } 399 | }, 400 | "com.unity.modules.wind": { 401 | "version": "1.0.0", 402 | "depth": 0, 403 | "source": "builtin", 404 | "dependencies": {} 405 | }, 406 | "com.unity.modules.xr": { 407 | "version": "1.0.0", 408 | "depth": 0, 409 | "source": "builtin", 410 | "dependencies": { 411 | "com.unity.modules.physics": "1.0.0", 412 | "com.unity.modules.jsonserialize": "1.0.0", 413 | "com.unity.modules.subsystems": "1.0.0" 414 | } 415 | } 416 | } 417 | } 418 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 50 37 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/SPH.unity 10 | guid: 2cda990e2423bbf4892e6590ba056729 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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: 10 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 31 | m_AssetPipelineMode: 1 32 | m_CacheServerMode: 0 33 | m_CacheServerEndpoint: 34 | m_CacheServerNamespacePrefix: default 35 | m_CacheServerEnableDownload: 1 36 | m_CacheServerEnableUpload: 1 37 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_VideoShadersIncludeMode: 2 32 | m_AlwaysIncludedShaders: 33 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | m_LogWhenShaderIsCompiled: 0 64 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | - serializedVersion: 3 297 | m_Name: Enable Debug Button 1 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: left ctrl 302 | altNegativeButton: 303 | altPositiveButton: joystick button 8 304 | gravity: 0 305 | dead: 0 306 | sensitivity: 0 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | - serializedVersion: 3 313 | m_Name: Enable Debug Button 2 314 | descriptiveName: 315 | descriptiveNegativeName: 316 | negativeButton: 317 | positiveButton: backspace 318 | altNegativeButton: 319 | altPositiveButton: joystick button 9 320 | gravity: 0 321 | dead: 0 322 | sensitivity: 0 323 | snap: 0 324 | invert: 0 325 | type: 0 326 | axis: 0 327 | joyNum: 0 328 | - serializedVersion: 3 329 | m_Name: Debug Reset 330 | descriptiveName: 331 | descriptiveNegativeName: 332 | negativeButton: 333 | positiveButton: left alt 334 | altNegativeButton: 335 | altPositiveButton: joystick button 1 336 | gravity: 0 337 | dead: 0 338 | sensitivity: 0 339 | snap: 0 340 | invert: 0 341 | type: 0 342 | axis: 0 343 | joyNum: 0 344 | - serializedVersion: 3 345 | m_Name: Debug Next 346 | descriptiveName: 347 | descriptiveNegativeName: 348 | negativeButton: 349 | positiveButton: page down 350 | altNegativeButton: 351 | altPositiveButton: joystick button 5 352 | gravity: 0 353 | dead: 0 354 | sensitivity: 0 355 | snap: 0 356 | invert: 0 357 | type: 0 358 | axis: 0 359 | joyNum: 0 360 | - serializedVersion: 3 361 | m_Name: Debug Previous 362 | descriptiveName: 363 | descriptiveNegativeName: 364 | negativeButton: 365 | positiveButton: page up 366 | altNegativeButton: 367 | altPositiveButton: joystick button 4 368 | gravity: 0 369 | dead: 0 370 | sensitivity: 0 371 | snap: 0 372 | invert: 0 373 | type: 0 374 | axis: 0 375 | joyNum: 0 376 | - serializedVersion: 3 377 | m_Name: Debug Validate 378 | descriptiveName: 379 | descriptiveNegativeName: 380 | negativeButton: 381 | positiveButton: return 382 | altNegativeButton: 383 | altPositiveButton: joystick button 0 384 | gravity: 0 385 | dead: 0 386 | sensitivity: 0 387 | snap: 0 388 | invert: 0 389 | type: 0 390 | axis: 0 391 | joyNum: 0 392 | - serializedVersion: 3 393 | m_Name: Debug Persistent 394 | descriptiveName: 395 | descriptiveNegativeName: 396 | negativeButton: 397 | positiveButton: right shift 398 | altNegativeButton: 399 | altPositiveButton: joystick button 2 400 | gravity: 0 401 | dead: 0 402 | sensitivity: 0 403 | snap: 0 404 | invert: 0 405 | type: 0 406 | axis: 0 407 | joyNum: 0 408 | - serializedVersion: 3 409 | m_Name: Debug Multiplier 410 | descriptiveName: 411 | descriptiveNegativeName: 412 | negativeButton: 413 | positiveButton: left shift 414 | altNegativeButton: 415 | altPositiveButton: joystick button 3 416 | gravity: 0 417 | dead: 0 418 | sensitivity: 0 419 | snap: 0 420 | invert: 0 421 | type: 0 422 | axis: 0 423 | joyNum: 0 424 | - serializedVersion: 3 425 | m_Name: Debug Horizontal 426 | descriptiveName: 427 | descriptiveNegativeName: 428 | negativeButton: left 429 | positiveButton: right 430 | altNegativeButton: 431 | altPositiveButton: 432 | gravity: 1000 433 | dead: 0.001 434 | sensitivity: 1000 435 | snap: 0 436 | invert: 0 437 | type: 0 438 | axis: 0 439 | joyNum: 0 440 | - serializedVersion: 3 441 | m_Name: Debug Vertical 442 | descriptiveName: 443 | descriptiveNegativeName: 444 | negativeButton: down 445 | positiveButton: up 446 | altNegativeButton: 447 | altPositiveButton: 448 | gravity: 1000 449 | dead: 0.001 450 | sensitivity: 1000 451 | snap: 0 452 | invert: 0 453 | type: 0 454 | axis: 0 455 | joyNum: 0 456 | - serializedVersion: 3 457 | m_Name: Debug Vertical 458 | descriptiveName: 459 | descriptiveNegativeName: 460 | negativeButton: down 461 | positiveButton: up 462 | altNegativeButton: 463 | altPositiveButton: 464 | gravity: 1000 465 | dead: 0.001 466 | sensitivity: 1000 467 | snap: 0 468 | invert: 0 469 | type: 2 470 | axis: 6 471 | joyNum: 0 472 | - serializedVersion: 3 473 | m_Name: Debug Horizontal 474 | descriptiveName: 475 | descriptiveNegativeName: 476 | negativeButton: left 477 | positiveButton: right 478 | altNegativeButton: 479 | altPositiveButton: 480 | gravity: 1000 481 | dead: 0.001 482 | sensitivity: 1000 483 | snap: 0 484 | invert: 0 485 | type: 2 486 | axis: 5 487 | joyNum: 0 488 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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: 5 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_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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: 22 7 | productGUID: 18863d6aa659f734e8cd94f45b0c2fbb 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: Johannes Schatteiner 16 | productName: Fluid Sims 1 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1920 46 | defaultScreenHeight: 1080 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | defaultIsNativeResolution: 1 72 | macRetinaSupport: 1 73 | runInBackground: 0 74 | captureSingleScreen: 0 75 | muteOtherAudioSources: 0 76 | Prepare IOS For Recording: 0 77 | Force IOS Speakers When Recording: 0 78 | deferSystemGesturesMode: 0 79 | hideHomeButton: 0 80 | submitAnalytics: 1 81 | usePlayerLog: 1 82 | bakeCollisionMeshes: 0 83 | forceSingleInstance: 0 84 | useFlipModelSwapchain: 1 85 | resizableWindow: 0 86 | useMacAppStoreValidation: 0 87 | macAppStoreCategory: public.app-category.games 88 | gpuSkinning: 0 89 | xboxPIXTextureCapture: 0 90 | xboxEnableAvatar: 0 91 | xboxEnableKinect: 0 92 | xboxEnableKinectAutoTracking: 0 93 | xboxEnableFitness: 0 94 | visibleInBackground: 1 95 | allowFullscreenSwitch: 1 96 | fullscreenMode: 1 97 | xboxSpeechDB: 0 98 | xboxEnableHeadOrientation: 0 99 | xboxEnableGuest: 0 100 | xboxEnablePIXSampling: 0 101 | metalFramebufferOnly: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOneEnableTypeOptimization: 0 109 | xboxOnePresentImmediateThreshold: 0 110 | switchQueueCommandMemory: 1048576 111 | switchQueueControlMemory: 16384 112 | switchQueueComputeMemory: 262144 113 | switchNVNShaderPoolsGranularity: 33554432 114 | switchNVNDefaultPoolsGranularity: 16777216 115 | switchNVNOtherPoolsGranularity: 16777216 116 | switchNVNMaxPublicTextureIDCount: 0 117 | switchNVNMaxPublicSamplerIDCount: 0 118 | stadiaPresentMode: 0 119 | stadiaTargetFramerate: 0 120 | vulkanNumSwapchainBuffers: 3 121 | vulkanEnableSetSRGBWrite: 0 122 | vulkanEnablePreTransform: 0 123 | vulkanEnableLateAcquireNextImage: 0 124 | m_SupportedAspectRatios: 125 | 4:3: 1 126 | 5:4: 1 127 | 16:10: 1 128 | 16:9: 1 129 | Others: 1 130 | bundleVersion: 1.0 131 | preloadedAssets: [] 132 | metroInputSource: 0 133 | wsaTransparentSwapchain: 0 134 | m_HolographicPauseOnTrackingLoss: 1 135 | xboxOneDisableKinectGpuReservation: 1 136 | xboxOneEnable7thCore: 1 137 | vrSettings: 138 | enable360StereoCapture: 0 139 | isWsaHolographicRemotingEnabled: 0 140 | enableFrameTimingStats: 0 141 | useHDRDisplay: 0 142 | D3DHDRBitDepth: 0 143 | m_ColorGamuts: 00000000 144 | targetPixelDensity: 30 145 | resolutionScalingMode: 0 146 | androidSupportedAspectRatio: 1 147 | androidMaxAspectRatio: 2.1 148 | applicationIdentifier: 149 | Standalone: com.JohannesSchatteiner.FluidSims1 150 | buildNumber: 151 | Standalone: 0 152 | iPhone: 0 153 | tvOS: 0 154 | overrideDefaultApplicationIdentifier: 0 155 | AndroidBundleVersionCode: 1 156 | AndroidMinSdkVersion: 19 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: 11.0 172 | tvOSSdkVersion: 0 173 | tvOSRequireExtendedGameController: 0 174 | tvOSTargetOSVersionString: 11.0 175 | uIPrerenderedIcon: 0 176 | uIRequiresPersistentWiFi: 0 177 | uIRequiresFullScreen: 1 178 | uIStatusBarHidden: 1 179 | uIExitOnSuspend: 0 180 | uIStatusBarStyle: 0 181 | appleTVSplashScreen: {fileID: 0} 182 | appleTVSplashScreen2x: {fileID: 0} 183 | tvOSSmallIconLayers: [] 184 | tvOSSmallIconLayers2x: [] 185 | tvOSLargeIconLayers: [] 186 | tvOSLargeIconLayers2x: [] 187 | tvOSTopShelfImageLayers: [] 188 | tvOSTopShelfImageLayers2x: [] 189 | tvOSTopShelfImageWideLayers: [] 190 | tvOSTopShelfImageWideLayers2x: [] 191 | iOSLaunchScreenType: 0 192 | iOSLaunchScreenPortrait: {fileID: 0} 193 | iOSLaunchScreenLandscape: {fileID: 0} 194 | iOSLaunchScreenBackgroundColor: 195 | serializedVersion: 2 196 | rgba: 0 197 | iOSLaunchScreenFillPct: 100 198 | iOSLaunchScreenSize: 100 199 | iOSLaunchScreenCustomXibPath: 200 | iOSLaunchScreeniPadType: 0 201 | iOSLaunchScreeniPadImage: {fileID: 0} 202 | iOSLaunchScreeniPadBackgroundColor: 203 | serializedVersion: 2 204 | rgba: 0 205 | iOSLaunchScreeniPadFillPct: 100 206 | iOSLaunchScreeniPadSize: 100 207 | iOSLaunchScreeniPadCustomXibPath: 208 | iOSLaunchScreenCustomStoryboardPath: 209 | iOSLaunchScreeniPadCustomStoryboardPath: 210 | iOSDeviceRequirements: [] 211 | iOSURLSchemes: [] 212 | iOSBackgroundModes: 0 213 | iOSMetalForceHardShadows: 0 214 | metalEditorSupport: 1 215 | metalAPIValidation: 1 216 | iOSRenderExtraFrameOnPause: 0 217 | iosCopyPluginsCodeInsteadOfSymlink: 0 218 | appleDeveloperTeamID: 219 | iOSManualSigningProvisioningProfileID: 220 | tvOSManualSigningProvisioningProfileID: 221 | iOSManualSigningProvisioningProfileType: 0 222 | tvOSManualSigningProvisioningProfileType: 0 223 | appleEnableAutomaticSigning: 0 224 | iOSRequireARKit: 0 225 | iOSAutomaticallyDetectAndAddCapabilities: 1 226 | appleEnableProMotion: 0 227 | shaderPrecisionModel: 0 228 | clonedFromGUID: 10ad67313f4034357812315f3c407484 229 | templatePackageId: com.unity.template.2d@4.0.2 230 | templateDefaultScene: Assets/Scenes/SampleScene.unity 231 | useCustomMainManifest: 0 232 | useCustomLauncherManifest: 0 233 | useCustomMainGradleTemplate: 0 234 | useCustomLauncherGradleManifest: 0 235 | useCustomBaseGradleTemplate: 0 236 | useCustomGradlePropertiesTemplate: 0 237 | useCustomProguardFile: 0 238 | AndroidTargetArchitectures: 1 239 | AndroidSplashScreenScale: 0 240 | androidSplashScreen: {fileID: 0} 241 | AndroidKeystoreName: 242 | AndroidKeyaliasName: 243 | AndroidBuildApkPerCpuArchitecture: 0 244 | AndroidTVCompatibility: 0 245 | AndroidIsGame: 1 246 | AndroidEnableTango: 0 247 | androidEnableBanner: 1 248 | androidUseLowAccuracyLocation: 0 249 | androidUseCustomKeystore: 0 250 | m_AndroidBanners: 251 | - width: 320 252 | height: 180 253 | banner: {fileID: 0} 254 | androidGamepadSupportLevel: 0 255 | AndroidMinifyWithR8: 0 256 | AndroidMinifyRelease: 0 257 | AndroidMinifyDebug: 0 258 | AndroidValidateAppBundleSize: 1 259 | AndroidAppBundleSizeToValidate: 150 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: [] 262 | m_BuildTargetBatching: [] 263 | m_BuildTargetGraphicsJobs: 264 | - m_BuildTarget: MacStandaloneSupport 265 | m_GraphicsJobs: 0 266 | - m_BuildTarget: Switch 267 | m_GraphicsJobs: 0 268 | - m_BuildTarget: MetroSupport 269 | m_GraphicsJobs: 0 270 | - m_BuildTarget: AppleTVSupport 271 | m_GraphicsJobs: 0 272 | - m_BuildTarget: BJMSupport 273 | m_GraphicsJobs: 0 274 | - m_BuildTarget: LinuxStandaloneSupport 275 | m_GraphicsJobs: 0 276 | - m_BuildTarget: PS4Player 277 | m_GraphicsJobs: 0 278 | - m_BuildTarget: iOSSupport 279 | m_GraphicsJobs: 0 280 | - m_BuildTarget: WindowsStandaloneSupport 281 | m_GraphicsJobs: 0 282 | - m_BuildTarget: XboxOnePlayer 283 | m_GraphicsJobs: 0 284 | - m_BuildTarget: LuminSupport 285 | m_GraphicsJobs: 0 286 | - m_BuildTarget: AndroidPlayer 287 | m_GraphicsJobs: 0 288 | - m_BuildTarget: WebGLSupport 289 | m_GraphicsJobs: 0 290 | m_BuildTargetGraphicsJobMode: [] 291 | m_BuildTargetGraphicsAPIs: 292 | - m_BuildTarget: AndroidPlayer 293 | m_APIs: 150000000b000000 294 | m_Automatic: 0 295 | - m_BuildTarget: iOSSupport 296 | m_APIs: 10000000 297 | m_Automatic: 1 298 | m_BuildTargetVRSettings: [] 299 | openGLRequireES31: 0 300 | openGLRequireES31AEP: 0 301 | openGLRequireES32: 0 302 | m_TemplateCustomTags: {} 303 | mobileMTRendering: 304 | Android: 1 305 | iPhone: 1 306 | tvOS: 1 307 | m_BuildTargetGroupLightmapEncodingQuality: [] 308 | m_BuildTargetGroupLightmapSettings: [] 309 | m_BuildTargetNormalMapEncoding: [] 310 | playModeTestRunnerEnabled: 0 311 | runPlayModeTestAsEditModeTest: 0 312 | actionOnDotNetUnhandledException: 1 313 | enableInternalProfiler: 0 314 | logObjCUncaughtExceptions: 1 315 | enableCrashReportAPI: 0 316 | cameraUsageDescription: 317 | locationUsageDescription: 318 | microphoneUsageDescription: 319 | switchNMETAOverride: 320 | switchNetLibKey: 321 | switchSocketMemoryPoolSize: 6144 322 | switchSocketAllocatorPoolSize: 128 323 | switchSocketConcurrencyLimit: 14 324 | switchScreenResolutionBehavior: 2 325 | switchUseCPUProfiler: 0 326 | switchUseGOLDLinker: 0 327 | switchApplicationID: 0x01004b9000490000 328 | switchNSODependencies: 329 | switchTitleNames_0: 330 | switchTitleNames_1: 331 | switchTitleNames_2: 332 | switchTitleNames_3: 333 | switchTitleNames_4: 334 | switchTitleNames_5: 335 | switchTitleNames_6: 336 | switchTitleNames_7: 337 | switchTitleNames_8: 338 | switchTitleNames_9: 339 | switchTitleNames_10: 340 | switchTitleNames_11: 341 | switchTitleNames_12: 342 | switchTitleNames_13: 343 | switchTitleNames_14: 344 | switchTitleNames_15: 345 | switchPublisherNames_0: 346 | switchPublisherNames_1: 347 | switchPublisherNames_2: 348 | switchPublisherNames_3: 349 | switchPublisherNames_4: 350 | switchPublisherNames_5: 351 | switchPublisherNames_6: 352 | switchPublisherNames_7: 353 | switchPublisherNames_8: 354 | switchPublisherNames_9: 355 | switchPublisherNames_10: 356 | switchPublisherNames_11: 357 | switchPublisherNames_12: 358 | switchPublisherNames_13: 359 | switchPublisherNames_14: 360 | switchPublisherNames_15: 361 | switchIcons_0: {fileID: 0} 362 | switchIcons_1: {fileID: 0} 363 | switchIcons_2: {fileID: 0} 364 | switchIcons_3: {fileID: 0} 365 | switchIcons_4: {fileID: 0} 366 | switchIcons_5: {fileID: 0} 367 | switchIcons_6: {fileID: 0} 368 | switchIcons_7: {fileID: 0} 369 | switchIcons_8: {fileID: 0} 370 | switchIcons_9: {fileID: 0} 371 | switchIcons_10: {fileID: 0} 372 | switchIcons_11: {fileID: 0} 373 | switchIcons_12: {fileID: 0} 374 | switchIcons_13: {fileID: 0} 375 | switchIcons_14: {fileID: 0} 376 | switchIcons_15: {fileID: 0} 377 | switchSmallIcons_0: {fileID: 0} 378 | switchSmallIcons_1: {fileID: 0} 379 | switchSmallIcons_2: {fileID: 0} 380 | switchSmallIcons_3: {fileID: 0} 381 | switchSmallIcons_4: {fileID: 0} 382 | switchSmallIcons_5: {fileID: 0} 383 | switchSmallIcons_6: {fileID: 0} 384 | switchSmallIcons_7: {fileID: 0} 385 | switchSmallIcons_8: {fileID: 0} 386 | switchSmallIcons_9: {fileID: 0} 387 | switchSmallIcons_10: {fileID: 0} 388 | switchSmallIcons_11: {fileID: 0} 389 | switchSmallIcons_12: {fileID: 0} 390 | switchSmallIcons_13: {fileID: 0} 391 | switchSmallIcons_14: {fileID: 0} 392 | switchSmallIcons_15: {fileID: 0} 393 | switchManualHTML: 394 | switchAccessibleURLs: 395 | switchLegalInformation: 396 | switchMainThreadStackSize: 1048576 397 | switchPresenceGroupId: 398 | switchLogoHandling: 0 399 | switchReleaseVersion: 0 400 | switchDisplayVersion: 1.0.0 401 | switchStartupUserAccount: 0 402 | switchTouchScreenUsage: 0 403 | switchSupportedLanguagesMask: 0 404 | switchLogoType: 0 405 | switchApplicationErrorCodeCategory: 406 | switchUserAccountSaveDataSize: 0 407 | switchUserAccountSaveDataJournalSize: 0 408 | switchApplicationAttribute: 0 409 | switchCardSpecSize: -1 410 | switchCardSpecClock: -1 411 | switchRatingsMask: 0 412 | switchRatingsInt_0: 0 413 | switchRatingsInt_1: 0 414 | switchRatingsInt_2: 0 415 | switchRatingsInt_3: 0 416 | switchRatingsInt_4: 0 417 | switchRatingsInt_5: 0 418 | switchRatingsInt_6: 0 419 | switchRatingsInt_7: 0 420 | switchRatingsInt_8: 0 421 | switchRatingsInt_9: 0 422 | switchRatingsInt_10: 0 423 | switchRatingsInt_11: 0 424 | switchRatingsInt_12: 0 425 | switchLocalCommunicationIds_0: 426 | switchLocalCommunicationIds_1: 427 | switchLocalCommunicationIds_2: 428 | switchLocalCommunicationIds_3: 429 | switchLocalCommunicationIds_4: 430 | switchLocalCommunicationIds_5: 431 | switchLocalCommunicationIds_6: 432 | switchLocalCommunicationIds_7: 433 | switchParentalControl: 0 434 | switchAllowsScreenshot: 1 435 | switchAllowsVideoCapturing: 1 436 | switchAllowsRuntimeAddOnContentInstall: 0 437 | switchDataLossConfirmation: 0 438 | switchUserAccountLockEnabled: 0 439 | switchSystemResourceMemory: 16777216 440 | switchSupportedNpadStyles: 22 441 | switchNativeFsCacheSize: 32 442 | switchIsHoldTypeHorizontal: 0 443 | switchSupportedNpadCount: 8 444 | switchSocketConfigEnabled: 0 445 | switchTcpInitialSendBufferSize: 32 446 | switchTcpInitialReceiveBufferSize: 64 447 | switchTcpAutoSendBufferSizeMax: 256 448 | switchTcpAutoReceiveBufferSizeMax: 256 449 | switchUdpSendBufferSize: 9 450 | switchUdpReceiveBufferSize: 42 451 | switchSocketBufferEfficiency: 4 452 | switchSocketInitializeEnabled: 1 453 | switchNetworkInterfaceManagerInitializeEnabled: 1 454 | switchPlayerConnectionEnabled: 1 455 | switchUseNewStyleFilepaths: 0 456 | ps4NPAgeRating: 12 457 | ps4NPTitleSecret: 458 | ps4NPTrophyPackPath: 459 | ps4ParentalLevel: 11 460 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 461 | ps4Category: 0 462 | ps4MasterVersion: 01.00 463 | ps4AppVersion: 01.00 464 | ps4AppType: 0 465 | ps4ParamSfxPath: 466 | ps4VideoOutPixelFormat: 0 467 | ps4VideoOutInitialWidth: 1920 468 | ps4VideoOutBaseModeInitialWidth: 1920 469 | ps4VideoOutReprojectionRate: 60 470 | ps4PronunciationXMLPath: 471 | ps4PronunciationSIGPath: 472 | ps4BackgroundImagePath: 473 | ps4StartupImagePath: 474 | ps4StartupImagesFolder: 475 | ps4IconImagesFolder: 476 | ps4SaveDataImagePath: 477 | ps4SdkOverride: 478 | ps4BGMPath: 479 | ps4ShareFilePath: 480 | ps4ShareOverlayImagePath: 481 | ps4PrivacyGuardImagePath: 482 | ps4ExtraSceSysFile: 483 | ps4NPtitleDatPath: 484 | ps4RemotePlayKeyAssignment: -1 485 | ps4RemotePlayKeyMappingDir: 486 | ps4PlayTogetherPlayerCount: 0 487 | ps4EnterButtonAssignment: 2 488 | ps4ApplicationParam1: 0 489 | ps4ApplicationParam2: 0 490 | ps4ApplicationParam3: 0 491 | ps4ApplicationParam4: 0 492 | ps4DownloadDataSize: 0 493 | ps4GarlicHeapSize: 2048 494 | ps4ProGarlicHeapSize: 2560 495 | playerPrefsMaxSize: 32768 496 | ps4Passcode: bi9UOuSpM2Tlh01vOzwvSikHFswuzleh 497 | ps4pnSessions: 1 498 | ps4pnPresence: 1 499 | ps4pnFriends: 1 500 | ps4pnGameCustomData: 1 501 | playerPrefsSupport: 0 502 | enableApplicationExit: 0 503 | resetTempFolder: 1 504 | restrictedAudioUsageRights: 0 505 | ps4UseResolutionFallback: 0 506 | ps4ReprojectionSupport: 0 507 | ps4UseAudio3dBackend: 0 508 | ps4UseLowGarlicFragmentationMode: 1 509 | ps4SocialScreenEnabled: 0 510 | ps4ScriptOptimizationLevel: 2 511 | ps4Audio3dVirtualSpeakerCount: 14 512 | ps4attribCpuUsage: 0 513 | ps4PatchPkgPath: 514 | ps4PatchLatestPkgPath: 515 | ps4PatchChangeinfoPath: 516 | ps4PatchDayOne: 0 517 | ps4attribUserManagement: 0 518 | ps4attribMoveSupport: 0 519 | ps4attrib3DSupport: 0 520 | ps4attribShareSupport: 0 521 | ps4attribExclusiveVR: 0 522 | ps4disableAutoHideSplash: 0 523 | ps4videoRecordingFeaturesUsed: 0 524 | ps4contentSearchFeaturesUsed: 0 525 | ps4CompatibilityPS5: 0 526 | ps4GPU800MHz: 1 527 | ps4attribEyeToEyeDistanceSettingVR: 0 528 | ps4IncludedModules: [] 529 | ps4attribVROutputEnabled: 0 530 | monoEnv: 531 | splashScreenBackgroundSourceLandscape: {fileID: 0} 532 | splashScreenBackgroundSourcePortrait: {fileID: 0} 533 | blurSplashScreenBackground: 1 534 | spritePackerPolicy: 535 | webGLMemorySize: 32 536 | webGLExceptionSupport: 1 537 | webGLNameFilesAsHashes: 0 538 | webGLDataCaching: 1 539 | webGLDebugSymbols: 0 540 | webGLEmscriptenArgs: 541 | webGLModulesDirectory: 542 | webGLTemplate: APPLICATION:Default 543 | webGLAnalyzeBuildSize: 0 544 | webGLUseEmbeddedResources: 0 545 | webGLCompressionFormat: 0 546 | webGLWasmArithmeticExceptions: 0 547 | webGLLinkerTarget: 1 548 | webGLThreadsSupport: 0 549 | webGLDecompressionFallback: 0 550 | scriptingDefineSymbols: {} 551 | additionalCompilerArguments: {} 552 | platformArchitecture: {} 553 | scriptingBackend: 554 | Standalone: 1 555 | il2cppCompilerConfiguration: 556 | Standalone: 2 557 | managedStrippingLevel: {} 558 | incrementalIl2cppBuild: {} 559 | suppressCommonWarnings: 1 560 | allowUnsafeCode: 0 561 | useDeterministicCompilation: 1 562 | useReferenceAssemblies: 1 563 | enableRoslynAnalyzers: 1 564 | additionalIl2CppArgs: 565 | scriptingRuntimeVersion: 1 566 | gcIncremental: 1 567 | assemblyVersionValidation: 1 568 | gcWBarrierValidation: 0 569 | apiCompatibilityLevelPerPlatform: 570 | Standalone: 3 571 | m_RenderingPath: 1 572 | m_MobileRenderingPath: 1 573 | metroPackageName: 2D_BuiltInRenderer 574 | metroPackageVersion: 575 | metroCertificatePath: 576 | metroCertificatePassword: 577 | metroCertificateSubject: 578 | metroCertificateIssuer: 579 | metroCertificateNotAfter: 0000000000000000 580 | metroApplicationDescription: 2D_BuiltInRenderer 581 | wsaImages: {} 582 | metroTileShortName: 583 | metroTileShowName: 0 584 | metroMediumTileShowName: 0 585 | metroLargeTileShowName: 0 586 | metroWideTileShowName: 0 587 | metroSupportStreamingInstall: 0 588 | metroLastRequiredScene: 0 589 | metroDefaultTileSize: 1 590 | metroTileForegroundText: 2 591 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 592 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 593 | metroSplashScreenUseBackgroundColor: 0 594 | platformCapabilities: {} 595 | metroTargetDeviceFamilies: {} 596 | metroFTAName: 597 | metroFTAFileTypes: [] 598 | metroProtocolName: 599 | XboxOneProductId: 600 | XboxOneUpdateKey: 601 | XboxOneSandboxId: 602 | XboxOneContentId: 603 | XboxOneTitleId: 604 | XboxOneSCId: 605 | XboxOneGameOsOverridePath: 606 | XboxOnePackagingOverridePath: 607 | XboxOneAppManifestOverridePath: 608 | XboxOneVersion: 1.0.0.0 609 | XboxOnePackageEncryption: 0 610 | XboxOnePackageUpdateGranularity: 2 611 | XboxOneDescription: 612 | XboxOneLanguage: 613 | - enus 614 | XboxOneCapability: [] 615 | XboxOneGameRating: {} 616 | XboxOneIsContentPackage: 0 617 | XboxOneEnhancedXboxCompatibilityMode: 0 618 | XboxOneEnableGPUVariability: 1 619 | XboxOneSockets: {} 620 | XboxOneSplashScreen: {fileID: 0} 621 | XboxOneAllowedProductIds: [] 622 | XboxOnePersistentLocalStorageSize: 0 623 | XboxOneXTitleMemory: 8 624 | XboxOneOverrideIdentityName: 625 | XboxOneOverrideIdentityPublisher: 626 | vrEditorSettings: {} 627 | cloudServicesEnabled: {} 628 | luminIcon: 629 | m_Name: 630 | m_ModelFolderPath: 631 | m_PortalFolderPath: 632 | luminCert: 633 | m_CertPath: 634 | m_SignPackage: 1 635 | luminIsChannelApp: 0 636 | luminVersion: 637 | m_VersionCode: 1 638 | m_VersionName: 639 | apiCompatibilityLevel: 6 640 | activeInputHandler: 0 641 | cloudProjectId: 642 | framebufferDepthMemorylessMode: 0 643 | qualitySettingsNames: [] 644 | projectName: 645 | organizationId: 646 | cloudEnabled: 0 647 | legacyClampBlendShapeWeights: 0 648 | virtualTexturingSupportEnabled: 0 649 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.5f1 2 | m_EditorVersionWithRevision: 2020.3.5f1 (8095aa901b9b) 3 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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 | skinWeights: 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: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 0} 44 | excludedTargetPlatforms: [] 45 | - serializedVersion: 2 46 | name: Low 47 | pixelLightCount: 0 48 | shadows: 0 49 | shadowResolution: 0 50 | shadowProjection: 1 51 | shadowCascades: 1 52 | shadowDistance: 20 53 | shadowNearPlaneOffset: 3 54 | shadowCascade2Split: 0.33333334 55 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 56 | shadowmaskMode: 0 57 | skinWeights: 2 58 | textureQuality: 0 59 | anisotropicTextures: 0 60 | antiAliasing: 0 61 | softParticles: 0 62 | softVegetation: 0 63 | realtimeReflectionProbes: 0 64 | billboardsFaceCameraPosition: 0 65 | vSyncCount: 0 66 | lodBias: 0.4 67 | maximumLODLevel: 0 68 | streamingMipmapsActive: 0 69 | streamingMipmapsAddAllCameras: 1 70 | streamingMipmapsMemoryBudget: 512 71 | streamingMipmapsRenderersPerFrame: 512 72 | streamingMipmapsMaxLevelReduction: 2 73 | streamingMipmapsMaxFileIORequests: 1024 74 | particleRaycastBudget: 16 75 | asyncUploadTimeSlice: 2 76 | asyncUploadBufferSize: 16 77 | asyncUploadPersistentBuffer: 1 78 | resolutionScalingFixedDPIFactor: 1 79 | customRenderPipeline: {fileID: 0} 80 | excludedTargetPlatforms: [] 81 | - serializedVersion: 2 82 | name: Medium 83 | pixelLightCount: 1 84 | shadows: 1 85 | shadowResolution: 0 86 | shadowProjection: 1 87 | shadowCascades: 1 88 | shadowDistance: 20 89 | shadowNearPlaneOffset: 3 90 | shadowCascade2Split: 0.33333334 91 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 92 | shadowmaskMode: 0 93 | skinWeights: 2 94 | textureQuality: 0 95 | anisotropicTextures: 1 96 | antiAliasing: 0 97 | softParticles: 0 98 | softVegetation: 0 99 | realtimeReflectionProbes: 0 100 | billboardsFaceCameraPosition: 0 101 | vSyncCount: 1 102 | lodBias: 0.7 103 | maximumLODLevel: 0 104 | streamingMipmapsActive: 0 105 | streamingMipmapsAddAllCameras: 1 106 | streamingMipmapsMemoryBudget: 512 107 | streamingMipmapsRenderersPerFrame: 512 108 | streamingMipmapsMaxLevelReduction: 2 109 | streamingMipmapsMaxFileIORequests: 1024 110 | particleRaycastBudget: 64 111 | asyncUploadTimeSlice: 2 112 | asyncUploadBufferSize: 16 113 | asyncUploadPersistentBuffer: 1 114 | resolutionScalingFixedDPIFactor: 1 115 | customRenderPipeline: {fileID: 0} 116 | excludedTargetPlatforms: [] 117 | - serializedVersion: 2 118 | name: High 119 | pixelLightCount: 2 120 | shadows: 2 121 | shadowResolution: 1 122 | shadowProjection: 1 123 | shadowCascades: 2 124 | shadowDistance: 40 125 | shadowNearPlaneOffset: 3 126 | shadowCascade2Split: 0.33333334 127 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 128 | shadowmaskMode: 1 129 | skinWeights: 2 130 | textureQuality: 0 131 | anisotropicTextures: 1 132 | antiAliasing: 0 133 | softParticles: 0 134 | softVegetation: 1 135 | realtimeReflectionProbes: 1 136 | billboardsFaceCameraPosition: 1 137 | vSyncCount: 1 138 | lodBias: 1 139 | maximumLODLevel: 0 140 | streamingMipmapsActive: 0 141 | streamingMipmapsAddAllCameras: 1 142 | streamingMipmapsMemoryBudget: 512 143 | streamingMipmapsRenderersPerFrame: 512 144 | streamingMipmapsMaxLevelReduction: 2 145 | streamingMipmapsMaxFileIORequests: 1024 146 | particleRaycastBudget: 256 147 | asyncUploadTimeSlice: 2 148 | asyncUploadBufferSize: 16 149 | asyncUploadPersistentBuffer: 1 150 | resolutionScalingFixedDPIFactor: 1 151 | customRenderPipeline: {fileID: 0} 152 | excludedTargetPlatforms: [] 153 | - serializedVersion: 2 154 | name: Very High 155 | pixelLightCount: 3 156 | shadows: 2 157 | shadowResolution: 2 158 | shadowProjection: 1 159 | shadowCascades: 2 160 | shadowDistance: 70 161 | shadowNearPlaneOffset: 3 162 | shadowCascade2Split: 0.33333334 163 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 164 | shadowmaskMode: 1 165 | skinWeights: 4 166 | textureQuality: 0 167 | anisotropicTextures: 2 168 | antiAliasing: 2 169 | softParticles: 1 170 | softVegetation: 1 171 | realtimeReflectionProbes: 1 172 | billboardsFaceCameraPosition: 1 173 | vSyncCount: 1 174 | lodBias: 1.5 175 | maximumLODLevel: 0 176 | streamingMipmapsActive: 0 177 | streamingMipmapsAddAllCameras: 1 178 | streamingMipmapsMemoryBudget: 512 179 | streamingMipmapsRenderersPerFrame: 512 180 | streamingMipmapsMaxLevelReduction: 2 181 | streamingMipmapsMaxFileIORequests: 1024 182 | particleRaycastBudget: 1024 183 | asyncUploadTimeSlice: 2 184 | asyncUploadBufferSize: 16 185 | asyncUploadPersistentBuffer: 1 186 | resolutionScalingFixedDPIFactor: 1 187 | customRenderPipeline: {fileID: 0} 188 | excludedTargetPlatforms: [] 189 | - serializedVersion: 2 190 | name: Ultra 191 | pixelLightCount: 4 192 | shadows: 2 193 | shadowResolution: 2 194 | shadowProjection: 1 195 | shadowCascades: 4 196 | shadowDistance: 150 197 | shadowNearPlaneOffset: 3 198 | shadowCascade2Split: 0.33333334 199 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 200 | shadowmaskMode: 1 201 | skinWeights: 255 202 | textureQuality: 0 203 | anisotropicTextures: 2 204 | antiAliasing: 2 205 | softParticles: 1 206 | softVegetation: 1 207 | realtimeReflectionProbes: 1 208 | billboardsFaceCameraPosition: 1 209 | vSyncCount: 0 210 | lodBias: 2 211 | maximumLODLevel: 0 212 | streamingMipmapsActive: 0 213 | streamingMipmapsAddAllCameras: 1 214 | streamingMipmapsMemoryBudget: 512 215 | streamingMipmapsRenderersPerFrame: 512 216 | streamingMipmapsMaxLevelReduction: 2 217 | streamingMipmapsMaxFileIORequests: 1024 218 | particleRaycastBudget: 4096 219 | asyncUploadTimeSlice: 2 220 | asyncUploadBufferSize: 16 221 | asyncUploadPersistentBuffer: 1 222 | resolutionScalingFixedDPIFactor: 1 223 | customRenderPipeline: {fileID: 0} 224 | excludedTargetPlatforms: [] 225 | m_PerPlatformDefaultQuality: 226 | Android: 2 227 | Lumin: 5 228 | Nintendo Switch: 5 229 | PS4: 5 230 | Stadia: 5 231 | Standalone: 5 232 | WebGL: 3 233 | Windows Store Apps: 5 234 | XboxOne: 5 235 | iPhone: 2 236 | tvOS: 2 237 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/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 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /MonoBehaviour_ComputeShader/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity Smoothed Particle Hydrodynamics 2 | This repository contains two Unity projects showcasing fluid simulations with the SPH method. There are three different implementations using: 3 | 1. MonoBehaviour (single-threaded CPU) 4 | 2. ComputeShader (GPU) 5 | 3. Entity Component System (DOTS, multi-threaded CPU via JobSystem) 6 | 7 | As spatial acceleration structure a uniform grid (as described by Simon Green) has been chosen. Particles are represented as uniformely sized spheres. Their size (= interaction radius) has been chosen with respect to the grid cell size (= 2x particle radius) so that one particle must only consider 8 cells in total for its neighbour search. There is no collision geometry involved (only boundary condition for simulation space; particles are guided only by SPH). The implementations are deliberately similar to ease understanding of the SPH method and its performance impact when implemented using different parallelisation techniques, namely the Entity-Component-System (ECS) and ComputeShaders. 8 | 9 | Usage: Open one of the two unity projects. After restoring packages you may start the application in the editor (you can also build although note the difference of building for ECS via BuildConfiguration). The MonoBehaviour implementation is disabled by default as it shares a scene with the ComputeShader implementation that is enabled by default (see "MonoBehaviour CPU SPH" and "ComputeShader GPU SPH" gameobjects in "SPH" scene). You can influence simulation parameters and view debug information on the gameobjects' SPH management scripts (ParticleManager.cs for MonoBehaviour implementation and ComputeShaderParticleManager.cs for ComputeShader implementation). Be careful with the MonoBehaviour implementaion's simulation parameters, as you can easily freeze your unity editor if you want to simulate too many particles. The ECS project does not have any way to change and view simulation parameters in the editor. Therefore, you can only influence the simulation by editing the SPHSystem.cs file. Also be careful when changing the particle interaction radius and grid cell size because it could break the neighbour search. 10 | 11 | Known limitations: 12 | - Due to the hashgrid's limitation of having a maximum number of particles per cell, the simulation may become unstable if more particles than that occupy a cell's space. See issue [#1](https://github.com/Gornhoth/Unity-Smoothed-Particle-Hydrodynamics/issues/1) for more information. 13 | 14 | Knowledge and inspiration for the code in this repository was taken from: 15 | - Doyub Kim https://github.com/doyubkim/fluid-engine-dev 16 | - Müller, Matthias, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications." 17 | - Simon Green "Particle simulation using cuda." 18 | - https://lucasschuermann.com/writing/implementing-sph-in-2d 19 | - Marcel Kießlich 20 | - Pascal Blessing 21 | 22 | https://user-images.githubusercontent.com/34295773/138610298-1851bf02-e4a4-4335-a02d-151825802617.mp4 23 | 24 | ![sensibleConfig](https://user-images.githubusercontent.com/34295773/138756364-eb689db3-0481-45ed-b74c-f559fe62911a.png) 25 | 26 | FYI: If you ever wondered just how big the difference between (parallel-)CPU and GPU implementations is, here is a plot measuring the average frametimes over the number of particles for each implementation on a system with an AMD Ryzen 3600 and NVIDIA GeForce RTX 2060 Super: 27 | 28 | ![AvgFrametimeBase_System2](https://user-images.githubusercontent.com/34295773/138755834-7dfae6c7-9682-43d3-b97d-67c051705f5b.png) 29 | --------------------------------------------------------------------------------