├── .gitignore ├── Assets ├── Samples.meta └── Samples │ ├── Signed Distance Field Generator.meta │ └── Signed Distance Field Generator │ ├── 1.0.2.meta │ └── 1.0.2 │ ├── Visualization Example.meta │ └── Visualization Example │ ├── Material.meta │ ├── Material │ ├── Visualizer.mat │ └── Visualizer.mat.meta │ ├── Meshes.meta │ ├── Meshes │ ├── Bunny.fbx │ └── Bunny.fbx.meta │ ├── SDF.meta │ ├── SDF │ ├── Bunny_sdf.asset │ └── Bunny_sdf.asset.meta │ ├── Scenes.meta │ ├── Scenes │ ├── VisualizationExample.unity │ └── VisualizationExample.unity.meta │ ├── Shaders.meta │ └── Shaders │ ├── Visualizer.shader │ └── Visualizer.shader.meta ├── LICENSE ├── Packages ├── com.dss.sdf-generator │ ├── Editor.meta │ ├── Editor │ │ ├── DSS.SignedDistanceFieldGenerator.Editor.asmdef │ │ ├── DSS.SignedDistanceFieldGenerator.Editor.asmdef.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── GeneratorWindow.cs │ │ │ └── GeneratorWindow.cs.meta │ ├── LICENSE │ ├── LICENSE.meta │ ├── Runtime.meta │ ├── Runtime │ │ ├── DSS.SignedDistanceFieldGenerator.Runtime.asmdef │ │ ├── DSS.SignedDistanceFieldGenerator.Runtime.asmdef.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── GenerateSDF.compute │ │ │ └── GenerateSDF.compute.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── Generator.cs │ │ │ └── Generator.cs.meta │ ├── Samples~ │ │ └── VisualizationExample │ │ │ ├── Material.meta │ │ │ ├── Material │ │ │ ├── Visualizer.mat │ │ │ └── Visualizer.mat.meta │ │ │ ├── Meshes.meta │ │ │ ├── Meshes │ │ │ ├── Bunny.fbx │ │ │ └── Bunny.fbx.meta │ │ │ ├── SDF.meta │ │ │ ├── SDF │ │ │ ├── Bunny_sdf.asset │ │ │ └── Bunny_sdf.asset.meta │ │ │ ├── Scenes.meta │ │ │ ├── Scenes │ │ │ ├── Demo Scene.unity.meta │ │ │ └── VisualizationExample.unity │ │ │ └── Shaders │ │ │ ├── Visualizer.shader │ │ │ └── Visualizer.shader.meta │ ├── changelog.md │ ├── changelog.md.meta │ ├── package.json │ ├── package.json.meta │ ├── readme.md │ └── readme.md.meta ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── 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 ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset ├── img └── nHyQgX9.gif └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | 3 | # This .gitignore file should be placed at the root of your Unity project directory 4 | # 5 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 6 | # 7 | /[Ll]ibrary/ 8 | /[Tt]emp/ 9 | /[Oo]bj/ 10 | /[Bb]uild/ 11 | /[Bb]uilds/ 12 | /[Ll]ogs/ 13 | /[Uu]ser[Ss]ettings/ 14 | 15 | # MemoryCaptures can get excessive in size. 16 | # They also could contain extremely sensitive data 17 | /[Mm]emoryCaptures/ 18 | 19 | # Asset meta data should only be ignored when the corresponding asset is also ignored 20 | !/[Aa]ssets/**/*.meta 21 | 22 | # Uncomment this line if you wish to ignore the asset store tools plugin 23 | # /[Aa]ssets/AssetStoreTools* 24 | 25 | # Autogenerated Jetbrains Rider plugin 26 | /[Aa]ssets/Plugins/Editor/JetBrains* 27 | 28 | # Visual Studio cache directory 29 | .vs/ 30 | 31 | # Gradle cache directory 32 | .gradle/ 33 | 34 | # Autogenerated VS/MD/Consulo solution and project files 35 | ExportedObj/ 36 | .consulo/ 37 | *.csproj 38 | *.unityproj 39 | *.sln 40 | *.suo 41 | *.tmp 42 | *.user 43 | *.userprefs 44 | *.pidb 45 | *.booproj 46 | *.svd 47 | *.pdb 48 | *.mdb 49 | *.opendb 50 | *.VC.db 51 | 52 | # Unity3D generated meta files 53 | *.pidb.meta 54 | *.pdb.meta 55 | *.mdb.meta 56 | 57 | # Unity3D generated file on crash reports 58 | sysinfo.txt 59 | 60 | # Builds 61 | *.apk 62 | *.aab 63 | *.unitypackage 64 | 65 | # Crashlytics generated file 66 | crashlytics-build.properties 67 | 68 | # Packed Addressables 69 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 70 | 71 | # Temporary auto-generated Android Assets 72 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 73 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /Assets/Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9a9092a6832b4cf9a69eb53a9215272 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edac59bcafed34d1d983c1eb8be3d11a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9154b9b59df2f40eeafd8405e056d943 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02ce5078d30304190ab6e01546020553 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4df67ca90ccb425f9548fd4c528f60a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Material/Visualizer.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: Visualizer 11 | m_Shader: {fileID: 4800000, guid: 51110bc88b3d8472cb16c4494c1dd520, type: 3} 12 | m_ShaderKeywords: VERTEX_LIT 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _SDF: 23 | m_Texture: {fileID: 11700000, guid: ba94c0a769e4146e48a1a972cbe0a568, type: 2} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Volume: 27 | m_Texture: {fileID: 11700000, guid: 0906b400b6edd454a9cd76b419b38a9b, type: 2} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | m_Floats: 31 | - _Density: 10 32 | - _MaxSteps: 500 33 | - _Shade: 0 34 | - _StepCount: 64 35 | - _VertexLit: 1 36 | m_Colors: 37 | - _Center: {r: 0, g: 0, b: 0, a: 1} 38 | - _MaxExtents: {r: 0.084784, g: 0.16336519, b: 0.065672, a: 1} 39 | - _MinExtents: {r: -0.084996, g: -0.004582, b: -0.066039, a: 1} 40 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Material/Visualizer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0abb726bb4174b8783659fa6b66c89f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Meshes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a78a29427472b4c0eb9e16b90432283b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Meshes/Bunny.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielshervheim/unity-sdf-generator/c13507ecb0df533240e2665f45e8d20c29ce5f30/Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Meshes/Bunny.fbx -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Meshes/Bunny.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8efbe262a87d3496e8bda924a4fe55b8 3 | ModelImporter: 4 | serializedVersion: 19301 5 | internalIDToNameTable: 6 | - first: 7 | 1: 100000 8 | second: //RootNode 9 | - first: 10 | 4: 400000 11 | second: //RootNode 12 | - first: 13 | 21: 2100000 14 | second: Default Material1 15 | - first: 16 | 23: 2300000 17 | second: //RootNode 18 | - first: 19 | 33: 3300000 20 | second: //RootNode 21 | - first: 22 | 43: 4300000 23 | second: default-retopo 3 24 | externalObjects: {} 25 | materials: 26 | materialImportMode: 1 27 | materialName: 0 28 | materialSearch: 1 29 | materialLocation: 1 30 | animations: 31 | legacyGenerateAnimations: 4 32 | bakeSimulation: 0 33 | resampleCurves: 1 34 | optimizeGameObjects: 0 35 | motionNodeName: 36 | rigImportErrors: 37 | rigImportWarnings: 38 | animationImportErrors: 39 | animationImportWarnings: 40 | animationRetargetingWarnings: 41 | animationDoRetargetingWarnings: 0 42 | importAnimatedCustomProperties: 0 43 | importConstraints: 0 44 | animationCompression: 1 45 | animationRotationError: 0.5 46 | animationPositionError: 0.5 47 | animationScaleError: 0.5 48 | animationWrapMode: 0 49 | extraExposedTransformPaths: [] 50 | extraUserProperties: [] 51 | clipAnimations: [] 52 | isReadable: 1 53 | meshes: 54 | lODScreenPercentages: [] 55 | globalScale: 1 56 | meshCompression: 0 57 | addColliders: 0 58 | useSRGBMaterialColor: 1 59 | sortHierarchyByName: 1 60 | importVisibility: 1 61 | importBlendShapes: 1 62 | importCameras: 1 63 | importLights: 1 64 | fileIdsGeneration: 1 65 | swapUVChannels: 0 66 | generateSecondaryUV: 0 67 | useFileUnits: 1 68 | keepQuads: 0 69 | weldVertices: 1 70 | preserveHierarchy: 0 71 | skinWeightsMode: 0 72 | maxBonesPerVertex: 4 73 | minBoneWeight: 0.001 74 | meshOptimizationFlags: -1 75 | indexFormat: 0 76 | secondaryUVAngleDistortion: 8 77 | secondaryUVAreaDistortion: 15.000001 78 | secondaryUVHardAngle: 88 79 | secondaryUVPackMargin: 4 80 | useFileScale: 1 81 | tangentSpace: 82 | normalSmoothAngle: 60 83 | normalImportMode: 0 84 | tangentImportMode: 3 85 | normalCalculationMode: 4 86 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 87 | blendShapeNormalImportMode: 1 88 | normalSmoothingSource: 0 89 | referencedClips: [] 90 | importAnimation: 1 91 | humanDescription: 92 | serializedVersion: 3 93 | human: [] 94 | skeleton: [] 95 | armTwist: 0.5 96 | foreArmTwist: 0.5 97 | upperLegTwist: 0.5 98 | legTwist: 0.5 99 | armStretch: 0.05 100 | legStretch: 0.05 101 | feetSpacing: 0 102 | globalScale: 1 103 | rootMotionBoneName: 104 | hasTranslationDoF: 0 105 | hasExtraRoot: 0 106 | skeletonHasParents: 1 107 | lastHumanDescriptionAvatarSource: {instanceID: 0} 108 | autoGenerateAvatarMappingIfUnspecified: 1 109 | animationType: 0 110 | humanoidOversampling: 1 111 | avatarSetup: 0 112 | additionalBone: 0 113 | userData: 114 | assetBundleName: 115 | assetBundleVariant: 116 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/SDF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96fd0798967714d91a948a3bfd57e5ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/SDF/Bunny_sdf.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba94c0a769e4146e48a1a972cbe0a568 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11700000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6a23a3559e06c3439d9e16630a7c009 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Scenes/VisualizationExample.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.44657874, g: 0.49641275, b: 0.5748172, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 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: 1 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: 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_UseShadowmask: 1 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 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &608548434 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 608548437} 133 | - component: {fileID: 608548436} 134 | - component: {fileID: 608548435} 135 | m_Layer: 0 136 | m_Name: Main Camera 137 | m_TagString: MainCamera 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!81 &608548435 143 | AudioListener: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 608548434} 149 | m_Enabled: 1 150 | --- !u!20 &608548436 151 | Camera: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 608548434} 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_ClearFlags: 1 160 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 161 | m_projectionMatrixMode: 1 162 | m_GateFitMode: 2 163 | m_FOVAxisMode: 0 164 | m_SensorSize: {x: 36, y: 24} 165 | m_LensShift: {x: 0, y: 0} 166 | m_FocalLength: 50 167 | m_NormalizedViewPortRect: 168 | serializedVersion: 2 169 | x: 0 170 | y: 0 171 | width: 1 172 | height: 1 173 | near clip plane: 0.3 174 | far clip plane: 1000 175 | field of view: 60 176 | orthographic: 0 177 | orthographic size: 5 178 | m_Depth: -1 179 | m_CullingMask: 180 | serializedVersion: 2 181 | m_Bits: 4294967295 182 | m_RenderingPath: -1 183 | m_TargetTexture: {fileID: 0} 184 | m_TargetDisplay: 0 185 | m_TargetEye: 3 186 | m_HDR: 1 187 | m_AllowMSAA: 1 188 | m_AllowDynamicResolution: 0 189 | m_ForceIntoRT: 0 190 | m_OcclusionCulling: 1 191 | m_StereoConvergence: 10 192 | m_StereoSeparation: 0.022 193 | --- !u!4 &608548437 194 | Transform: 195 | m_ObjectHideFlags: 0 196 | m_CorrespondingSourceObject: {fileID: 0} 197 | m_PrefabInstance: {fileID: 0} 198 | m_PrefabAsset: {fileID: 0} 199 | m_GameObject: {fileID: 608548434} 200 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 201 | m_LocalPosition: {x: 0, y: 1, z: -10} 202 | m_LocalScale: {x: 1, y: 1, z: 1} 203 | m_Children: [] 204 | m_Father: {fileID: 0} 205 | m_RootOrder: 0 206 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 207 | --- !u!1001 &714950722 208 | PrefabInstance: 209 | m_ObjectHideFlags: 0 210 | serializedVersion: 2 211 | m_Modification: 212 | m_TransformParent: {fileID: 0} 213 | m_Modifications: 214 | - target: {fileID: 100000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 215 | propertyPath: m_Name 216 | value: Bunny 217 | objectReference: {fileID: 0} 218 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 219 | propertyPath: m_RootOrder 220 | value: 2 221 | objectReference: {fileID: 0} 222 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 223 | propertyPath: m_LocalScale.x 224 | value: 10 225 | objectReference: {fileID: 0} 226 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 227 | propertyPath: m_LocalScale.y 228 | value: 10 229 | objectReference: {fileID: 0} 230 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 231 | propertyPath: m_LocalScale.z 232 | value: 10 233 | objectReference: {fileID: 0} 234 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 235 | propertyPath: m_LocalPosition.x 236 | value: -0 237 | objectReference: {fileID: 0} 238 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 239 | propertyPath: m_LocalPosition.y 240 | value: 0 241 | objectReference: {fileID: 0} 242 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 243 | propertyPath: m_LocalPosition.z 244 | value: 0 245 | objectReference: {fileID: 0} 246 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 247 | propertyPath: m_LocalRotation.w 248 | value: 1 249 | objectReference: {fileID: 0} 250 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 251 | propertyPath: m_LocalRotation.x 252 | value: 0.00000008146034 253 | objectReference: {fileID: 0} 254 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 255 | propertyPath: m_LocalRotation.y 256 | value: 0 257 | objectReference: {fileID: 0} 258 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 259 | propertyPath: m_LocalRotation.z 260 | value: -0 261 | objectReference: {fileID: 0} 262 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 263 | propertyPath: m_LocalEulerAnglesHint.x 264 | value: 0 265 | objectReference: {fileID: 0} 266 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 267 | propertyPath: m_LocalEulerAnglesHint.y 268 | value: 0 269 | objectReference: {fileID: 0} 270 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 271 | propertyPath: m_LocalEulerAnglesHint.z 272 | value: 0 273 | objectReference: {fileID: 0} 274 | - target: {fileID: 2300000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 275 | propertyPath: m_Materials.Array.data[0] 276 | value: 277 | objectReference: {fileID: 2100000, guid: b0abb726bb4174b8783659fa6b66c89f, type: 2} 278 | m_RemovedComponents: [] 279 | m_SourcePrefab: {fileID: 100100000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 280 | --- !u!1 &1977116451 281 | GameObject: 282 | m_ObjectHideFlags: 0 283 | m_CorrespondingSourceObject: {fileID: 0} 284 | m_PrefabInstance: {fileID: 0} 285 | m_PrefabAsset: {fileID: 0} 286 | serializedVersion: 6 287 | m_Component: 288 | - component: {fileID: 1977116453} 289 | - component: {fileID: 1977116452} 290 | m_Layer: 0 291 | m_Name: Directional Light 292 | m_TagString: Untagged 293 | m_Icon: {fileID: 0} 294 | m_NavMeshLayer: 0 295 | m_StaticEditorFlags: 0 296 | m_IsActive: 1 297 | --- !u!108 &1977116452 298 | Light: 299 | m_ObjectHideFlags: 0 300 | m_CorrespondingSourceObject: {fileID: 0} 301 | m_PrefabInstance: {fileID: 0} 302 | m_PrefabAsset: {fileID: 0} 303 | m_GameObject: {fileID: 1977116451} 304 | m_Enabled: 1 305 | serializedVersion: 10 306 | m_Type: 1 307 | m_Shape: 0 308 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 309 | m_Intensity: 1 310 | m_Range: 10 311 | m_SpotAngle: 30 312 | m_InnerSpotAngle: 21.802082 313 | m_CookieSize: 10 314 | m_Shadows: 315 | m_Type: 2 316 | m_Resolution: -1 317 | m_CustomResolution: -1 318 | m_Strength: 1 319 | m_Bias: 0.05 320 | m_NormalBias: 0.4 321 | m_NearPlane: 0.2 322 | m_CullingMatrixOverride: 323 | e00: 1 324 | e01: 0 325 | e02: 0 326 | e03: 0 327 | e10: 0 328 | e11: 1 329 | e12: 0 330 | e13: 0 331 | e20: 0 332 | e21: 0 333 | e22: 1 334 | e23: 0 335 | e30: 0 336 | e31: 0 337 | e32: 0 338 | e33: 1 339 | m_UseCullingMatrixOverride: 0 340 | m_Cookie: {fileID: 0} 341 | m_DrawHalo: 0 342 | m_Flare: {fileID: 0} 343 | m_RenderMode: 0 344 | m_CullingMask: 345 | serializedVersion: 2 346 | m_Bits: 4294967295 347 | m_RenderingLayerMask: 1 348 | m_Lightmapping: 4 349 | m_LightShadowCasterMode: 0 350 | m_AreaSize: {x: 1, y: 1} 351 | m_BounceIntensity: 1 352 | m_ColorTemperature: 6570 353 | m_UseColorTemperature: 0 354 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 355 | m_UseBoundingSphereOverride: 0 356 | m_ShadowRadius: 0 357 | m_ShadowAngle: 0 358 | --- !u!4 &1977116453 359 | Transform: 360 | m_ObjectHideFlags: 0 361 | m_CorrespondingSourceObject: {fileID: 0} 362 | m_PrefabInstance: {fileID: 0} 363 | m_PrefabAsset: {fileID: 0} 364 | m_GameObject: {fileID: 1977116451} 365 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 366 | m_LocalPosition: {x: 0, y: 3, z: 0} 367 | m_LocalScale: {x: 1, y: 1, z: 1} 368 | m_Children: [] 369 | m_Father: {fileID: 0} 370 | m_RootOrder: 1 371 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 372 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Scenes/VisualizationExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c861e2e99b11e439f8fa000197fbd6fa 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 467c65e8de0af4f12ba1bf233e0ce65c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Shaders/Visualizer.shader: -------------------------------------------------------------------------------- 1 | Shader "SDF/Visualize" { 2 | Properties { 3 | [Header(Optimization)] 4 | [Toggle(VERTEX_LIT)] 5 | _VertexLit("Vertex Lit", Int) = 0 6 | 7 | [Header(SDF)] 8 | [NoScaleOffset] 9 | _SDF ("SDF", 3D) = "white" {} 10 | _Density("Density", Float) = 1.0 11 | 12 | [Header(Mesh)] 13 | _MinExtents("Minimum", Vector) = (-1, -1, -1) 14 | _MaxExtents("Maximum", Vector) = (1, 1, 1) 15 | _Center("Center", Vector) = (0,0,0) 16 | } 17 | SubShader { 18 | Tags { "RenderType"="Transparent" "Queue"="Transparent" } 19 | LOD 100 20 | 21 | Blend SrcAlpha OneMinusSrcAlpha 22 | 23 | Cull Back 24 | 25 | Pass { 26 | CGPROGRAM 27 | 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | // make fog work 31 | #pragma multi_compile_fog 32 | 33 | #pragma target 4.0 34 | 35 | #pragma shader_feature VERTEX_LIT 36 | 37 | #include "UnityCG.cginc" 38 | 39 | #define STEPS 64 40 | 41 | struct appdata { 42 | float4 vertex : POSITION; 43 | float2 uv : TEXCOORD0; 44 | }; 45 | 46 | struct v2f { 47 | float4 vertex : SV_POSITION; 48 | float3 localPos : TEXCOORD0; 49 | float transmittance : TEXCOORD1; 50 | UNITY_FOG_COORDS(2) 51 | }; 52 | 53 | sampler3D _SDF; 54 | float _Density; 55 | float3 _MinExtents; 56 | float3 _MaxExtents; 57 | float3 _Center; 58 | 59 | float3 Remap(float3 v, float3 fromMin, float3 fromMax, float3 toMin, float3 toMax) { 60 | return (v-fromMin)/(fromMax-fromMin)*(toMax-toMin)+toMin; 61 | } 62 | 63 | float3 LocalPosToUVW(float3 localPos) { 64 | return Remap(localPos-_Center, _MinExtents, _MaxExtents, 0, 1); 65 | } 66 | 67 | v2f vert (appdata v) { 68 | v2f o; 69 | o.vertex = UnityObjectToClipPos(v.vertex); 70 | o.localPos = v.vertex; 71 | UNITY_TRANSFER_FOG(o,o.vertex); 72 | 73 | #ifdef VERTEX_LIT 74 | float3 localViewPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos.xyz, 1.0)).xyz; 75 | float3 localViewDir = normalize(o.localPos - localViewPos); 76 | 77 | // This is the longest any ray throughout the mesh could be 78 | float dist = length(_MaxExtents - _MinExtents) + 0.01; 79 | 80 | float dp = dist/(float)STEPS; 81 | 82 | float opticalDepth = 0.0; 83 | float transmittance = 0.0; 84 | 85 | float3 from = o.localPos - localViewDir*0.01; 86 | float3 to = from + localViewDir*dist; 87 | 88 | [unroll(STEPS)] 89 | for (uint j = 0; j < STEPS; j++) { 90 | float3 p = lerp(from, to, j/(float)(STEPS-1.0)); 91 | float3 texcoord = LocalPosToUVW(p); 92 | 93 | if (texcoord.x < 0.0 || texcoord.x > 1.0) { 94 | continue; 95 | } 96 | if (texcoord.y < 0.0 || texcoord.y > 1.0) { 97 | continue; 98 | } 99 | if (texcoord.z < 0.0 || texcoord.z > 1.0) { 100 | continue; 101 | } 102 | 103 | float4 samp = tex3Dlod(_SDF, float4(texcoord, 0)); 104 | float sdf = samp.a; 105 | float3 norm = normalize(samp.rgb); 106 | 107 | if (sdf < 0.0) { 108 | opticalDepth += _Density * dp; 109 | transmittance = 1.0 - exp(-opticalDepth); 110 | } 111 | 112 | if (transmittance >= 1.0) { 113 | break; 114 | } 115 | } 116 | 117 | transmittance = 1.0 - exp(-opticalDepth); 118 | 119 | o.transmittance = transmittance; 120 | #endif // VERTEX_LIT 121 | 122 | return o; 123 | } 124 | 125 | 126 | float4 frag (v2f i) : SV_Target { 127 | float transmittance = 0.0; 128 | 129 | #ifndef VERTEX_LIT 130 | float3 localViewPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos.xyz, 1.0)).xyz; 131 | float3 localViewDir = normalize(i.localPos - localViewPos); 132 | 133 | // This is the longest any ray throughout the mesh could be 134 | float dist = length(_MaxExtents - _MinExtents) + 0.01; 135 | 136 | float dp = dist/(float)STEPS; 137 | 138 | float opticalDepth = 0.0; 139 | 140 | float3 from = i.localPos - localViewDir*0.01; 141 | float3 to = from + localViewDir*dist; 142 | 143 | [unroll(STEPS)] 144 | for (uint j = 0; j < STEPS; j++) { 145 | float3 p = lerp(from, to, j/(float)(STEPS-1.0)); 146 | float3 texcoord = LocalPosToUVW(p); 147 | 148 | if (texcoord.x < 0.0 || texcoord.x > 1.0) { 149 | continue; 150 | } 151 | if (texcoord.y < 0.0 || texcoord.y > 1.0) { 152 | continue; 153 | } 154 | if (texcoord.z < 0.0 || texcoord.z > 1.0) { 155 | continue; 156 | } 157 | 158 | float4 samp = tex3D(_SDF, texcoord); 159 | float sdf = samp.a; 160 | float3 norm = normalize(samp.rgb); 161 | 162 | if (sdf < 0.0) { 163 | opticalDepth += _Density * dp; 164 | transmittance = 1.0 - exp(-opticalDepth); 165 | } 166 | 167 | if (transmittance >= 1.0) { 168 | break; 169 | } 170 | } 171 | 172 | transmittance = 1.0 - exp(-opticalDepth); 173 | #else 174 | transmittance = i.transmittance; 175 | #endif 176 | 177 | return float4(transmittance.xxx, 1); 178 | } 179 | 180 | ENDCG 181 | } // Pass 182 | } // SubShader 183 | } // Shader 184 | -------------------------------------------------------------------------------- /Assets/Samples/Signed Distance Field Generator/1.0.2/Visualization Example/Shaders/Visualizer.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51110bc88b3d8472cb16c4494c1dd520 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Daniel Shervheim 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 699c215febf6b453591f539e8244e8bf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor/DSS.SignedDistanceFieldGenerator.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DSS.SignedDistanceFieldGenerator.Editor", 3 | "references": [ 4 | "DSS.SignedDistanceFieldGenerator.Runtime" 5 | ], 6 | "includePlatforms": [], 7 | "excludePlatforms": [], 8 | "allowUnsafeCode": false, 9 | "overrideReferences": false, 10 | "precompiledReferences": [], 11 | "autoReferenced": true, 12 | "defineConstraints": [], 13 | "versionDefines": [], 14 | "noEngineReferences": false 15 | } -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor/DSS.SignedDistanceFieldGenerator.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 286cb7326a51d4ac7ba817b48ac66824 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 292b05add4e9e7043ba6e4b68c3d7c88 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor/Scripts/GeneratorWindow.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Daniel Shervheim 2 | 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace DSS.SDF { 7 | 8 | public class GeneratorWindow : EditorWindow { 9 | private Generator generator = new Generator(); 10 | 11 | [MenuItem("SDF/Generator")] 12 | private static void Window() { 13 | GeneratorWindow window = (GeneratorWindow)EditorWindow.GetWindow(typeof(GeneratorWindow), true, "Generate SDF"); 14 | window.ShowUtility(); 15 | } 16 | 17 | private void OnGUI() { 18 | // Verify that compute shaders are supported. 19 | if (!SystemInfo.supportsComputeShaders) { 20 | EditorGUILayout.HelpBox("This tool requires a GPU that supports compute shaders.", MessageType.Error); 21 | 22 | if (GUILayout.Button("Close")) { 23 | Close(); 24 | } 25 | return; 26 | } 27 | 28 | // Assign the mesh. 29 | generator.Mesh = EditorGUILayout.ObjectField("Mesh", generator.Mesh, typeof(Mesh), false) as Mesh; 30 | 31 | // If the mesh is null, don't draw the rest of the GUI. 32 | if (generator.Mesh == null) { 33 | if (GUILayout.Button("Close")) { 34 | Close(); 35 | } 36 | return; 37 | } 38 | 39 | // Assign the sub-mesh index, if there are more than 1 in the mesh. 40 | if (generator.Mesh.subMeshCount > 1) { 41 | generator.SubMeshIndex = (int)Mathf.Max(EditorGUILayout.IntField("Submesh Index", generator.SubMeshIndex), 0f); 42 | } 43 | 44 | // Assign the padding around the mesh. 45 | generator.Padding = EditorGUILayout.Slider("Padding", generator.Padding, 0f, 1f); 46 | 47 | // Assign the SDF resolution. 48 | generator.Resolution = (int)Mathf.Max(EditorGUILayout.IntField("Resolution", generator.Resolution), 1f); 49 | 50 | if (GUILayout.Button("Create")) { 51 | CreateSDF(); 52 | } 53 | 54 | if (GUILayout.Button("Close")) { 55 | Close(); 56 | } 57 | } 58 | 59 | private void OnInspectorUpdate() { 60 | Repaint(); 61 | } 62 | 63 | private void CreateSDF() { 64 | // Prompt the user to save the file. 65 | string path = EditorUtility.SaveFilePanelInProject("Save As", generator.Mesh.name + "_SDF", "asset", ""); 66 | 67 | // ... If they hit cancel. 68 | if (path == null || path.Equals("")) { 69 | return; 70 | } 71 | 72 | // Get the Texture3D representation of the SDF. 73 | Texture3D voxels = generator.Generate(); 74 | 75 | // Save the Texture3D asset at path. 76 | AssetDatabase.CreateAsset(voxels, path); 77 | AssetDatabase.SaveAssets(); 78 | AssetDatabase.Refresh(); 79 | 80 | // Close the window. 81 | Close(); 82 | 83 | // Select the SDF in the project view. 84 | Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(path); 85 | } 86 | } 87 | 88 | } // namespace DSS.SDF 89 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Editor/Scripts/GeneratorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae84bd12e67ae4080bb8d8e7b45553b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Daniel Shervheim 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b4aea2a25d9e4cda849a94ed07a5766 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa6665d5d83a646af8fb10f3a7bcd929 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/DSS.SignedDistanceFieldGenerator.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DSS.SignedDistanceFieldGenerator.Runtime" 3 | } 4 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/DSS.SignedDistanceFieldGenerator.Runtime.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef6c0d253f9044cc09141539712a3cf1 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b969b66248606934388987ac10e08909 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Resources/GenerateSDF.compute: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Daniel Shervheim 2 | 3 | #pragma kernel CSMain 4 | 5 | struct Triangle { 6 | float3 a, b, c; 7 | }; 8 | 9 | RWStructuredBuffer pixelBuffer; 10 | int pixelBufferSize; 11 | int textureSize; 12 | float3 minExtents, maxExtents; 13 | 14 | RWStructuredBuffer triangleBuffer; 15 | int triangleBufferSize; 16 | 17 | 18 | 19 | /* Returns the normal of the input triangle. */ 20 | float3 TriangleNormal(uint triangleId) { 21 | float3 ba = triangleBuffer[triangleId].b - triangleBuffer[triangleId].a; 22 | float3 cb = triangleBuffer[triangleId].c - triangleBuffer[triangleId].b; 23 | float3 ac = triangleBuffer[triangleId].a - triangleBuffer[triangleId].c; 24 | return normalize(cross(ba, ac)); 25 | } 26 | 27 | 28 | float3 Remap(float3 v, float3 fromMin, float3 fromMax, float3 toMin, float3 toMax) 29 | { 30 | return (v-fromMin)/(fromMax-fromMin)*(toMax-toMin)+toMin; 31 | } 32 | 33 | 34 | 35 | /* Returns the position (relative to the triangle buffer) of the voxel id. */ 36 | float3 PositionFromVoxelId(uint3 id) { 37 | float3 ones = float3(1,1,1); 38 | return Remap((float3)id + ones*0.5, 0, ones*textureSize, ones*minExtents, ones*maxExtents); 39 | /* 40 | // Center within voxels. 41 | float3 pos = (float3)id + float3(0.5, 0.5, 0.5); 42 | 43 | // Normalize into 0...1 range. 44 | pos /= (float)textureSize; 45 | 46 | // Remap to mesh extents. 47 | pos *= (maxExtents - minExtents); 48 | pos += minExtents; 49 | 50 | return pos; 51 | */ 52 | } 53 | /* 54 | float3 PositionFromVoxelId(uint3 id) { 55 | float3 pos = (float3)id; // 0:textureSize-1 56 | pos = pos / ((float)textureSize - 1.0); // 0:1 57 | pos = pos * (totalUnitsInTexture); // 0:meshSize 58 | pos = pos - (totalUnitsInTexture / 2.0); // -meshExtent:+meshExtent 59 | return pos; 60 | } 61 | */ 62 | 63 | 64 | 65 | float dot2(float3 v) { 66 | return dot(v, v); 67 | } 68 | 69 | 70 | 71 | /* Returns the unsigned distance between the input position and triangle. 72 | Developed by Inigo Quilez. */ 73 | float DistanceToTriangle(float3 position, uint triangleId) { 74 | float3 ba = triangleBuffer[triangleId].b - triangleBuffer[triangleId].a; 75 | float3 cb = triangleBuffer[triangleId].c - triangleBuffer[triangleId].b; 76 | float3 ac = triangleBuffer[triangleId].a - triangleBuffer[triangleId].c; 77 | float3 pa = position - triangleBuffer[triangleId].a; 78 | float3 pb = position - triangleBuffer[triangleId].b; 79 | float3 pc = position - triangleBuffer[triangleId].c; 80 | 81 | float3 nor = TriangleNormal(triangleId); 82 | 83 | if (sign(dot(cross(ba, nor), pa)) + sign(dot(cross(cb, nor), pb)) + sign(dot(cross(ac, nor), pc)) < 2.0) { 84 | float x = dot2(ba * clamp(dot(ba, pa) / dot2(ba), 0.0, 1.0) - pa); 85 | float y = dot2(cb * clamp(dot(cb, pb) / dot2(cb), 0.0, 1.0) - pb); 86 | float z = dot2(ac * clamp(dot(ac, pc) / dot2(ac), 0.0, 1.0) - pc); 87 | return sqrt(min(min(x, y), z)); 88 | } 89 | else { 90 | return sqrt(dot(nor, pa)*dot(nor, pa) / dot2(nor)); 91 | } 92 | } 93 | 94 | 95 | 96 | /* Returns the index of the nearest triangle to the input position. */ 97 | uint NearestTriangleId(float3 position) { 98 | uint id = 0; 99 | for (uint t = 0; t < (uint)triangleBufferSize; t++) { 100 | if (DistanceToTriangle(position, t) < DistanceToTriangle(position, id)) { 101 | id = t; 102 | } 103 | } 104 | return id; 105 | } 106 | 107 | 108 | 109 | /* Returns the average position (center of mass) of the input triangle. */ 110 | float3 TrianglePosition(uint triangleId) { 111 | return (triangleBuffer[triangleId].a + 112 | triangleBuffer[triangleId].b + 113 | triangleBuffer[triangleId].c) / 3.0; 114 | } 115 | 116 | 117 | 118 | /* Returns whether a ray intersects a triangle. Developed by Möller–Trumbore. */ 119 | uint RayIntersectsTriangle(float3 o, float3 d, uint triangleId) { 120 | const float EPSILON = 0.0000001; 121 | 122 | float3 v0 = triangleBuffer[triangleId].a; 123 | float3 v1 = triangleBuffer[triangleId].b; 124 | float3 v2 = triangleBuffer[triangleId].c; 125 | 126 | float3 e1, e2, h, s, q; 127 | float a, f, u, v, t; 128 | 129 | e1 = v1 - v0; 130 | e2 = v2 - v0; 131 | 132 | h = cross(d, e2); 133 | a = dot(e1, h); 134 | 135 | if (abs(a) < EPSILON) { 136 | return 0; // ray is parallel to triangle 137 | } 138 | 139 | f = 1.0 / a; 140 | s = o - v0; 141 | u = f * dot(s, h); 142 | 143 | if (u < 0.0 || u > 1.0) { 144 | return 0; 145 | } 146 | 147 | q = cross(s, e1); 148 | v = f * dot(d, q); 149 | 150 | if (v < 0.0 || u + v > 1.0) { 151 | return 0; 152 | } 153 | 154 | t = f * dot(e2, q); 155 | 156 | return (t >= 0.0) ? 1 : 0; 157 | } 158 | 159 | 160 | 161 | uint IntersectionCount(float3 position, float3 direction) { 162 | uint count = 0; 163 | 164 | for (uint t = 0; t < (uint)triangleBufferSize; t++) { 165 | count += RayIntersectsTriangle(position, direction, t); 166 | } 167 | 168 | return count; 169 | } 170 | 171 | 172 | 173 | uint3 To3D(uint id) { 174 | uint xQ = id / textureSize; 175 | uint x = id % textureSize; 176 | uint yQ = xQ / textureSize; 177 | uint y = xQ % textureSize; 178 | uint z = yQ % textureSize; 179 | return uint3(x, y, z); 180 | } 181 | 182 | 183 | 184 | [numthreads(256, 1, 1)] 185 | void CSMain(uint3 id : SV_DispatchThreadID) { 186 | 187 | float3 pos = PositionFromVoxelId(To3D(id.x)); 188 | 189 | uint nearestTriangle = NearestTriangleId(pos); 190 | 191 | float distance = DistanceToTriangle(pos, nearestTriangle); 192 | 193 | float s = (IntersectionCount(pos, float3(0, 1, 0)) % 2 == 0) ? 1 : -1; 194 | 195 | pixelBuffer[id.x] = float4(TriangleNormal(nearestTriangle), s*distance); 196 | } 197 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Resources/GenerateSDF.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ad1ef9fefa4f4077806b312771d14c8 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 65536 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cd34b18029b84cc2822759b49d6e347 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Scripts/Generator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Daniel Shervheim 2 | 3 | using UnityEngine; 4 | 5 | namespace DSS.SDF { 6 | 7 | /// @brief A tool to generate signed distance fields from Mesh assets. 8 | /// TODO: determine if we lose precision or negative values by using Color struct. 9 | /// Perhaps we should return float[,,] instead? 10 | public class Generator : UnityEngine.Object { 11 | private Mesh mesh = null; 12 | public Mesh Mesh { 13 | get { 14 | return mesh; 15 | } 16 | set { 17 | mesh = value; 18 | } 19 | } 20 | 21 | private int subMeshIndex = 0; 22 | public int SubMeshIndex { 23 | get { 24 | return subMeshIndex; 25 | } 26 | set { 27 | if (value < 0) { 28 | throw new System.IndexOutOfRangeException("SubMeshIndex must be >= 0"); 29 | } 30 | subMeshIndex = value; 31 | } 32 | } 33 | 34 | private float padding = 0f; 35 | public float Padding { 36 | get { 37 | return padding; 38 | } 39 | set { 40 | if (value < 0f) { 41 | throw new System.ArgumentException("Padding must be >= 0"); 42 | } 43 | padding = value; 44 | } 45 | } 46 | 47 | private int resolution = 32; 48 | public int Resolution { 49 | get { 50 | return resolution; 51 | } 52 | set { 53 | if (value < 1) { 54 | throw new System.ArgumentException("Resolution must be >= 1"); 55 | } 56 | resolution = value; 57 | } 58 | } 59 | 60 | private struct Triangle { 61 | public Vector3 a, b, c; 62 | } 63 | 64 | public Texture3D Generate() { 65 | if (mesh == null) { 66 | throw new System.ArgumentException("Mesh must have been assigned"); 67 | } 68 | 69 | // Create the voxel texture. 70 | Texture3D voxels = new Texture3D(resolution, resolution, resolution, TextureFormat.RGBAHalf, false); 71 | voxels.anisoLevel = 1; 72 | voxels.filterMode = FilterMode.Bilinear; 73 | voxels.wrapMode = TextureWrapMode.Clamp; 74 | 75 | // Get an array of pixels from the voxel texture, create a buffer to 76 | // hold them, and upload the pixels to the buffer. 77 | Color[] pixelArray = voxels.GetPixels(0); 78 | ComputeBuffer pixelBuffer = new ComputeBuffer(pixelArray.Length, sizeof(float) * 4); 79 | pixelBuffer.SetData(pixelArray); 80 | 81 | // Get an array of triangles from the mesh. 82 | Vector3[] meshVertices = mesh.vertices; 83 | int[] meshTriangles = mesh.GetTriangles(subMeshIndex); 84 | Triangle[] triangleArray = new Triangle[meshTriangles.Length / 3]; 85 | for (int t = 0; t < triangleArray.Length; t++) { 86 | triangleArray[t].a = meshVertices[meshTriangles[3 * t + 0]]; // - mesh.bounds.center; 87 | triangleArray[t].b = meshVertices[meshTriangles[3 * t + 1]]; // - mesh.bounds.center; 88 | triangleArray[t].c = meshVertices[meshTriangles[3 * t + 2]]; // - mesh.bounds.center; 89 | } 90 | 91 | // Create a buffer to hold the triangles, and upload them to the buffer. 92 | ComputeBuffer triangleBuffer = new ComputeBuffer(triangleArray.Length, sizeof(float) * 3 * 3); 93 | triangleBuffer.SetData(triangleArray); 94 | 95 | // Instantiate the compute shader from resources. 96 | ComputeShader compute = Instantiate(Resources.Load("GenerateSDF")) as ComputeShader; 97 | int kernel = compute.FindKernel("CSMain"); 98 | 99 | // Upload the pixel buffer to the GPU. 100 | compute.SetBuffer(kernel, "pixelBuffer", pixelBuffer); 101 | compute.SetInt("pixelBufferSize", pixelArray.Length); 102 | 103 | // Upload the triangle buffer to the GPU. 104 | compute.SetBuffer(kernel, "triangleBuffer", triangleBuffer); 105 | compute.SetInt("triangleBufferSize", triangleArray.Length); 106 | 107 | // Calculate and upload the other necessary parameters. 108 | compute.SetInt("textureSize", resolution); 109 | Vector3 minExtents = Vector3.zero; 110 | Vector3 maxExtents = Vector3.zero; 111 | foreach (Vector3 v in mesh.vertices) { 112 | for (int i = 0; i < 3; i++) { 113 | minExtents[i] = Mathf.Min(minExtents[i], v[i]); 114 | maxExtents[i] = Mathf.Max(maxExtents[i], v[i]); 115 | } 116 | } 117 | compute.SetVector("minExtents", minExtents - Vector3.one*padding); 118 | compute.SetVector("maxExtents", maxExtents + Vector3.one*padding); 119 | 120 | // Compute the SDF. 121 | compute.Dispatch(kernel, pixelArray.Length / 256 + 1, 1, 1); 122 | 123 | // Destroy the compute shader and release the triangle buffer. 124 | DestroyImmediate(compute); 125 | triangleBuffer.Release(); 126 | 127 | // Retrieve the pixel buffer and reapply it to the voxels texture. 128 | pixelBuffer.GetData(pixelArray); 129 | pixelBuffer.Release(); 130 | voxels.SetPixels(pixelArray, 0); 131 | voxels.Apply(); 132 | 133 | // Return the voxel texture. 134 | return voxels; 135 | } 136 | } 137 | 138 | } // namespace DSS.SDF -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Runtime/Scripts/Generator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e39df52f59a84d478cb9ebac4410ad0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4df67ca90ccb425f9548fd4c528f60a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Material/Visualizer.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: Visualizer 11 | m_Shader: {fileID: 4800000, guid: 51110bc88b3d8472cb16c4494c1dd520, type: 3} 12 | m_ShaderKeywords: VERTEX_LIT 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _SDF: 23 | m_Texture: {fileID: 11700000, guid: ba94c0a769e4146e48a1a972cbe0a568, type: 2} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Volume: 27 | m_Texture: {fileID: 11700000, guid: 0906b400b6edd454a9cd76b419b38a9b, type: 2} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | m_Floats: 31 | - _Density: 10 32 | - _MaxSteps: 500 33 | - _Shade: 0 34 | - _StepCount: 64 35 | - _VertexLit: 1 36 | m_Colors: 37 | - _Center: {r: 0, g: 0, b: 0, a: 1} 38 | - _MaxExtents: {r: 0.084784, g: 0.16336519, b: 0.065672, a: 1} 39 | - _MinExtents: {r: -0.084996, g: -0.004582, b: -0.066039, a: 1} 40 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Material/Visualizer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0abb726bb4174b8783659fa6b66c89f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Meshes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a78a29427472b4c0eb9e16b90432283b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Meshes/Bunny.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielshervheim/unity-sdf-generator/c13507ecb0df533240e2665f45e8d20c29ce5f30/Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Meshes/Bunny.fbx -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Meshes/Bunny.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8efbe262a87d3496e8bda924a4fe55b8 3 | ModelImporter: 4 | serializedVersion: 19301 5 | internalIDToNameTable: 6 | - first: 7 | 1: 100000 8 | second: //RootNode 9 | - first: 10 | 4: 400000 11 | second: //RootNode 12 | - first: 13 | 21: 2100000 14 | second: Default Material1 15 | - first: 16 | 23: 2300000 17 | second: //RootNode 18 | - first: 19 | 33: 3300000 20 | second: //RootNode 21 | - first: 22 | 43: 4300000 23 | second: default-retopo 3 24 | externalObjects: {} 25 | materials: 26 | materialImportMode: 1 27 | materialName: 0 28 | materialSearch: 1 29 | materialLocation: 1 30 | animations: 31 | legacyGenerateAnimations: 4 32 | bakeSimulation: 0 33 | resampleCurves: 1 34 | optimizeGameObjects: 0 35 | motionNodeName: 36 | rigImportErrors: 37 | rigImportWarnings: 38 | animationImportErrors: 39 | animationImportWarnings: 40 | animationRetargetingWarnings: 41 | animationDoRetargetingWarnings: 0 42 | importAnimatedCustomProperties: 0 43 | importConstraints: 0 44 | animationCompression: 1 45 | animationRotationError: 0.5 46 | animationPositionError: 0.5 47 | animationScaleError: 0.5 48 | animationWrapMode: 0 49 | extraExposedTransformPaths: [] 50 | extraUserProperties: [] 51 | clipAnimations: [] 52 | isReadable: 1 53 | meshes: 54 | lODScreenPercentages: [] 55 | globalScale: 1 56 | meshCompression: 0 57 | addColliders: 0 58 | useSRGBMaterialColor: 1 59 | sortHierarchyByName: 1 60 | importVisibility: 1 61 | importBlendShapes: 1 62 | importCameras: 1 63 | importLights: 1 64 | fileIdsGeneration: 1 65 | swapUVChannels: 0 66 | generateSecondaryUV: 0 67 | useFileUnits: 1 68 | keepQuads: 0 69 | weldVertices: 1 70 | preserveHierarchy: 0 71 | skinWeightsMode: 0 72 | maxBonesPerVertex: 4 73 | minBoneWeight: 0.001 74 | meshOptimizationFlags: -1 75 | indexFormat: 0 76 | secondaryUVAngleDistortion: 8 77 | secondaryUVAreaDistortion: 15.000001 78 | secondaryUVHardAngle: 88 79 | secondaryUVPackMargin: 4 80 | useFileScale: 1 81 | tangentSpace: 82 | normalSmoothAngle: 60 83 | normalImportMode: 0 84 | tangentImportMode: 3 85 | normalCalculationMode: 4 86 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 87 | blendShapeNormalImportMode: 1 88 | normalSmoothingSource: 0 89 | referencedClips: [] 90 | importAnimation: 1 91 | humanDescription: 92 | serializedVersion: 3 93 | human: [] 94 | skeleton: [] 95 | armTwist: 0.5 96 | foreArmTwist: 0.5 97 | upperLegTwist: 0.5 98 | legTwist: 0.5 99 | armStretch: 0.05 100 | legStretch: 0.05 101 | feetSpacing: 0 102 | globalScale: 1 103 | rootMotionBoneName: 104 | hasTranslationDoF: 0 105 | hasExtraRoot: 0 106 | skeletonHasParents: 1 107 | lastHumanDescriptionAvatarSource: {instanceID: 0} 108 | autoGenerateAvatarMappingIfUnspecified: 1 109 | animationType: 0 110 | humanoidOversampling: 1 111 | avatarSetup: 0 112 | additionalBone: 0 113 | userData: 114 | assetBundleName: 115 | assetBundleVariant: 116 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/SDF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96fd0798967714d91a948a3bfd57e5ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/SDF/Bunny_sdf.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba94c0a769e4146e48a1a972cbe0a568 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11700000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6a23a3559e06c3439d9e16630a7c009 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Scenes/Demo Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0435705031d51c34cbd07b4457b4ea4d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Scenes/VisualizationExample.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.44657874, g: 0.49641275, b: 0.5748172, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 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: 1 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: 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_UseShadowmask: 1 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 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &608548434 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 608548437} 133 | - component: {fileID: 608548436} 134 | - component: {fileID: 608548435} 135 | m_Layer: 0 136 | m_Name: Main Camera 137 | m_TagString: MainCamera 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!81 &608548435 143 | AudioListener: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 608548434} 149 | m_Enabled: 1 150 | --- !u!20 &608548436 151 | Camera: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 608548434} 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_ClearFlags: 1 160 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 161 | m_projectionMatrixMode: 1 162 | m_GateFitMode: 2 163 | m_FOVAxisMode: 0 164 | m_SensorSize: {x: 36, y: 24} 165 | m_LensShift: {x: 0, y: 0} 166 | m_FocalLength: 50 167 | m_NormalizedViewPortRect: 168 | serializedVersion: 2 169 | x: 0 170 | y: 0 171 | width: 1 172 | height: 1 173 | near clip plane: 0.3 174 | far clip plane: 1000 175 | field of view: 60 176 | orthographic: 0 177 | orthographic size: 5 178 | m_Depth: -1 179 | m_CullingMask: 180 | serializedVersion: 2 181 | m_Bits: 4294967295 182 | m_RenderingPath: -1 183 | m_TargetTexture: {fileID: 0} 184 | m_TargetDisplay: 0 185 | m_TargetEye: 3 186 | m_HDR: 1 187 | m_AllowMSAA: 1 188 | m_AllowDynamicResolution: 0 189 | m_ForceIntoRT: 0 190 | m_OcclusionCulling: 1 191 | m_StereoConvergence: 10 192 | m_StereoSeparation: 0.022 193 | --- !u!4 &608548437 194 | Transform: 195 | m_ObjectHideFlags: 0 196 | m_CorrespondingSourceObject: {fileID: 0} 197 | m_PrefabInstance: {fileID: 0} 198 | m_PrefabAsset: {fileID: 0} 199 | m_GameObject: {fileID: 608548434} 200 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 201 | m_LocalPosition: {x: 0, y: 1, z: -10} 202 | m_LocalScale: {x: 1, y: 1, z: 1} 203 | m_Children: [] 204 | m_Father: {fileID: 0} 205 | m_RootOrder: 0 206 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 207 | --- !u!1001 &714950722 208 | PrefabInstance: 209 | m_ObjectHideFlags: 0 210 | serializedVersion: 2 211 | m_Modification: 212 | m_TransformParent: {fileID: 0} 213 | m_Modifications: 214 | - target: {fileID: 100000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 215 | propertyPath: m_Name 216 | value: Bunny 217 | objectReference: {fileID: 0} 218 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 219 | propertyPath: m_RootOrder 220 | value: 2 221 | objectReference: {fileID: 0} 222 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 223 | propertyPath: m_LocalScale.x 224 | value: 10 225 | objectReference: {fileID: 0} 226 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 227 | propertyPath: m_LocalScale.y 228 | value: 10 229 | objectReference: {fileID: 0} 230 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 231 | propertyPath: m_LocalScale.z 232 | value: 10 233 | objectReference: {fileID: 0} 234 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 235 | propertyPath: m_LocalPosition.x 236 | value: -0 237 | objectReference: {fileID: 0} 238 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 239 | propertyPath: m_LocalPosition.y 240 | value: 0 241 | objectReference: {fileID: 0} 242 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 243 | propertyPath: m_LocalPosition.z 244 | value: 0 245 | objectReference: {fileID: 0} 246 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 247 | propertyPath: m_LocalRotation.w 248 | value: 1 249 | objectReference: {fileID: 0} 250 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 251 | propertyPath: m_LocalRotation.x 252 | value: 0.00000008146034 253 | objectReference: {fileID: 0} 254 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 255 | propertyPath: m_LocalRotation.y 256 | value: 0 257 | objectReference: {fileID: 0} 258 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 259 | propertyPath: m_LocalRotation.z 260 | value: -0 261 | objectReference: {fileID: 0} 262 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 263 | propertyPath: m_LocalEulerAnglesHint.x 264 | value: 0 265 | objectReference: {fileID: 0} 266 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 267 | propertyPath: m_LocalEulerAnglesHint.y 268 | value: 0 269 | objectReference: {fileID: 0} 270 | - target: {fileID: 400000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 271 | propertyPath: m_LocalEulerAnglesHint.z 272 | value: 0 273 | objectReference: {fileID: 0} 274 | - target: {fileID: 2300000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 275 | propertyPath: m_Materials.Array.data[0] 276 | value: 277 | objectReference: {fileID: 2100000, guid: b0abb726bb4174b8783659fa6b66c89f, type: 2} 278 | m_RemovedComponents: [] 279 | m_SourcePrefab: {fileID: 100100000, guid: 8efbe262a87d3496e8bda924a4fe55b8, type: 3} 280 | --- !u!1 &1977116451 281 | GameObject: 282 | m_ObjectHideFlags: 0 283 | m_CorrespondingSourceObject: {fileID: 0} 284 | m_PrefabInstance: {fileID: 0} 285 | m_PrefabAsset: {fileID: 0} 286 | serializedVersion: 6 287 | m_Component: 288 | - component: {fileID: 1977116453} 289 | - component: {fileID: 1977116452} 290 | m_Layer: 0 291 | m_Name: Directional Light 292 | m_TagString: Untagged 293 | m_Icon: {fileID: 0} 294 | m_NavMeshLayer: 0 295 | m_StaticEditorFlags: 0 296 | m_IsActive: 1 297 | --- !u!108 &1977116452 298 | Light: 299 | m_ObjectHideFlags: 0 300 | m_CorrespondingSourceObject: {fileID: 0} 301 | m_PrefabInstance: {fileID: 0} 302 | m_PrefabAsset: {fileID: 0} 303 | m_GameObject: {fileID: 1977116451} 304 | m_Enabled: 1 305 | serializedVersion: 10 306 | m_Type: 1 307 | m_Shape: 0 308 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 309 | m_Intensity: 1 310 | m_Range: 10 311 | m_SpotAngle: 30 312 | m_InnerSpotAngle: 21.802082 313 | m_CookieSize: 10 314 | m_Shadows: 315 | m_Type: 2 316 | m_Resolution: -1 317 | m_CustomResolution: -1 318 | m_Strength: 1 319 | m_Bias: 0.05 320 | m_NormalBias: 0.4 321 | m_NearPlane: 0.2 322 | m_CullingMatrixOverride: 323 | e00: 1 324 | e01: 0 325 | e02: 0 326 | e03: 0 327 | e10: 0 328 | e11: 1 329 | e12: 0 330 | e13: 0 331 | e20: 0 332 | e21: 0 333 | e22: 1 334 | e23: 0 335 | e30: 0 336 | e31: 0 337 | e32: 0 338 | e33: 1 339 | m_UseCullingMatrixOverride: 0 340 | m_Cookie: {fileID: 0} 341 | m_DrawHalo: 0 342 | m_Flare: {fileID: 0} 343 | m_RenderMode: 0 344 | m_CullingMask: 345 | serializedVersion: 2 346 | m_Bits: 4294967295 347 | m_RenderingLayerMask: 1 348 | m_Lightmapping: 4 349 | m_LightShadowCasterMode: 0 350 | m_AreaSize: {x: 1, y: 1} 351 | m_BounceIntensity: 1 352 | m_ColorTemperature: 6570 353 | m_UseColorTemperature: 0 354 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 355 | m_UseBoundingSphereOverride: 0 356 | m_ShadowRadius: 0 357 | m_ShadowAngle: 0 358 | --- !u!4 &1977116453 359 | Transform: 360 | m_ObjectHideFlags: 0 361 | m_CorrespondingSourceObject: {fileID: 0} 362 | m_PrefabInstance: {fileID: 0} 363 | m_PrefabAsset: {fileID: 0} 364 | m_GameObject: {fileID: 1977116451} 365 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 366 | m_LocalPosition: {x: 0, y: 3, z: 0} 367 | m_LocalScale: {x: 1, y: 1, z: 1} 368 | m_Children: [] 369 | m_Father: {fileID: 0} 370 | m_RootOrder: 1 371 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 372 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Shaders/Visualizer.shader: -------------------------------------------------------------------------------- 1 | Shader "SDF/Visualize" { 2 | Properties { 3 | [Header(Optimization)] 4 | [Toggle(VERTEX_LIT)] 5 | _VertexLit("Vertex Lit", Int) = 0 6 | 7 | [Header(SDF)] 8 | [NoScaleOffset] 9 | _SDF ("SDF", 3D) = "white" {} 10 | _Density("Density", Float) = 1.0 11 | 12 | [Header(Mesh)] 13 | _MinExtents("Minimum", Vector) = (-1, -1, -1) 14 | _MaxExtents("Maximum", Vector) = (1, 1, 1) 15 | _Center("Center", Vector) = (0,0,0) 16 | } 17 | SubShader { 18 | Tags { "RenderType"="Transparent" "Queue"="Transparent" } 19 | LOD 100 20 | 21 | Blend SrcAlpha OneMinusSrcAlpha 22 | 23 | Cull Back 24 | 25 | Pass { 26 | CGPROGRAM 27 | 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | // make fog work 31 | #pragma multi_compile_fog 32 | 33 | #pragma target 4.0 34 | 35 | #pragma shader_feature VERTEX_LIT 36 | 37 | #include "UnityCG.cginc" 38 | 39 | #define STEPS 64 40 | 41 | struct appdata { 42 | float4 vertex : POSITION; 43 | float2 uv : TEXCOORD0; 44 | }; 45 | 46 | struct v2f { 47 | float4 vertex : SV_POSITION; 48 | float3 localPos : TEXCOORD0; 49 | float transmittance : TEXCOORD1; 50 | UNITY_FOG_COORDS(2) 51 | }; 52 | 53 | sampler3D _SDF; 54 | float _Density; 55 | float3 _MinExtents; 56 | float3 _MaxExtents; 57 | float3 _Center; 58 | 59 | float3 Remap(float3 v, float3 fromMin, float3 fromMax, float3 toMin, float3 toMax) { 60 | return (v-fromMin)/(fromMax-fromMin)*(toMax-toMin)+toMin; 61 | } 62 | 63 | float3 LocalPosToUVW(float3 localPos) { 64 | return Remap(localPos-_Center, _MinExtents, _MaxExtents, 0, 1); 65 | } 66 | 67 | v2f vert (appdata v) { 68 | v2f o; 69 | o.vertex = UnityObjectToClipPos(v.vertex); 70 | o.localPos = v.vertex; 71 | UNITY_TRANSFER_FOG(o,o.vertex); 72 | 73 | #ifdef VERTEX_LIT 74 | float3 localViewPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos.xyz, 1.0)).xyz; 75 | float3 localViewDir = normalize(o.localPos - localViewPos); 76 | 77 | // This is the longest any ray throughout the mesh could be 78 | float dist = length(_MaxExtents - _MinExtents) + 0.01; 79 | 80 | float dp = dist/(float)STEPS; 81 | 82 | float opticalDepth = 0.0; 83 | float transmittance = 0.0; 84 | 85 | float3 from = o.localPos - localViewDir*0.01; 86 | float3 to = from + localViewDir*dist; 87 | 88 | [unroll(STEPS)] 89 | for (uint j = 0; j < STEPS; j++) { 90 | float3 p = lerp(from, to, j/(float)(STEPS-1.0)); 91 | float3 texcoord = LocalPosToUVW(p); 92 | 93 | if (texcoord.x < 0.0 || texcoord.x > 1.0) { 94 | continue; 95 | } 96 | if (texcoord.y < 0.0 || texcoord.y > 1.0) { 97 | continue; 98 | } 99 | if (texcoord.z < 0.0 || texcoord.z > 1.0) { 100 | continue; 101 | } 102 | 103 | float4 samp = tex3Dlod(_SDF, float4(texcoord, 0)); 104 | float sdf = samp.a; 105 | float3 norm = normalize(samp.rgb); 106 | 107 | if (sdf < 0.0) { 108 | opticalDepth += _Density * dp; 109 | transmittance = 1.0 - exp(-opticalDepth); 110 | } 111 | 112 | if (transmittance >= 1.0) { 113 | break; 114 | } 115 | } 116 | 117 | transmittance = 1.0 - exp(-opticalDepth); 118 | 119 | o.transmittance = transmittance; 120 | #endif // VERTEX_LIT 121 | 122 | return o; 123 | } 124 | 125 | 126 | float4 frag (v2f i) : SV_Target { 127 | float transmittance = 0.0; 128 | 129 | #ifndef VERTEX_LIT 130 | float3 localViewPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos.xyz, 1.0)).xyz; 131 | float3 localViewDir = normalize(i.localPos - localViewPos); 132 | 133 | // This is the longest any ray throughout the mesh could be 134 | float dist = length(_MaxExtents - _MinExtents) + 0.01; 135 | 136 | float dp = dist/(float)STEPS; 137 | 138 | float opticalDepth = 0.0; 139 | 140 | float3 from = i.localPos - localViewDir*0.01; 141 | float3 to = from + localViewDir*dist; 142 | 143 | [unroll(STEPS)] 144 | for (uint j = 0; j < STEPS; j++) { 145 | float3 p = lerp(from, to, j/(float)(STEPS-1.0)); 146 | float3 texcoord = LocalPosToUVW(p); 147 | 148 | if (texcoord.x < 0.0 || texcoord.x > 1.0) { 149 | continue; 150 | } 151 | if (texcoord.y < 0.0 || texcoord.y > 1.0) { 152 | continue; 153 | } 154 | if (texcoord.z < 0.0 || texcoord.z > 1.0) { 155 | continue; 156 | } 157 | 158 | float4 samp = tex3D(_SDF, texcoord); 159 | float sdf = samp.a; 160 | float3 norm = normalize(samp.rgb); 161 | 162 | if (sdf < 0.0) { 163 | opticalDepth += _Density * dp; 164 | transmittance = 1.0 - exp(-opticalDepth); 165 | } 166 | 167 | if (transmittance >= 1.0) { 168 | break; 169 | } 170 | } 171 | 172 | transmittance = 1.0 - exp(-opticalDepth); 173 | #else 174 | transmittance = i.transmittance; 175 | #endif 176 | 177 | return float4(transmittance.xxx, 1); 178 | } 179 | 180 | ENDCG 181 | } // Pass 182 | } // SubShader 183 | } // Shader 184 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/Samples~/VisualizationExample/Shaders/Visualizer.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51110bc88b3d8472cb16c4494c1dd520 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/changelog.md: -------------------------------------------------------------------------------- 1 | # SDF Generator 2 | 3 | ## 1.0.0 4 | 5 | - Initial release. 6 | 7 | ## 1.0.1 8 | 9 | - Converted to Unity package format. 10 | 11 | ## 1.0.2 12 | 13 | - Added sample scene. -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/changelog.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3e99ee9ecf00436eaa997306573423a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name" : "Daniel Shervheim", 4 | "email" : "danielshervheim@gmail.com", 5 | "url" : "https://www.danielshervheim.com/" 6 | }, 7 | "description": "A tool to generate volumetric signed distance fields from Mesh objects.", 8 | "displayName": "Signed Distance Field Generator", 9 | "keywords": [ 10 | "unity", 11 | "utilities", 12 | "extensions", 13 | "sdf", 14 | "signed distance field", 15 | "volumetric" 16 | ], 17 | "license": "BSD-3-Clause", 18 | "name": "com.dss.sdf-generator", 19 | "repository": "github:danielshervheim/Signed-Distance-Field-Generator", 20 | "unity": "2019.1", 21 | "version": "1.0.2", 22 | "hideInEditor": false, 23 | "samples": [ 24 | { 25 | "displayName": "Visualization Example", 26 | "description": "A small demo scene and shader for visualizing the generated SDF textures.", 27 | "path": "Samples~/VisualizationExample" 28 | 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cf878337d3d24893b28f9bf65f332ae 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/readme.md: -------------------------------------------------------------------------------- 1 | # sdf-generator 2 | 3 | A Unity tool to generate signed distance field volumes (as `Texture3D` assets) from meshes. 4 | 5 | ![demo](../../img/nHyQgX9.gif) 6 | 7 | ## How To Install 8 | 9 | The sdf-generator package uses the [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) feature to import 10 | dependent packages. Please add the following sections to the package manifest 11 | file (`Packages/manifest.json`). 12 | 13 | To the `scopedRegistries` section: 14 | 15 | ``` 16 | { 17 | "name": "DSS", 18 | "url": "https://registry.npmjs.com", 19 | "scopes": [ "com.dss" ] 20 | } 21 | ``` 22 | 23 | To the `dependencies` section: 24 | 25 | ``` 26 | "com.dss.sdf-generator": "1.0.2" 27 | ``` 28 | 29 | After changes, the manifest file should look like below: 30 | 31 | ``` 32 | { 33 | "scopedRegistries": [ 34 | { 35 | "name": "DSS", 36 | "url": "https://registry.npmjs.com", 37 | "scopes": [ "com.dss" ] 38 | } 39 | ], 40 | "dependencies": { 41 | "com.dss.sdf-generator": "1.0.2", 42 | ... 43 | ``` 44 | 45 | ## To Use 46 | 47 | **In Editor** 48 | 49 | 1. Select `SDF > Generator` from the Unity menu bar, the tool window will pop up. 50 | 2. Set the relevant options (described in the next section). 51 | 3. Press `Create` and a save dialog will pop up. 52 | 3. Choose a location and name to save your SDF to. 53 | 54 | **Through a Script** 55 | 56 | ```csharp 57 | // create a new generator instance 58 | DSS.SDF.Generator generator = new DSS.SDF.Generator(); 59 | 60 | // set the relevant options (described in the next section) 61 | generator.Mesh = someMeshInstance; 62 | generator.Resolution = 32; 63 | // ...etc... 64 | 65 | // generate the Texture3D 66 | // note: this can take a long time, so definitely don't do it each frame 67 | // and probably only do it once when the application first starts 68 | Texture3D sdf = generator.Generate(); 69 | ``` 70 | 71 | ## Options 72 | 73 | **Mesh**: the mesh you want to generate an SDF from. 74 | 75 | **Resolution**: the resulting `Texture3D` resolution (I recommend that you keep this below 64). 76 | 77 | **Submesh Index**: for multi-part meshes, the index of the sub-mesh you want to use. 78 | 79 | **Padding**: the padding to surround your mesh within the SDF (only set this to be non-zero if you see artifacts). -------------------------------------------------------------------------------- /Packages/com.dss.sdf-generator/readme.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a9df97d42a90408ba88714c631f7b65 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.5.2", 6 | "com.unity.analytics": "3.3.5", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.ide.rider": "1.1.4", 9 | "com.unity.ide.vscode": "1.2.3", 10 | "com.unity.multiplayer-hlapi": "1.0.6", 11 | "com.unity.purchasing": "2.2.1", 12 | "com.unity.test-framework": "1.1.20", 13 | "com.unity.textmeshpro": "2.0.1", 14 | "com.unity.timeline": "1.2.6", 15 | "com.unity.ugui": "1.0.0", 16 | "com.unity.xr.legacyinputhelpers": "2.1.7", 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 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.dss.sdf-generator": { 4 | "version": "file:com.dss.sdf-generator", 5 | "depth": 0, 6 | "source": "embedded", 7 | "dependencies": {} 8 | }, 9 | "com.unity.2d.sprite": { 10 | "version": "1.0.0", 11 | "depth": 0, 12 | "source": "builtin", 13 | "dependencies": {} 14 | }, 15 | "com.unity.2d.tilemap": { 16 | "version": "1.0.0", 17 | "depth": 0, 18 | "source": "builtin", 19 | "dependencies": {} 20 | }, 21 | "com.unity.ads": { 22 | "version": "3.5.2", 23 | "depth": 0, 24 | "source": "registry", 25 | "dependencies": { 26 | "com.unity.ugui": "1.0.0" 27 | }, 28 | "url": "https://packages.unity.com" 29 | }, 30 | "com.unity.analytics": { 31 | "version": "3.3.5", 32 | "depth": 0, 33 | "source": "registry", 34 | "dependencies": { 35 | "com.unity.ugui": "1.0.0" 36 | }, 37 | "url": "https://packages.unity.com" 38 | }, 39 | "com.unity.collab-proxy": { 40 | "version": "1.2.16", 41 | "depth": 0, 42 | "source": "registry", 43 | "dependencies": {}, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.ext.nunit": { 47 | "version": "1.0.6", 48 | "depth": 1, 49 | "source": "registry", 50 | "dependencies": {}, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.ide.rider": { 54 | "version": "1.1.4", 55 | "depth": 0, 56 | "source": "registry", 57 | "dependencies": { 58 | "com.unity.test-framework": "1.1.1" 59 | }, 60 | "url": "https://packages.unity.com" 61 | }, 62 | "com.unity.ide.vscode": { 63 | "version": "1.2.3", 64 | "depth": 0, 65 | "source": "registry", 66 | "dependencies": {}, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "com.unity.multiplayer-hlapi": { 70 | "version": "1.0.6", 71 | "depth": 0, 72 | "source": "registry", 73 | "dependencies": { 74 | "nuget.mono-cecil": "0.1.6-preview" 75 | }, 76 | "url": "https://packages.unity.com" 77 | }, 78 | "com.unity.purchasing": { 79 | "version": "2.2.1", 80 | "depth": 0, 81 | "source": "registry", 82 | "dependencies": { 83 | "com.unity.ugui": "1.0.0" 84 | }, 85 | "url": "https://packages.unity.com" 86 | }, 87 | "com.unity.test-framework": { 88 | "version": "1.1.20", 89 | "depth": 0, 90 | "source": "registry", 91 | "dependencies": { 92 | "com.unity.ext.nunit": "1.0.6", 93 | "com.unity.modules.imgui": "1.0.0", 94 | "com.unity.modules.jsonserialize": "1.0.0" 95 | }, 96 | "url": "https://packages.unity.com" 97 | }, 98 | "com.unity.textmeshpro": { 99 | "version": "2.0.1", 100 | "depth": 0, 101 | "source": "registry", 102 | "dependencies": { 103 | "com.unity.ugui": "1.0.0" 104 | }, 105 | "url": "https://packages.unity.com" 106 | }, 107 | "com.unity.timeline": { 108 | "version": "1.2.6", 109 | "depth": 0, 110 | "source": "registry", 111 | "dependencies": {}, 112 | "url": "https://packages.unity.com" 113 | }, 114 | "com.unity.ugui": { 115 | "version": "1.0.0", 116 | "depth": 0, 117 | "source": "builtin", 118 | "dependencies": { 119 | "com.unity.modules.ui": "1.0.0", 120 | "com.unity.modules.imgui": "1.0.0" 121 | } 122 | }, 123 | "com.unity.xr.legacyinputhelpers": { 124 | "version": "2.1.7", 125 | "depth": 0, 126 | "source": "registry", 127 | "dependencies": { 128 | "com.unity.modules.vr": "1.0.0", 129 | "com.unity.modules.xr": "1.0.0" 130 | }, 131 | "url": "https://packages.unity.com" 132 | }, 133 | "nuget.mono-cecil": { 134 | "version": "0.1.6-preview", 135 | "depth": 1, 136 | "source": "registry", 137 | "dependencies": {}, 138 | "url": "https://packages.unity.com" 139 | }, 140 | "com.unity.modules.ai": { 141 | "version": "1.0.0", 142 | "depth": 0, 143 | "source": "builtin", 144 | "dependencies": {} 145 | }, 146 | "com.unity.modules.androidjni": { 147 | "version": "1.0.0", 148 | "depth": 0, 149 | "source": "builtin", 150 | "dependencies": {} 151 | }, 152 | "com.unity.modules.animation": { 153 | "version": "1.0.0", 154 | "depth": 0, 155 | "source": "builtin", 156 | "dependencies": {} 157 | }, 158 | "com.unity.modules.assetbundle": { 159 | "version": "1.0.0", 160 | "depth": 0, 161 | "source": "builtin", 162 | "dependencies": {} 163 | }, 164 | "com.unity.modules.audio": { 165 | "version": "1.0.0", 166 | "depth": 0, 167 | "source": "builtin", 168 | "dependencies": {} 169 | }, 170 | "com.unity.modules.cloth": { 171 | "version": "1.0.0", 172 | "depth": 0, 173 | "source": "builtin", 174 | "dependencies": { 175 | "com.unity.modules.physics": "1.0.0" 176 | } 177 | }, 178 | "com.unity.modules.director": { 179 | "version": "1.0.0", 180 | "depth": 0, 181 | "source": "builtin", 182 | "dependencies": { 183 | "com.unity.modules.audio": "1.0.0", 184 | "com.unity.modules.animation": "1.0.0" 185 | } 186 | }, 187 | "com.unity.modules.imageconversion": { 188 | "version": "1.0.0", 189 | "depth": 0, 190 | "source": "builtin", 191 | "dependencies": {} 192 | }, 193 | "com.unity.modules.imgui": { 194 | "version": "1.0.0", 195 | "depth": 0, 196 | "source": "builtin", 197 | "dependencies": {} 198 | }, 199 | "com.unity.modules.jsonserialize": { 200 | "version": "1.0.0", 201 | "depth": 0, 202 | "source": "builtin", 203 | "dependencies": {} 204 | }, 205 | "com.unity.modules.particlesystem": { 206 | "version": "1.0.0", 207 | "depth": 0, 208 | "source": "builtin", 209 | "dependencies": {} 210 | }, 211 | "com.unity.modules.physics": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": {} 216 | }, 217 | "com.unity.modules.physics2d": { 218 | "version": "1.0.0", 219 | "depth": 0, 220 | "source": "builtin", 221 | "dependencies": {} 222 | }, 223 | "com.unity.modules.screencapture": { 224 | "version": "1.0.0", 225 | "depth": 0, 226 | "source": "builtin", 227 | "dependencies": { 228 | "com.unity.modules.imageconversion": "1.0.0" 229 | } 230 | }, 231 | "com.unity.modules.subsystems": { 232 | "version": "1.0.0", 233 | "depth": 1, 234 | "source": "builtin", 235 | "dependencies": { 236 | "com.unity.modules.jsonserialize": "1.0.0" 237 | } 238 | }, 239 | "com.unity.modules.terrain": { 240 | "version": "1.0.0", 241 | "depth": 0, 242 | "source": "builtin", 243 | "dependencies": {} 244 | }, 245 | "com.unity.modules.terrainphysics": { 246 | "version": "1.0.0", 247 | "depth": 0, 248 | "source": "builtin", 249 | "dependencies": { 250 | "com.unity.modules.physics": "1.0.0", 251 | "com.unity.modules.terrain": "1.0.0" 252 | } 253 | }, 254 | "com.unity.modules.tilemap": { 255 | "version": "1.0.0", 256 | "depth": 0, 257 | "source": "builtin", 258 | "dependencies": { 259 | "com.unity.modules.physics2d": "1.0.0" 260 | } 261 | }, 262 | "com.unity.modules.ui": { 263 | "version": "1.0.0", 264 | "depth": 0, 265 | "source": "builtin", 266 | "dependencies": {} 267 | }, 268 | "com.unity.modules.uielements": { 269 | "version": "1.0.0", 270 | "depth": 0, 271 | "source": "builtin", 272 | "dependencies": { 273 | "com.unity.modules.imgui": "1.0.0", 274 | "com.unity.modules.jsonserialize": "1.0.0" 275 | } 276 | }, 277 | "com.unity.modules.umbra": { 278 | "version": "1.0.0", 279 | "depth": 0, 280 | "source": "builtin", 281 | "dependencies": {} 282 | }, 283 | "com.unity.modules.unityanalytics": { 284 | "version": "1.0.0", 285 | "depth": 0, 286 | "source": "builtin", 287 | "dependencies": { 288 | "com.unity.modules.unitywebrequest": "1.0.0", 289 | "com.unity.modules.jsonserialize": "1.0.0" 290 | } 291 | }, 292 | "com.unity.modules.unitywebrequest": { 293 | "version": "1.0.0", 294 | "depth": 0, 295 | "source": "builtin", 296 | "dependencies": {} 297 | }, 298 | "com.unity.modules.unitywebrequestassetbundle": { 299 | "version": "1.0.0", 300 | "depth": 0, 301 | "source": "builtin", 302 | "dependencies": { 303 | "com.unity.modules.assetbundle": "1.0.0", 304 | "com.unity.modules.unitywebrequest": "1.0.0" 305 | } 306 | }, 307 | "com.unity.modules.unitywebrequestaudio": { 308 | "version": "1.0.0", 309 | "depth": 0, 310 | "source": "builtin", 311 | "dependencies": { 312 | "com.unity.modules.unitywebrequest": "1.0.0", 313 | "com.unity.modules.audio": "1.0.0" 314 | } 315 | }, 316 | "com.unity.modules.unitywebrequesttexture": { 317 | "version": "1.0.0", 318 | "depth": 0, 319 | "source": "builtin", 320 | "dependencies": { 321 | "com.unity.modules.unitywebrequest": "1.0.0", 322 | "com.unity.modules.imageconversion": "1.0.0" 323 | } 324 | }, 325 | "com.unity.modules.unitywebrequestwww": { 326 | "version": "1.0.0", 327 | "depth": 0, 328 | "source": "builtin", 329 | "dependencies": { 330 | "com.unity.modules.unitywebrequest": "1.0.0", 331 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 332 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 333 | "com.unity.modules.audio": "1.0.0", 334 | "com.unity.modules.assetbundle": "1.0.0", 335 | "com.unity.modules.imageconversion": "1.0.0" 336 | } 337 | }, 338 | "com.unity.modules.vehicles": { 339 | "version": "1.0.0", 340 | "depth": 0, 341 | "source": "builtin", 342 | "dependencies": { 343 | "com.unity.modules.physics": "1.0.0" 344 | } 345 | }, 346 | "com.unity.modules.video": { 347 | "version": "1.0.0", 348 | "depth": 0, 349 | "source": "builtin", 350 | "dependencies": { 351 | "com.unity.modules.audio": "1.0.0", 352 | "com.unity.modules.ui": "1.0.0", 353 | "com.unity.modules.unitywebrequest": "1.0.0" 354 | } 355 | }, 356 | "com.unity.modules.vr": { 357 | "version": "1.0.0", 358 | "depth": 0, 359 | "source": "builtin", 360 | "dependencies": { 361 | "com.unity.modules.jsonserialize": "1.0.0", 362 | "com.unity.modules.physics": "1.0.0", 363 | "com.unity.modules.xr": "1.0.0" 364 | } 365 | }, 366 | "com.unity.modules.wind": { 367 | "version": "1.0.0", 368 | "depth": 0, 369 | "source": "builtin", 370 | "dependencies": {} 371 | }, 372 | "com.unity.modules.xr": { 373 | "version": "1.0.0", 374 | "depth": 0, 375 | "source": "builtin", 376 | "dependencies": { 377 | "com.unity.modules.physics": "1.0.0", 378 | "com.unity.modules.jsonserialize": "1.0.0", 379 | "com.unity.modules.subsystems": "1.0.0" 380 | } 381 | } 382 | } 383 | } 384 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 10 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | 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 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 9addad374defd8947baa18a46b73c0d5 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Signed-Distance-Field-Generator 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 0 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 0 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 1048576 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 1 128 | isWsaHolographicRemotingEnabled: 0 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | oculus: 144 | sharedDepthBuffer: 1 145 | dashSupport: 1 146 | enable360StereoCapture: 0 147 | protectGraphicsMemory: 0 148 | enableFrameTimingStats: 0 149 | useHDRDisplay: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: {} 156 | buildNumber: {} 157 | AndroidBundleVersionCode: 1 158 | AndroidMinSdkVersion: 16 159 | AndroidTargetSdkVersion: 0 160 | AndroidPreferredInstallLocation: 1 161 | aotOptions: 162 | stripEngineCode: 1 163 | iPhoneStrippingLevel: 0 164 | iPhoneScriptCallOptimization: 0 165 | ForceInternetPermission: 0 166 | ForceSDCardPermission: 0 167 | CreateWallpaper: 0 168 | APKExpansionFiles: 0 169 | keepLoadedShadersAlive: 0 170 | StripUnusedMeshComponents: 0 171 | VertexChannelCompressionMask: 4054 172 | iPhoneSdkVersion: 988 173 | iOSTargetOSVersionString: 9.0 174 | tvOSSdkVersion: 0 175 | tvOSRequireExtendedGameController: 0 176 | tvOSTargetOSVersionString: 9.0 177 | uIPrerenderedIcon: 0 178 | uIRequiresPersistentWiFi: 0 179 | uIRequiresFullScreen: 1 180 | uIStatusBarHidden: 1 181 | uIExitOnSuspend: 0 182 | uIStatusBarStyle: 0 183 | iPhoneSplashScreen: {fileID: 0} 184 | iPhoneHighResSplashScreen: {fileID: 0} 185 | iPhoneTallHighResSplashScreen: {fileID: 0} 186 | iPhone47inSplashScreen: {fileID: 0} 187 | iPhone55inPortraitSplashScreen: {fileID: 0} 188 | iPhone55inLandscapeSplashScreen: {fileID: 0} 189 | iPhone58inPortraitSplashScreen: {fileID: 0} 190 | iPhone58inLandscapeSplashScreen: {fileID: 0} 191 | iPadPortraitSplashScreen: {fileID: 0} 192 | iPadHighResPortraitSplashScreen: {fileID: 0} 193 | iPadLandscapeSplashScreen: {fileID: 0} 194 | iPadHighResLandscapeSplashScreen: {fileID: 0} 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: 00000000000000000000000000000000 241 | templatePackageId: 242 | templateDefaultScene: 243 | AndroidTargetArchitectures: 1 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 0 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | m_AndroidBanners: 255 | - width: 320 256 | height: 180 257 | banner: {fileID: 0} 258 | androidGamepadSupportLevel: 0 259 | resolutionDialogBanner: {fileID: 0} 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: [] 262 | m_BuildTargetBatching: [] 263 | m_BuildTargetGraphicsAPIs: [] 264 | m_BuildTargetVRSettings: [] 265 | m_BuildTargetEnableVuforiaSettings: [] 266 | openGLRequireES31: 0 267 | openGLRequireES31AEP: 0 268 | m_TemplateCustomTags: {} 269 | mobileMTRendering: 270 | Android: 1 271 | iPhone: 1 272 | tvOS: 1 273 | m_BuildTargetGroupLightmapEncodingQuality: [] 274 | m_BuildTargetGroupLightmapSettings: [] 275 | playModeTestRunnerEnabled: 0 276 | runPlayModeTestAsEditModeTest: 0 277 | actionOnDotNetUnhandledException: 1 278 | enableInternalProfiler: 0 279 | logObjCUncaughtExceptions: 1 280 | enableCrashReportAPI: 0 281 | cameraUsageDescription: 282 | locationUsageDescription: 283 | microphoneUsageDescription: 284 | switchNetLibKey: 285 | switchSocketMemoryPoolSize: 6144 286 | switchSocketAllocatorPoolSize: 128 287 | switchSocketConcurrencyLimit: 14 288 | switchScreenResolutionBehavior: 2 289 | switchUseCPUProfiler: 0 290 | switchApplicationID: 0x01004b9000490000 291 | switchNSODependencies: 292 | switchTitleNames_0: 293 | switchTitleNames_1: 294 | switchTitleNames_2: 295 | switchTitleNames_3: 296 | switchTitleNames_4: 297 | switchTitleNames_5: 298 | switchTitleNames_6: 299 | switchTitleNames_7: 300 | switchTitleNames_8: 301 | switchTitleNames_9: 302 | switchTitleNames_10: 303 | switchTitleNames_11: 304 | switchTitleNames_12: 305 | switchTitleNames_13: 306 | switchTitleNames_14: 307 | switchPublisherNames_0: 308 | switchPublisherNames_1: 309 | switchPublisherNames_2: 310 | switchPublisherNames_3: 311 | switchPublisherNames_4: 312 | switchPublisherNames_5: 313 | switchPublisherNames_6: 314 | switchPublisherNames_7: 315 | switchPublisherNames_8: 316 | switchPublisherNames_9: 317 | switchPublisherNames_10: 318 | switchPublisherNames_11: 319 | switchPublisherNames_12: 320 | switchPublisherNames_13: 321 | switchPublisherNames_14: 322 | switchIcons_0: {fileID: 0} 323 | switchIcons_1: {fileID: 0} 324 | switchIcons_2: {fileID: 0} 325 | switchIcons_3: {fileID: 0} 326 | switchIcons_4: {fileID: 0} 327 | switchIcons_5: {fileID: 0} 328 | switchIcons_6: {fileID: 0} 329 | switchIcons_7: {fileID: 0} 330 | switchIcons_8: {fileID: 0} 331 | switchIcons_9: {fileID: 0} 332 | switchIcons_10: {fileID: 0} 333 | switchIcons_11: {fileID: 0} 334 | switchIcons_12: {fileID: 0} 335 | switchIcons_13: {fileID: 0} 336 | switchIcons_14: {fileID: 0} 337 | switchSmallIcons_0: {fileID: 0} 338 | switchSmallIcons_1: {fileID: 0} 339 | switchSmallIcons_2: {fileID: 0} 340 | switchSmallIcons_3: {fileID: 0} 341 | switchSmallIcons_4: {fileID: 0} 342 | switchSmallIcons_5: {fileID: 0} 343 | switchSmallIcons_6: {fileID: 0} 344 | switchSmallIcons_7: {fileID: 0} 345 | switchSmallIcons_8: {fileID: 0} 346 | switchSmallIcons_9: {fileID: 0} 347 | switchSmallIcons_10: {fileID: 0} 348 | switchSmallIcons_11: {fileID: 0} 349 | switchSmallIcons_12: {fileID: 0} 350 | switchSmallIcons_13: {fileID: 0} 351 | switchSmallIcons_14: {fileID: 0} 352 | switchManualHTML: 353 | switchAccessibleURLs: 354 | switchLegalInformation: 355 | switchMainThreadStackSize: 1048576 356 | switchPresenceGroupId: 357 | switchLogoHandling: 0 358 | switchReleaseVersion: 0 359 | switchDisplayVersion: 1.0.0 360 | switchStartupUserAccount: 0 361 | switchTouchScreenUsage: 0 362 | switchSupportedLanguagesMask: 0 363 | switchLogoType: 0 364 | switchApplicationErrorCodeCategory: 365 | switchUserAccountSaveDataSize: 0 366 | switchUserAccountSaveDataJournalSize: 0 367 | switchApplicationAttribute: 0 368 | switchCardSpecSize: -1 369 | switchCardSpecClock: -1 370 | switchRatingsMask: 0 371 | switchRatingsInt_0: 0 372 | switchRatingsInt_1: 0 373 | switchRatingsInt_2: 0 374 | switchRatingsInt_3: 0 375 | switchRatingsInt_4: 0 376 | switchRatingsInt_5: 0 377 | switchRatingsInt_6: 0 378 | switchRatingsInt_7: 0 379 | switchRatingsInt_8: 0 380 | switchRatingsInt_9: 0 381 | switchRatingsInt_10: 0 382 | switchRatingsInt_11: 0 383 | switchLocalCommunicationIds_0: 384 | switchLocalCommunicationIds_1: 385 | switchLocalCommunicationIds_2: 386 | switchLocalCommunicationIds_3: 387 | switchLocalCommunicationIds_4: 388 | switchLocalCommunicationIds_5: 389 | switchLocalCommunicationIds_6: 390 | switchLocalCommunicationIds_7: 391 | switchParentalControl: 0 392 | switchAllowsScreenshot: 1 393 | switchAllowsVideoCapturing: 1 394 | switchAllowsRuntimeAddOnContentInstall: 0 395 | switchDataLossConfirmation: 0 396 | switchUserAccountLockEnabled: 0 397 | switchSystemResourceMemory: 16777216 398 | switchSupportedNpadStyles: 6 399 | switchNativeFsCacheSize: 32 400 | switchIsHoldTypeHorizontal: 0 401 | switchSupportedNpadCount: 8 402 | switchSocketConfigEnabled: 0 403 | switchTcpInitialSendBufferSize: 32 404 | switchTcpInitialReceiveBufferSize: 64 405 | switchTcpAutoSendBufferSizeMax: 256 406 | switchTcpAutoReceiveBufferSizeMax: 256 407 | switchUdpSendBufferSize: 9 408 | switchUdpReceiveBufferSize: 42 409 | switchSocketBufferEfficiency: 4 410 | switchSocketInitializeEnabled: 1 411 | switchNetworkInterfaceManagerInitializeEnabled: 1 412 | switchPlayerConnectionEnabled: 1 413 | ps4NPAgeRating: 12 414 | ps4NPTitleSecret: 415 | ps4NPTrophyPackPath: 416 | ps4ParentalLevel: 11 417 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 418 | ps4Category: 0 419 | ps4MasterVersion: 01.00 420 | ps4AppVersion: 01.00 421 | ps4AppType: 0 422 | ps4ParamSfxPath: 423 | ps4VideoOutPixelFormat: 0 424 | ps4VideoOutInitialWidth: 1920 425 | ps4VideoOutBaseModeInitialWidth: 1920 426 | ps4VideoOutReprojectionRate: 60 427 | ps4PronunciationXMLPath: 428 | ps4PronunciationSIGPath: 429 | ps4BackgroundImagePath: 430 | ps4StartupImagePath: 431 | ps4StartupImagesFolder: 432 | ps4IconImagesFolder: 433 | ps4SaveDataImagePath: 434 | ps4SdkOverride: 435 | ps4BGMPath: 436 | ps4ShareFilePath: 437 | ps4ShareOverlayImagePath: 438 | ps4PrivacyGuardImagePath: 439 | ps4NPtitleDatPath: 440 | ps4RemotePlayKeyAssignment: -1 441 | ps4RemotePlayKeyMappingDir: 442 | ps4PlayTogetherPlayerCount: 0 443 | ps4EnterButtonAssignment: 2 444 | ps4ApplicationParam1: 0 445 | ps4ApplicationParam2: 0 446 | ps4ApplicationParam3: 0 447 | ps4ApplicationParam4: 0 448 | ps4DownloadDataSize: 0 449 | ps4GarlicHeapSize: 2048 450 | ps4ProGarlicHeapSize: 2560 451 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 452 | ps4pnSessions: 1 453 | ps4pnPresence: 1 454 | ps4pnFriends: 1 455 | ps4pnGameCustomData: 1 456 | playerPrefsSupport: 0 457 | enableApplicationExit: 0 458 | resetTempFolder: 1 459 | restrictedAudioUsageRights: 0 460 | ps4UseResolutionFallback: 0 461 | ps4ReprojectionSupport: 0 462 | ps4UseAudio3dBackend: 0 463 | ps4SocialScreenEnabled: 0 464 | ps4ScriptOptimizationLevel: 2 465 | ps4Audio3dVirtualSpeakerCount: 14 466 | ps4attribCpuUsage: 0 467 | ps4PatchPkgPath: 468 | ps4PatchLatestPkgPath: 469 | ps4PatchChangeinfoPath: 470 | ps4PatchDayOne: 0 471 | ps4attribUserManagement: 0 472 | ps4attribMoveSupport: 0 473 | ps4attrib3DSupport: 0 474 | ps4attribShareSupport: 0 475 | ps4attribExclusiveVR: 0 476 | ps4disableAutoHideSplash: 0 477 | ps4videoRecordingFeaturesUsed: 0 478 | ps4contentSearchFeaturesUsed: 0 479 | ps4attribEyeToEyeDistanceSettingVR: 0 480 | ps4IncludedModules: [] 481 | monoEnv: 482 | splashScreenBackgroundSourceLandscape: {fileID: 0} 483 | splashScreenBackgroundSourcePortrait: {fileID: 0} 484 | spritePackerPolicy: 485 | webGLMemorySize: 256 486 | webGLExceptionSupport: 1 487 | webGLNameFilesAsHashes: 0 488 | webGLDataCaching: 1 489 | webGLDebugSymbols: 0 490 | webGLEmscriptenArgs: 491 | webGLModulesDirectory: 492 | webGLTemplate: APPLICATION:Default 493 | webGLAnalyzeBuildSize: 0 494 | webGLUseEmbeddedResources: 0 495 | webGLCompressionFormat: 1 496 | webGLLinkerTarget: 1 497 | webGLThreadsSupport: 0 498 | scriptingDefineSymbols: {} 499 | platformArchitecture: {} 500 | scriptingBackend: {} 501 | il2cppCompilerConfiguration: {} 502 | managedStrippingLevel: {} 503 | incrementalIl2cppBuild: {} 504 | allowUnsafeCode: 0 505 | additionalIl2CppArgs: 506 | scriptingRuntimeVersion: 1 507 | apiCompatibilityLevelPerPlatform: {} 508 | m_RenderingPath: 1 509 | m_MobileRenderingPath: 1 510 | metroPackageName: Signed-Distance-Field-Generator 511 | metroPackageVersion: 512 | metroCertificatePath: 513 | metroCertificatePassword: 514 | metroCertificateSubject: 515 | metroCertificateIssuer: 516 | metroCertificateNotAfter: 0000000000000000 517 | metroApplicationDescription: Signed-Distance-Field-Generator 518 | wsaImages: {} 519 | metroTileShortName: 520 | metroTileShowName: 0 521 | metroMediumTileShowName: 0 522 | metroLargeTileShowName: 0 523 | metroWideTileShowName: 0 524 | metroSupportStreamingInstall: 0 525 | metroLastRequiredScene: 0 526 | metroDefaultTileSize: 1 527 | metroTileForegroundText: 2 528 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 529 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 530 | a: 1} 531 | metroSplashScreenUseBackgroundColor: 0 532 | platformCapabilities: {} 533 | metroTargetDeviceFamilies: {} 534 | metroFTAName: 535 | metroFTAFileTypes: [] 536 | metroProtocolName: 537 | metroCompilationOverrides: 1 538 | XboxOneProductId: 539 | XboxOneUpdateKey: 540 | XboxOneSandboxId: 541 | XboxOneContentId: 542 | XboxOneTitleId: 543 | XboxOneSCId: 544 | XboxOneGameOsOverridePath: 545 | XboxOnePackagingOverridePath: 546 | XboxOneAppManifestOverridePath: 547 | XboxOneVersion: 1.0.0.0 548 | XboxOnePackageEncryption: 0 549 | XboxOnePackageUpdateGranularity: 2 550 | XboxOneDescription: 551 | XboxOneLanguage: 552 | - enus 553 | XboxOneCapability: [] 554 | XboxOneGameRating: {} 555 | XboxOneIsContentPackage: 0 556 | XboxOneEnableGPUVariability: 1 557 | XboxOneSockets: {} 558 | XboxOneSplashScreen: {fileID: 0} 559 | XboxOneAllowedProductIds: [] 560 | XboxOnePersistentLocalStorageSize: 0 561 | XboxOneXTitleMemory: 8 562 | xboxOneScriptCompiler: 0 563 | XboxOneOverrideIdentityName: 564 | vrEditorSettings: 565 | daydream: 566 | daydreamIconForeground: {fileID: 0} 567 | daydreamIconBackground: {fileID: 0} 568 | cloudServicesEnabled: {} 569 | luminIcon: 570 | m_Name: 571 | m_ModelFolderPath: 572 | m_PortalFolderPath: 573 | luminCert: 574 | m_CertPath: 575 | m_PrivateKeyPath: 576 | luminIsChannelApp: 0 577 | luminVersion: 578 | m_VersionCode: 1 579 | m_VersionName: 580 | facebookSdkVersion: 581 | facebookAppId: 582 | facebookCookies: 1 583 | facebookLogging: 1 584 | facebookStatus: 1 585 | facebookXfbml: 0 586 | facebookFrictionlessRequests: 1 587 | apiCompatibilityLevel: 6 588 | cloudProjectId: 589 | framebufferDepthMemorylessMode: 0 590 | projectName: 591 | organizationId: 592 | cloudEnabled: 0 593 | enableNativePlatformBackendsForNewInputSystem: 0 594 | disableOldInputManagerSupport: 0 595 | legacyClampBlendShapeWeights: 0 596 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.18f1 2 | m_EditorVersionWithRevision: 2019.4.18f1 (3310a4d4f880) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo Switch: 5 223 | PS4: 5 224 | Standalone: 5 225 | WebGL: 3 226 | Windows Store Apps: 5 227 | XboxOne: 5 228 | iPhone: 2 229 | tvOS: 2 230 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /img/nHyQgX9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielshervheim/unity-sdf-generator/c13507ecb0df533240e2665f45e8d20c29ce5f30/img/nHyQgX9.gif -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # sdf-generator 2 | 3 | A Unity tool to generate signed distance field volumes (as `Texture3D` assets) from meshes. 4 | 5 | ![demo](img/nHyQgX9.gif) 6 | 7 | ## How To Install 8 | 9 | The sdf-generator package uses the [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html) feature to import 10 | dependent packages. Please add the following sections to the package manifest 11 | file (`Packages/manifest.json`). 12 | 13 | To the `scopedRegistries` section: 14 | 15 | ``` 16 | { 17 | "name": "DSS", 18 | "url": "https://registry.npmjs.com", 19 | "scopes": [ "com.dss" ] 20 | } 21 | ``` 22 | 23 | To the `dependencies` section: 24 | 25 | ``` 26 | "com.dss.sdf-generator": "1.0.2" 27 | ``` 28 | 29 | After changes, the manifest file should look like below: 30 | 31 | ``` 32 | { 33 | "scopedRegistries": [ 34 | { 35 | "name": "DSS", 36 | "url": "https://registry.npmjs.com", 37 | "scopes": [ "com.dss" ] 38 | } 39 | ], 40 | "dependencies": { 41 | "com.dss.sdf-generator": "1.0.2", 42 | ... 43 | ``` 44 | 45 | ## To Use 46 | 47 | **In Editor** 48 | 49 | 1. Select `SDF > Generator` from the Unity menu bar, the tool window will pop up. 50 | 2. Set the relevant options (described in the next section). 51 | 3. Press `Create` and a save dialog will pop up. 52 | 3. Choose a location and name to save your SDF to. 53 | 54 | **Through a Script** 55 | 56 | ```csharp 57 | // create a new generator instance 58 | DSS.SDF.Generator generator = new DSS.SDF.Generator(); 59 | 60 | // set the relevant options (described in the next section) 61 | generator.Mesh = someMeshInstance; 62 | generator.Resolution = 32; 63 | // ...etc... 64 | 65 | // generate the Texture3D 66 | // note: this can take a long time, so definitely don't do it each frame 67 | // and probably only do it once when the application first starts 68 | Texture3D sdf = generator.Generate(); 69 | ``` 70 | 71 | ## Options 72 | 73 | **Mesh**: the mesh you want to generate an SDF from. 74 | 75 | **Resolution**: the resulting `Texture3D` resolution (I recommend that you keep this below 64). 76 | 77 | **Submesh Index**: for multi-part meshes, the index of the sub-mesh you want to use. 78 | 79 | **Padding**: the padding to surround your mesh within the SDF (only set this to be non-zero if you see artifacts). --------------------------------------------------------------------------------