diff --git a/4D Engine Unity/.gitignore b/4D Engine Unity/.gitignore new file mode 100644 index 0000000..58cbc82 --- /dev/null +++ b/4D Engine Unity/.gitignore @@ -0,0 +1,72 @@ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.aab +*.unitypackage +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* diff --git a/4D Engine Unity/.vsconfig b/4D Engine Unity/.vsconfig new file mode 100644 index 0000000..d70cd98 --- /dev/null +++ b/4D Engine Unity/.vsconfig @@ -0,0 +1,6 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedGame" + ] +} diff --git a/4D Engine Unity/Assets/Editor.meta b/4D Engine Unity/Assets/Editor.meta new file mode 100644 index 0000000..d408df5 --- /dev/null +++ b/4D Engine Unity/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63e1587f6f24f6f469d8ee51e93dee52 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Editor/PropertiesEditor.cs b/4D Engine Unity/Assets/Editor/PropertiesEditor.cs new file mode 100644 index 0000000..440dce2 --- /dev/null +++ b/4D Engine Unity/Assets/Editor/PropertiesEditor.cs @@ -0,0 +1,218 @@ +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine; + +[CustomEditor(typeof(RaymarchRenderer))] +public class PropertiesEditor : Editor +{ + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + + RaymarchRenderer renderer = (RaymarchRenderer)target; + + /*if (renderer.dimensions == null) + return;*/ + if (GUILayout.Button("Create New Dimensions")) + renderer.dimensions = CreateShapeDimensionsAsset(); + + if (renderer.dimensions == null) + return; + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Shape Dimensions", EditorStyles.boldLabel); + + switch (renderer.shape) + { + case RaymarchRenderer.Shape.Shpere: + renderer.dimensions.sphereRadius = EditorGUILayout.FloatField("Radius", renderer.dimensions.sphereRadius); + break; + case RaymarchRenderer.Shape.Torus: + renderer.dimensions.torusThickness = EditorGUILayout.Vector2Field("Thickness", renderer.dimensions.torusThickness); + break; + case RaymarchRenderer.Shape.CappedTorus: + renderer.dimensions.cappedTorusRo = EditorGUILayout.FloatField("Ro", renderer.dimensions.cappedTorusRo); + renderer.dimensions.cappedTorusRi = EditorGUILayout.FloatField("Ri", renderer.dimensions.cappedTorusRi); + renderer.dimensions.cappedTorusThickness = EditorGUILayout.Vector2Field("Thickness", renderer.dimensions.cappedTorusThickness); + break; + case RaymarchRenderer.Shape.Link: + renderer.dimensions.linkSeparation = EditorGUILayout.FloatField("Separation", renderer.dimensions.linkSeparation); + renderer.dimensions.linkRadius = EditorGUILayout.FloatField("Radius", renderer.dimensions.linkRadius); + renderer.dimensions.linkThickness = EditorGUILayout.FloatField("Thickness", renderer.dimensions.linkThickness); + break; + case RaymarchRenderer.Shape.Cone: + renderer.dimensions.coneTan = EditorGUILayout.Vector2Field("Tan", renderer.dimensions.coneTan); + renderer.dimensions.coneHeight = EditorGUILayout.FloatField("Height", renderer.dimensions.coneHeight); + break; + case RaymarchRenderer.Shape.InfCone: + renderer.dimensions.infConeTan = EditorGUILayout.Vector2Field("Tan", renderer.dimensions.infConeTan); + break; + case RaymarchRenderer.Shape.Plane: + renderer.dimensions.planeNormal = EditorGUILayout.Vector3Field("Normal", renderer.dimensions.planeNormal); + renderer.dimensions.planeDistance = EditorGUILayout.FloatField("Distance", renderer.dimensions.planeDistance); + break; + case RaymarchRenderer.Shape.HexPrism: + renderer.dimensions.hexPrismH = EditorGUILayout.Vector2Field("H", renderer.dimensions.hexPrismH); + break; + case RaymarchRenderer.Shape.TriPrism: + renderer.dimensions.triPrismH = EditorGUILayout.Vector2Field("H", renderer.dimensions.triPrismH); + break; + case RaymarchRenderer.Shape.Capsule: + renderer.dimensions.capsuleA = EditorGUILayout.Vector3Field("A", renderer.dimensions.capsuleA); + renderer.dimensions.capsuleB = EditorGUILayout.Vector3Field("B", renderer.dimensions.capsuleB); + renderer.dimensions.capsuleR = EditorGUILayout.FloatField("R", renderer.dimensions.capsuleR); + break; + case RaymarchRenderer.Shape.InfiniteCylinder: + renderer.dimensions.infCylC = EditorGUILayout.Vector3Field("C", renderer.dimensions.infCylC); + break; + case RaymarchRenderer.Shape.Box: + renderer.dimensions.boxSize = EditorGUILayout.FloatField("Size", renderer.dimensions.boxSize); + break; + case RaymarchRenderer.Shape.RoundBox: + renderer.dimensions.roundBoxSize = EditorGUILayout.FloatField("Size", renderer.dimensions.roundBoxSize); + renderer.dimensions.roundBoxRoundFactor = EditorGUILayout.FloatField("Round Factor", renderer.dimensions.roundBoxRoundFactor); + break; + case RaymarchRenderer.Shape.RoundedCylinder: + renderer.dimensions.roundCylRa = EditorGUILayout.FloatField("Ra", renderer.dimensions.roundCylRa); + renderer.dimensions.roundCylRb = EditorGUILayout.FloatField("Ra", renderer.dimensions.roundCylRb); + renderer.dimensions.roundCylH = EditorGUILayout.FloatField("Ra", renderer.dimensions.roundCylH); + break; + case RaymarchRenderer.Shape.CappedCone: + renderer.dimensions.capConeH = EditorGUILayout.FloatField("H", renderer.dimensions.capConeH); + renderer.dimensions.capConeR1 = EditorGUILayout.FloatField("R1", renderer.dimensions.capConeR1); + renderer.dimensions.capConeR1 = EditorGUILayout.FloatField("R2", renderer.dimensions.capConeR2); + break; + case RaymarchRenderer.Shape.BoxFrame: + renderer.dimensions.boxFrameSize = EditorGUILayout.Vector3Field("Size", renderer.dimensions.boxFrameSize); + renderer.dimensions.boxFrameCavity = EditorGUILayout.FloatField("Cavity", renderer.dimensions.boxFrameCavity); + break; + case RaymarchRenderer.Shape.SolidAngle: + renderer.dimensions.solidAngleC = EditorGUILayout.Vector2Field("C", renderer.dimensions.solidAngleC); + renderer.dimensions.solidAngleRa = EditorGUILayout.FloatField("Ra", renderer.dimensions.solidAngleRa); + break; + case RaymarchRenderer.Shape.CutSphere: + renderer.dimensions.cutSphereR = EditorGUILayout.FloatField("R", renderer.dimensions.cutSphereR); + renderer.dimensions.cutSphereH = EditorGUILayout.FloatField("H", renderer.dimensions.cutSphereH); + break; + case RaymarchRenderer.Shape.CutHollowSphere: + renderer.dimensions.cutSphereR = EditorGUILayout.FloatField("R", renderer.dimensions.cutSphereR); + renderer.dimensions.cutSphereH = EditorGUILayout.FloatField("H", renderer.dimensions.cutSphereH); + break; + case RaymarchRenderer.Shape.DeathStar: + renderer.dimensions.deathStarRa = EditorGUILayout.FloatField("Ra", renderer.dimensions.deathStarRa); + renderer.dimensions.deathStarRb = EditorGUILayout.FloatField("Rb", renderer.dimensions.deathStarRb); + renderer.dimensions.deathStarD = EditorGUILayout.FloatField("D", renderer.dimensions.deathStarD); + break; + case RaymarchRenderer.Shape.RoundCone: + renderer.dimensions.roundConeR1 = EditorGUILayout.FloatField("R1", renderer.dimensions.roundConeR1); + renderer.dimensions.roundConeR2 = EditorGUILayout.FloatField("R2", renderer.dimensions.roundConeR2); + renderer.dimensions.roundConeH = EditorGUILayout.FloatField("H", renderer.dimensions.roundConeH); + break; + case RaymarchRenderer.Shape.Ellipsoid: + renderer.dimensions.ellipsoidRadius = EditorGUILayout.Vector3Field("Radius", renderer.dimensions.ellipsoidRadius); + break; + case RaymarchRenderer.Shape.Rhombus: + renderer.dimensions.rhombusLa = EditorGUILayout.FloatField("La", renderer.dimensions.rhombusLa); + renderer.dimensions.rhombusLb = EditorGUILayout.FloatField("Lb", renderer.dimensions.rhombusLb); + renderer.dimensions.rhombusH = EditorGUILayout.FloatField("H", renderer.dimensions.rhombusH); + renderer.dimensions.rhombusRa = EditorGUILayout.FloatField("Ra", renderer.dimensions.rhombusRa); + break; + case RaymarchRenderer.Shape.Octahedron: + renderer.dimensions.octahedronSize = EditorGUILayout.FloatField("Size", renderer.dimensions.octahedronSize); + break; + case RaymarchRenderer.Shape.Pyramid: + renderer.dimensions.pyramidSize = EditorGUILayout.FloatField("Size", renderer.dimensions.pyramidSize); + break; + case RaymarchRenderer.Shape.Triangle: + renderer.dimensions.triangleSideA = EditorGUILayout.Vector3Field("Side A", renderer.dimensions.triangleSideA); + renderer.dimensions.triangleSideB = EditorGUILayout.Vector3Field("Side B", renderer.dimensions.triangleSideB); + renderer.dimensions.triangleSideC = EditorGUILayout.Vector3Field("Side C", renderer.dimensions.triangleSideC); + break; + case RaymarchRenderer.Shape.Quad: + renderer.dimensions.quadSideA = EditorGUILayout.Vector3Field("Side A", renderer.dimensions.quadSideA); + renderer.dimensions.quadSideB = EditorGUILayout.Vector3Field("Side B", renderer.dimensions.quadSideB); + renderer.dimensions.quadSideC = EditorGUILayout.Vector3Field("Side C", renderer.dimensions.quadSideC); + renderer.dimensions.quadSideD = EditorGUILayout.Vector3Field("Side D", renderer.dimensions.quadSideD); + break; + case RaymarchRenderer.Shape.Fractal: + renderer.dimensions.fractalI = EditorGUILayout.FloatField("I", renderer.dimensions.fractalI); + renderer.dimensions.fractalS = EditorGUILayout.FloatField("S", renderer.dimensions.fractalS); + renderer.dimensions.fractalO = EditorGUILayout.FloatField("O", renderer.dimensions.fractalO); + break; + case RaymarchRenderer.Shape.Tesseract: + renderer.dimensions.tesseractSize = EditorGUILayout.Vector4Field("Size", renderer.dimensions.tesseractSize); + break; + case RaymarchRenderer.Shape.HyperSphere: + renderer.dimensions.hyperSphereRadius = EditorGUILayout.FloatField("Radius", renderer.dimensions.hyperSphereRadius); + break; + case RaymarchRenderer.Shape.DuoCylinder: + renderer.dimensions.duoCylR1R2 = EditorGUILayout.Vector2Field("R1 R2", renderer.dimensions.duoCylR1R2); + break; + case RaymarchRenderer.Shape.VerticalCapsule: + renderer.dimensions.vertCapsuleH = EditorGUILayout.FloatField("H", renderer.dimensions.vertCapsuleH); + renderer.dimensions.vertCapsuleR = EditorGUILayout.FloatField("R", renderer.dimensions.vertCapsuleR); + break; + case RaymarchRenderer.Shape.FiveCell: + renderer.dimensions.fiveCellA = EditorGUILayout.Vector4Field("A", renderer.dimensions.fiveCellA); + break; + case RaymarchRenderer.Shape.SixteenCell: + renderer.dimensions.sixteenCellS = EditorGUILayout.FloatField("S", renderer.dimensions.sixteenCellS); + break; + default: + EditorGUILayout.HelpBox("Select a shape to see properties", MessageType.Info); + break; + } + + if (!PrefabUtility.IsPartOfPrefabAsset(renderer)) + { + EditorUtility.SetDirty(renderer); + EditorUtility.SetDirty(renderer.dimensions); + } + } + + void OnEnable() + { + EditorApplication.playModeStateChanged += OnPlayModeStateChanged; + EditorApplication.quitting += OnQuitting; + } + + void OnDisable() + { + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; + EditorApplication.quitting -= OnQuitting; + } + + private void OnPlayModeStateChanged(PlayModeStateChange state) + { + if (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.ExitingPlayMode) + ((RaymarchRenderer)target).editorStateChange = true; + } + + private void OnQuitting() + { + ((RaymarchRenderer)target).editorStateChange = true; + } + + ShapeDimensions CreateShapeDimensionsAsset() + { + ShapeDimensions asset = ScriptableObject.CreateInstance(); + + string folderPath = "Assets/ScriptableObjects"; + + if (!System.IO.Directory.Exists(folderPath)) + { + AssetDatabase.CreateFolder("Assets", "ScriptableObjects"); + } + Debug.Log(folderPath); + string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(folderPath + "/New " + typeof(ShapeDimensions).ToString() + ".asset"); + + AssetDatabase.CreateAsset(asset, assetPathAndName); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = asset; + + return asset; + } +} +#endif diff --git a/4D Engine Unity/Assets/Editor/PropertiesEditor.cs.meta b/4D Engine Unity/Assets/Editor/PropertiesEditor.cs.meta new file mode 100644 index 0000000..889b495 --- /dev/null +++ b/4D Engine Unity/Assets/Editor/PropertiesEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7415ed04d115dfa45b0e1f988bf54072 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Material.meta b/4D Engine Unity/Assets/Material.meta new file mode 100644 index 0000000..eee9d1e --- /dev/null +++ b/4D Engine Unity/Assets/Material.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2287a536d2c6d654eb47246d5cd10fb7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Material/Skybox.meta b/4D Engine Unity/Assets/Material/Skybox.meta new file mode 100644 index 0000000..f3d0bbc --- /dev/null +++ b/4D Engine Unity/Assets/Material/Skybox.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ffcc4b721c246a489af89e1efbdaee3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Material/Skybox/Skybox.mat b/4D Engine Unity/Assets/Material/Skybox/Skybox.mat new file mode 100644 index 0000000..55c5707 --- /dev/null +++ b/4D Engine Unity/Assets/Material/Skybox/Skybox.mat @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Skybox + m_Shader: {fileID: 4800000, guid: 83bc7667c314e854dac5bee83506d664, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _SCREENSPACE_ON + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Screenspace: 1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + - _mult: 1 + - _pwer: 1 + m_Colors: + - _Bottom: {r: 1, g: 1, b: 1, a: 0} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Top: {r: 0.7971698, g: 1, b: 0.979717, a: 0} + m_BuildTextureStacks: [] diff --git a/4D Engine Unity/Assets/Material/Skybox/Skybox.mat.meta b/4D Engine Unity/Assets/Material/Skybox/Skybox.mat.meta new file mode 100644 index 0000000..720ef9e --- /dev/null +++ b/4D Engine Unity/Assets/Material/Skybox/Skybox.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c15923909e5d4854997dac85634d10b9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scenes.meta b/4D Engine Unity/Assets/Scenes.meta new file mode 100644 index 0000000..d27b6dc --- /dev/null +++ b/4D Engine Unity/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20bc09afa6266844f9aa49577b2afa18 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scenes/Test.unity b/4D Engine Unity/Assets/Scenes/Test.unity new file mode 100644 index 0000000..4c99614 --- /dev/null +++ b/4D Engine Unity/Assets/Scenes/Test.unity @@ -0,0 +1,592 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 2100000, guid: c15923909e5d4854997dac85634d10b9, type: 2} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0.90028226, g: 0.99999946, b: 0.9896334, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &135448878 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 135448879} + - component: {fileID: 135448880} + m_Layer: 0 + m_Name: Shape (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &135448879 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 135448878} + m_LocalRotation: {x: -0, y: -0, z: -0.37655863, w: 0.9263928} + m_LocalPosition: {x: 1.26, y: 1.13, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 699109754} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -44.241} +--- !u!114 &135448880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 135448878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 99eed1c698dde9040bfd7899717f77aa, type: 3} + m_Name: + m_EditorClassIdentifier: + editorStateChange: 0 + shape: 28 + operation: 0 + color: {r: 0.8945489, g: 1, b: 0, a: 1} + rotW: {x: 0, y: 0, z: 0} + posW: 0 + blendFactor: 0 + dimensions: {fileID: 11400000, guid: 34949d20dbe5560469f7e1eda2fa1edd, type: 2} +--- !u!1 &683425539 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 683425540} + - component: {fileID: 683425541} + m_Layer: 0 + m_Name: Shape + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &683425540 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683425539} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 699109754} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &683425541 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683425539} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 99eed1c698dde9040bfd7899717f77aa, type: 3} + m_Name: + m_EditorClassIdentifier: + editorStateChange: 0 + shape: 3 + operation: 0 + color: {r: 1, g: 0, b: 0, a: 1} + rotW: {x: 0, y: 0, z: 0} + posW: 0 + blendFactor: 0 + dimensions: {fileID: 11400000, guid: deb479c1a5f62fc45b1d212ec2104178, type: 2} +--- !u!1 &699109753 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 699109754} + m_Layer: 0 + m_Name: Shapes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &699109754 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 699109753} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 683425540} + - {fileID: 798373077} + - {fileID: 2119267141} + - {fileID: 135448879} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &798373076 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 798373077} + - component: {fileID: 798373078} + m_Layer: 0 + m_Name: Shape (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &798373077 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798373076} + m_LocalRotation: {x: -0, y: -0, z: 0.1819, w: 0.9833171} + m_LocalPosition: {x: 0.51, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 699109754} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 20.961} +--- !u!114 &798373078 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798373076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 99eed1c698dde9040bfd7899717f77aa, type: 3} + m_Name: + m_EditorClassIdentifier: + editorStateChange: 0 + shape: 4 + operation: 0 + color: {r: 0.041065454, g: 1, b: 0, a: 1} + rotW: {x: 0, y: 0, z: 0} + posW: 0 + blendFactor: 0 + dimensions: {fileID: 11400000, guid: 01bda89ff3477f9439e2798cc895769f, type: 2} +--- !u!1 &963194225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 963194228} + - component: {fileID: 963194227} + - component: {fileID: 963194226} + - component: {fileID: 963194229} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &963194226 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 +--- !u!20 &963194227 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &963194228 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &963194229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b51d3b1b63f090e4983f9b40bc5e24ea, type: 3} + m_Name: + m_EditorClassIdentifier: + renderers: + - {fileID: 135448880} + - {fileID: 683425541} + - {fileID: 798373078} + - {fileID: 2119267142} + shader: {fileID: 4800000, guid: 23729623f4547244ebe3ef8c23c6d180, type: 3} + sun: {fileID: 705507994} + loop: {x: 0, y: 0, z: 0} + wPos: 0 + wRot: {x: 0, y: 0, z: 0} + isLit: 1 + isShadowHard: 0 + isAO: 1 + lightCol: {r: 1, g: 1, b: 1, a: 0} + lightIntensity: 1.2 + shadowIntensity: 1 + shadowMin: 1 + shadowMax: 47 + shadowSmooth: 12.5 + AOStep: 0.2 + AOIntensity: 0.5 + AOIteration: 1 + maxSteps: 225 + maxDist: 1000 + surfDist: 0.01 +--- !u!1 &2119267140 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2119267141} + - component: {fileID: 2119267142} + m_Layer: 0 + m_Name: Shape (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2119267141 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2119267140} + m_LocalRotation: {x: -0, y: -0, z: 0.1819, w: 0.9833171} + m_LocalPosition: {x: -0.5, y: 0.84, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 699109754} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 20.961} +--- !u!114 &2119267142 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2119267140} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 99eed1c698dde9040bfd7899717f77aa, type: 3} + m_Name: + m_EditorClassIdentifier: + editorStateChange: 0 + shape: 23 + operation: 0 + color: {r: 0, g: 0.2835765, b: 1, a: 1} + rotW: {x: 0, y: 0, z: 0} + posW: 0 + blendFactor: 0 + dimensions: {fileID: 11400000, guid: 5d91333f7dde9964ebb4388a8f2e7d89, type: 2} diff --git a/4D Engine Unity/Assets/Scenes/Test.unity.meta b/4D Engine Unity/Assets/Scenes/Test.unity.meta new file mode 100644 index 0000000..bb4200b --- /dev/null +++ b/4D Engine Unity/Assets/Scenes/Test.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 72b597831915baf4695fd06f6d79b0a1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/ScriptableObjects.meta b/4D Engine Unity/Assets/ScriptableObjects.meta new file mode 100644 index 0000000..513391b --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 462432a08d8b68a46b0719379390754d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset new file mode 100644 index 0000000..34e9cb4 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d09dd2715ecd3249b244f71f325d951, type: 3} + m_Name: New ShapeDimensions 1 + m_EditorClassIdentifier: + sphereRadius: 0.5 + torusThickness: {x: 0.4, y: 0.1} + cappedTorusRo: 0.25 + cappedTorusRi: 0.1 + cappedTorusThickness: {x: 0.1, y: 0.1} + linkSeparation: 0.13 + linkRadius: 0.2 + linkThickness: 0.09 + coneTan: {x: 3.25, y: 2.18} + coneHeight: 1.85 + infConeTan: {x: 0.1, y: 0.1} + planeNormal: {x: 0, y: 0.5, z: 0.5} + planeDistance: 1 + hexPrismH: {x: 0.25, y: 0.25} + triPrismH: {x: 0.25, y: 0.25} + capsuleA: {x: 0.25, y: 0.1, z: 0.25} + capsuleB: {x: 0.1, y: 0.25, z: 0.25} + capsuleR: 0.25 + infCylC: {x: 0, y: 0.25, z: 0.25} + boxSize: 0.25 + roundBoxSize: 0.3 + roundBoxRoundFactor: 0.1 + roundCylRa: 0.25 + roundCylRb: 0.1 + roundCylH: 0.25 + capConeH: 0.5 + capConeR1: 0.5 + capConeR2: 0.2 + boxFrameSize: {x: 0.5, y: 0.3, z: 0.2} + boxFrameCavity: 0.1 + solidAngleC: {x: 0.25, y: 0.25} + solidAngleRa: 0.5 + cutSphereR: 0.25 + cutSphereH: 0.1 + hollowSphereR: 0.35 + hollowSphereH: 0.05 + hollowSphereT: 0.05 + deathStarRa: 0.5 + deathStarRb: 0.35 + deathStarD: 0.5 + roundConeR1: 0.1 + roundConeR2: 0.25 + roundConeH: 0.4 + ellipsoidRadius: {x: 0.18, y: 0.3, z: 0.1} + rhombusLa: 0.6 + rhombusLb: 0.2 + rhombusH: 0.02 + rhombusRa: 0.02 + octahedronSize: 0.5 + pyramidSize: 0.5 + triangleSideA: {x: 0.3, y: 0.5, z: 0.15} + triangleSideB: {x: 0.8, y: 0.2, z: 0.1} + triangleSideC: {x: 0.7, y: 0.3, z: 0.5} + quadSideA: {x: 0.3, y: 0.5, z: 0.15} + quadSideB: {x: 0.8, y: 0.2, z: 0} + quadSideC: {x: 0.9, y: 0.3, z: 0.5} + quadSideD: {x: 0.1, y: 0.2, z: 0.5} + fractalI: 10 + fractalS: 1.25 + fractalO: 2 + tesseractSize: {x: 0.25, y: 0.25, z: 0.25, w: 0.25} + hyperSphereRadius: 0.5 + duoCylR1R2: {x: 0.5, y: 0.5} + vertCapsuleH: 0.5 + vertCapsuleR: 0.5 + fiveCellA: {x: 0.5, y: 0.5, z: 0.5, w: 0.5} + sixteenCellS: 0.5 diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset.meta b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset.meta new file mode 100644 index 0000000..d27137b --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 1.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01bda89ff3477f9439e2798cc895769f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset new file mode 100644 index 0000000..73f4d8d --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d09dd2715ecd3249b244f71f325d951, type: 3} + m_Name: New ShapeDimensions 2 + m_EditorClassIdentifier: + sphereRadius: 0.5 + torusThickness: {x: 0.4, y: 0.1} + cappedTorusRo: 0.25 + cappedTorusRi: 0.1 + cappedTorusThickness: {x: 0.1, y: 0.1} + linkSeparation: 0.13 + linkRadius: 0.2 + linkThickness: 0.09 + coneTan: {x: 1, y: 2} + coneHeight: 1 + infConeTan: {x: 0.1, y: 0.1} + planeNormal: {x: 0, y: 0.5, z: 0.5} + planeDistance: 1 + hexPrismH: {x: 0.25, y: 0.25} + triPrismH: {x: 0.25, y: 0.25} + capsuleA: {x: 0.25, y: 0.1, z: 0.25} + capsuleB: {x: 0.1, y: 0.25, z: 0.25} + capsuleR: 0.25 + infCylC: {x: 0, y: 0.25, z: 0.25} + boxSize: 0.25 + roundBoxSize: 0.3 + roundBoxRoundFactor: 0.1 + roundCylRa: 0.25 + roundCylRb: 0.1 + roundCylH: 0.25 + capConeH: 0.5 + capConeR1: 0.5 + capConeR2: 0.2 + boxFrameSize: {x: 0.5, y: 0.3, z: 0.2} + boxFrameCavity: 0.1 + solidAngleC: {x: 0.25, y: 0.25} + solidAngleRa: 0.5 + cutSphereR: 0.25 + cutSphereH: 0.1 + hollowSphereR: 0.35 + hollowSphereH: 0.05 + hollowSphereT: 0.05 + deathStarRa: 0.5 + deathStarRb: 0.35 + deathStarD: 0.5 + roundConeR1: 0.1 + roundConeR2: 0.25 + roundConeH: 0.4 + ellipsoidRadius: {x: 0.18, y: 0.3, z: 0.1} + rhombusLa: 0.6 + rhombusLb: 0.2 + rhombusH: 0.02 + rhombusRa: 0.02 + octahedronSize: 1.5 + pyramidSize: 0.5 + triangleSideA: {x: 0.3, y: 0.5, z: 0.15} + triangleSideB: {x: 0.8, y: 0.2, z: 0.1} + triangleSideC: {x: 0.7, y: 0.3, z: 0.5} + quadSideA: {x: 0.3, y: 0.5, z: 0.15} + quadSideB: {x: 0.8, y: 0.2, z: 0} + quadSideC: {x: 0.9, y: 0.3, z: 0.5} + quadSideD: {x: 0.1, y: 0.2, z: 0.5} + fractalI: 10 + fractalS: 1.25 + fractalO: 2 + tesseractSize: {x: 0.25, y: 0.25, z: 0.25, w: 0.25} + hyperSphereRadius: 0.5 + duoCylR1R2: {x: 0.5, y: 0.5} + vertCapsuleH: 0.5 + vertCapsuleR: 0.5 + fiveCellA: {x: 0.5, y: 0.5, z: 0.5, w: 0.5} + sixteenCellS: 0.5 diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset.meta b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset.meta new file mode 100644 index 0000000..6e5d051 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d91333f7dde9964ebb4388a8f2e7d89 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset new file mode 100644 index 0000000..96b1b97 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d09dd2715ecd3249b244f71f325d951, type: 3} + m_Name: New ShapeDimensions 3 + m_EditorClassIdentifier: + sphereRadius: 0.5 + torusThickness: {x: 0.4, y: 0.1} + cappedTorusRo: 0.25 + cappedTorusRi: 0.1 + cappedTorusThickness: {x: 0.1, y: 0.1} + linkSeparation: 0.13 + linkRadius: 0.2 + linkThickness: 0.09 + coneTan: {x: 1, y: 2} + coneHeight: 1 + infConeTan: {x: 0.1, y: 0.1} + planeNormal: {x: 0, y: 0.5, z: 0.5} + planeDistance: 1 + hexPrismH: {x: 0.25, y: 0.25} + triPrismH: {x: 0.25, y: 0.25} + capsuleA: {x: 0.25, y: 0.1, z: 0.25} + capsuleB: {x: 0.1, y: 0.25, z: 0.25} + capsuleR: 0.25 + infCylC: {x: 0, y: 0.25, z: 0.25} + boxSize: 0.25 + roundBoxSize: 0.3 + roundBoxRoundFactor: 0.1 + roundCylRa: 0.25 + roundCylRb: 0.1 + roundCylH: 0.25 + capConeH: 0.5 + capConeR1: 0.5 + capConeR2: 0.2 + boxFrameSize: {x: 0.5, y: 0.3, z: 0.2} + boxFrameCavity: 0.1 + solidAngleC: {x: 0.25, y: 0.25} + solidAngleRa: 0.5 + cutSphereR: 0.25 + cutSphereH: 0.1 + hollowSphereR: 0.35 + hollowSphereH: 0.05 + hollowSphereT: 0.05 + deathStarRa: 0.5 + deathStarRb: 0.35 + deathStarD: 0.5 + roundConeR1: 0.1 + roundConeR2: 0.25 + roundConeH: 0.4 + ellipsoidRadius: {x: 0.18, y: 0.3, z: 0.1} + rhombusLa: 0.6 + rhombusLb: 0.2 + rhombusH: 0.02 + rhombusRa: 0.02 + octahedronSize: 0.5 + pyramidSize: 0.5 + triangleSideA: {x: 0.3, y: 0.5, z: 0.15} + triangleSideB: {x: 0.8, y: 0.2, z: 0.1} + triangleSideC: {x: 0.7, y: 0.3, z: 0.5} + quadSideA: {x: 0.3, y: 0.5, z: 0.15} + quadSideB: {x: 0.8, y: 0.2, z: 0} + quadSideC: {x: 0.9, y: 0.3, z: 0.5} + quadSideD: {x: 0.1, y: 0.2, z: 0.5} + fractalI: 10 + fractalS: 1.25 + fractalO: 2 + tesseractSize: {x: 2.32, y: 0.5, z: 0.77, w: 0.25} + hyperSphereRadius: 0.5 + duoCylR1R2: {x: 0.5, y: 0.5} + vertCapsuleH: 0.5 + vertCapsuleR: 0.5 + fiveCellA: {x: 0.5, y: 0.5, z: 0.5, w: 0.5} + sixteenCellS: 0.5 diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset.meta b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset.meta new file mode 100644 index 0000000..bce22c6 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions 3.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34949d20dbe5560469f7e1eda2fa1edd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset new file mode 100644 index 0000000..5ea3505 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d09dd2715ecd3249b244f71f325d951, type: 3} + m_Name: New ShapeDimensions + m_EditorClassIdentifier: + sphereRadius: 0.5 + torusThickness: {x: 0.4, y: 0.1} + cappedTorusRo: 0.25 + cappedTorusRi: 0.1 + cappedTorusThickness: {x: 0.1, y: 0.1} + linkSeparation: 2.15 + linkRadius: 1.32 + linkThickness: 0.25 + coneTan: {x: 1, y: 2} + coneHeight: 1 + infConeTan: {x: 0.1, y: 0.1} + planeNormal: {x: 0, y: 0.5, z: 0.5} + planeDistance: 1 + hexPrismH: {x: 0.25, y: 0.25} + triPrismH: {x: 0.25, y: 0.25} + capsuleA: {x: 0.25, y: 0.1, z: 0.25} + capsuleB: {x: 0.1, y: 0.25, z: 0.25} + capsuleR: 0.25 + infCylC: {x: 0, y: 0.25, z: 0.25} + boxSize: 0.25 + roundBoxSize: 0.3 + roundBoxRoundFactor: 0.1 + roundCylRa: 0.25 + roundCylRb: 0.1 + roundCylH: 0.25 + capConeH: 0.5 + capConeR1: 0.5 + capConeR2: 0.2 + boxFrameSize: {x: 0.5, y: 0.3, z: 0.2} + boxFrameCavity: 0.1 + solidAngleC: {x: 0.25, y: 0.25} + solidAngleRa: 0.5 + cutSphereR: 0.25 + cutSphereH: 0.1 + hollowSphereR: 0.35 + hollowSphereH: 0.05 + hollowSphereT: 0.05 + deathStarRa: 0.5 + deathStarRb: 0.35 + deathStarD: 0.5 + roundConeR1: 0.1 + roundConeR2: 0.25 + roundConeH: 0.4 + ellipsoidRadius: {x: 0.18, y: 0.3, z: 0.1} + rhombusLa: 0.6 + rhombusLb: 0.2 + rhombusH: 0.02 + rhombusRa: 0.02 + octahedronSize: 0.5 + pyramidSize: 0.5 + triangleSideA: {x: 0.3, y: 0.5, z: 0.15} + triangleSideB: {x: 0.8, y: 0.2, z: 0.1} + triangleSideC: {x: 0.7, y: 0.3, z: 0.5} + quadSideA: {x: 0.3, y: 0.5, z: 0.15} + quadSideB: {x: 0.8, y: 0.2, z: 0} + quadSideC: {x: 0.9, y: 0.3, z: 0.5} + quadSideD: {x: 0.1, y: 0.2, z: 0.5} + fractalI: 10 + fractalS: 1.25 + fractalO: 2 + tesseractSize: {x: 0.25, y: 0.25, z: 0.25, w: 0.25} + hyperSphereRadius: 0.5 + duoCylR1R2: {x: 0.5, y: 0.5} + vertCapsuleH: 0.5 + vertCapsuleR: 0.5 + fiveCellA: {x: 0.5, y: 0.5, z: 0.5, w: 0.5} + sixteenCellS: 0.5 diff --git a/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset.meta b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset.meta new file mode 100644 index 0000000..da88a71 --- /dev/null +++ b/4D Engine Unity/Assets/ScriptableObjects/New ShapeDimensions.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: deb479c1a5f62fc45b1d212ec2104178 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts.meta b/4D Engine Unity/Assets/Scripts.meta new file mode 100644 index 0000000..53101a6 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be47353e85cc02c4a987fe35aa9e25d9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Events.meta b/4D Engine Unity/Assets/Scripts/Events.meta new file mode 100644 index 0000000..484e883 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c07addffefdd2e34a9a025617f781b06 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs b/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs new file mode 100644 index 0000000..272ff62 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class OnCollision4D : IEventWithData +{ + public GameObject collidedObject; + + public OnCollision4D(GameObject gameObject) + { + collidedObject = gameObject; + } +} diff --git a/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs.meta b/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs.meta new file mode 100644 index 0000000..16b1b33 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Events/OnCollision4D.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1dbd22651a3d6584fa2f386e9b9a3aae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs b/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs new file mode 100644 index 0000000..f70eb44 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class OnDimensionChanging : IEventWithData +{ + public bool isChanging; + public int NextLevelIndex; + + public OnDimensionChanging(bool isChanging, int nextLevelIndex) + { + this.isChanging = isChanging; + NextLevelIndex = nextLevelIndex; + } +} diff --git a/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs.meta b/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs.meta new file mode 100644 index 0000000..dbeba27 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Events/OnDimensionChanging.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46ad03c5088f17645a060dec7ed5a9ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine.meta new file mode 100644 index 0000000..67a2d3e --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b7105fb6e74803488c667c58219dbe6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs b/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs new file mode 100644 index 0000000..0c55e16 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs @@ -0,0 +1,340 @@ +using UnityEngine; +using static Unity.Mathematics.math; +using static Unity.Mathematics.MakraMathUtils; + +namespace Unity.Mathematics +{ + public static class DFs + { + public static float sdSphere(float3 p, float r, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + return length(p4) - r; + } + public static float sdTorus(float3 p, float2 s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float3 q = new float3(length(new float2(p4.x, p4.z)) - s.x, p4.y, p4.w); + return length(q) - s.y; + } + public static float sdCappedTorus(float3 p, float ro, float ri, float2 t, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4.x = abs(p4.x); + float x = (t.y * p4.x > t.x * p4.y) ? dot(new float2(p4.x, p4.y), t) : length(new float2(p4.x, p4.y)); + return sqrt(dot(p4, p4) + ro * ro - 2 * ro * x) - ri; + } + + public static float sdLink(float3 p, float s, float ro, float ri, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = new float4(p4.x, max(abs(p4.y) - s, 0), p4.z, p4.w); + float2 q_xyw = new float2(length(new float2(q.x, q.y)) - ro, length(new float2(q.z, q.w))); + return length(q_xyw) - ri; + } + public static float sdPlane(float3 p, float3 n, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 n4 = new float4(n, 0); // Extend normal to 4D, w component is 0 + return dot(p4, n4) + h; + } + + public static float sdCone(float3 p, float2 c, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 -= new float4(0, h / 2, 0, wPos); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + float2 a = q - c * clamp(dot(q, c) / dot(c, c), 0.0f, 1.0f); + float2 b = q - c * new float2(clamp(q.x / c.x, 0.0f, 1.0f), 1.0f); + float k = sign(c.y); + float d = min(dot(a, a), dot(b, b)); + float s = max(k * (q.x * c.y - q.y * c.x), k * (q.y - c.y)); + return sqrt(d) * sign(s); + } + public static float sdInfCone(float3 p, float2 c, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float2 q = new float2(length(new float2(p4.x, p4.z)), -p4.y); + float d = length(q - c * max(dot(q, c), 0.0f)); + return d * ((q.x * c.y - q.y * c.x < 0.0f) ? -1.0f : 1.0f); + } + public static float sdHexPrism(float3 p, float2 h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float3 k = new float3(-0.8660254f, 0.5f, 0.57735f); + p4.xyz = abs(p4.xyz); + p4.xy -= 2.0f * min(dot(k.xy, p4.xy), 0.0f) * k.xy; + float2 d = new float2( + length(p4.xy - new float2(clamp(p4.x, -k.z * h.x, k.z * h.x), h.x)) * sign(p4.y - h.x), + p4.z - h.y); + return min(max(d.x, d.y), 0.0f) + length(max(d, 0.0f)); + } + public static float sdTriPrism(float3 p, float2 h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4); + return max(q.z - h.y, max(q.x * 0.866025f + p4.y * 0.5f, -p4.y) - h.x * 0.5f); + } + public static float sdCapsule(float3 p, float3 a, float3 b, float r, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = new float4(a, wPos); + float4 b4 = new float4(b, wPos); + float4 pa = p4 - a4, ba = b4 - a4; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0f, 1.0f); + return length(pa - ba * h) - r; + } + public static float sdInfiniteCylinder(float3 p, float3 c, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 c4 = new float4(c, wPos); + return length(new float2(p4.x, p4.z) - new float2(c4.x, c4.y)) - c4.z; + } + public static float sdBox(float3 p, float s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4) - new float4(s, s, s, wPos); + return length(max(q, 0.0f)) + min(max(q.x, max(q.y, q.z)), 0.0f); + } + public static float sdRoundBox(float3 p, float s, float t, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4) - new float4(s, s, s, wPos); + return length(max(q, 0.0f)) + min(max(q.x, max(q.y, q.z)), 0.0f) - t; + } + public static float sdRoundedCylinder(float3 p, float ra, float rb, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float2 d = new float2(length(new float2(p4.x, p4.z)) - 2.0f * ra + rb, abs(p4.y) - h); + return min(max(d.x, d.y), 0.0f) + length(max(d, 0.0f)) - rb; + } + public static float sdCappedCone(float3 p, float h, float r1, float r2, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 -= new float4(0, h / 2, 0, wPos); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + float2 k1 = new float2(r2, h); + float2 k2 = new float2(r2 - r1, 2.0f * h); + float2 ca = new float2(q.x - min(q.x, (q.y < 0.0f) ? r1 : r2), abs(q.y) - h); + float2 cb = q - k1 + k2 * clamp(dot(k1 - q, k2) / dot(k2, k2), 0.0f, 1.0f); + float s = (cb.x < 0.0f && ca.y < 0.0f) ? -1.0f : 1.0f; + return s * sqrt(min(dot(ca, ca), dot(cb, cb))); + } + public static float sdBoxFrame(float3 p, float3 s, float t, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4) - new float4(s, wPos); + float4 q = abs(p4 + new float4(t, t, t, wPos)) - new float4(t, t, t, wPos); + return min(min( + length(max(new float4(p4.x, q.y, q.z, p4.w), 0.0f)) + min(max(p4.x, max(q.y, q.z)), 0.0f), + length(max(new float4(q.x, p4.y, q.z, p4.w), 0.0f)) + min(max(q.x, max(p4.y, q.z)), 0.0f)), + length(max(new float4(q.x, q.y, p4.z, p4.w), 0.0f)) + min(max(q.x, max(q.y, p4.z)), 0.0f)); + } + public static float sdSolidAngle(float3 p, float2 c, float ra, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + float l = length(q) - ra; + float m = length(q - c * clamp(dot(q, c), 0.0f, ra)); + return max(l, m * sign(c.y * q.x - c.x * q.y)); + } + public static float sdCutSphere(float3 p, float r, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float w = sqrt(r * r - h * h); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + float s = max((h - r) * q.x * q.x + w * w * (h + r - 2.0f * q.y), h * q.x - w * q.y); + return (s < 0.0f) ? length(q) - r : ((q.x < w) ? h - q.y : length(q - new float2(w, h))); + } + public static float sdCutHollowSphere(float3 p, float r, float h, float t, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float w = sqrt(r * r - h * h); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + return ((h * q.x < w * q.y) ? length(q - new float2(w, h)) : abs(length(q) - r)) - t; + } + public static float sdDeathStar(float3 p, float ra, float rb, float d, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float a = (ra * ra - rb * rb + d * d) / (2.0f * d); + float b = sqrt(max(ra * ra - a * a, 0.0f)); + float2 p2 = new float2(p4.x, length(new float2(p4.y, p4.z))); + if (p2.x * b - p2.y * a > d * max(b - p2.y, 0.0f)) + return length(p2 - new float2(a, b)); + else + return max((length(p2) - ra), -(length(p2 - new float2(d, 0.0f)) - rb)); + } + public static float sdRoundCone(float3 p, float r1, float r2, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float b = (r1 - r2) / h; + float a = sqrt(1.0f - b * b); + float2 q = new float2(length(new float2(p4.x, p4.z)), p4.y); + float k = dot(q, new float2(-b, a)); + if (k < 0.0f) + return length(q) - r1; + if (k > a * h) + return length(q - new float2(0.0f, h)) - r2; + return dot(q, new float2(a, b)) - r1; + } + public static float sdEllipsoid(float3 p, float3 r, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float k0 = length(p4 / new float4(r, 1.0f)); + float k1 = length(p4 / (new float4(r, 1.0f) * new float4(r, 1.0f))); + return k0 * (k0 - 1.0f) / k1; + } + public static float sdRhombus(float3 p, float la, float lb, float h, float ra, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 p4_swapped = new float4(p4.x, p4.z, -p4.y, p4.w); + p4_swapped.xyz = abs(p4_swapped.xyz); + float2 b = new float2(la, lb); + float f = clamp((ndot(b, b - 2.0f * new float2(p4_swapped.x, p4_swapped.z))) / dot(b, b), -1.0f, 1.0f); + float2 q = new float2(length(new float2(p4_swapped.x, p4_swapped.z) - 0.5f * b * new float2(1.0f - f, 1.0f + f)) * sign(p4_swapped.x * b.y + p4_swapped.z * b.x - b.x * b.y) - ra, p4_swapped.y - h); + return min(max(q.x, q.y), 0.0f) + length(max(q, 0.0f)); + } + public static float sdOctahedron(float3 p, float s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4); + float m = p4.x + p4.y + p4.z - s; + float4 q; + if (3.0f * p4.x < m) + q = new float4(p4.x, p4.y, p4.z, p4.x); + else if (3.0f * p4.y < m) + q = new float4(p4.y, p4.z, p4.x, p4.y); + else if (3.0f * p4.z < m) + q = new float4(p4.z, p4.x, p4.y, p4.z); + else + return m * 0.57735027f; + + float k = clamp(0.5f * (q.z - q.y + s), 0.0f, s); + return length(new float3(q.x, q.y - s + k, q.z - k)); + } + public static float sdPyramid(float3 p, float h, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 += new float4(0, h / 2, 0, wPos); + float m2 = h * h + 0.25f; + + p4.xz = abs(p4.xz); + p4.xz = (p4.z > p4.x) ? new float2(p4.z, p4.x) : p4.xz; + p4.xz -= 0.5f; + + float4 q = new float4(p4.z, h * p4.y - 0.5f * p4.x, h * p4.x + 0.5f * p4.y, p4.w); + + float s = max(-q.x, 0.0f); + float t = clamp((q.y - 0.5f * p4.z) / (m2 + 0.25f), 0.0f, 1.0f); + + float a = m2 * (q.x + s) * (q.x + s) + q.y * q.y; + float b = m2 * (q.x + 0.5f * t) * (q.x + 0.5f * t) + (q.y - m2 * t) * (q.y - m2 * t); + + float d2 = min(q.y, -q.x * m2 - q.y * 0.5f) > 0.0f ? 0.0f : min(a, b); + + return sqrt((d2 + q.z * q.z) / m2) * sign(max(q.z, -p4.y)); + } + public static float udTriangle(float3 p, float3 a, float3 b, float3 c, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = rotWposW(a, wPos, wRot); + float4 b4 = rotWposW(b, wPos, wRot); + float4 c4 = rotWposW(c, wPos, wRot); + float3 ba = b4.xyz - a4.xyz; + float3 pa = p4.xyz - a4.xyz; + float3 cb = c4.xyz - b4.xyz; + float3 pb = p4.xyz - b4.xyz; + float3 ac = a4.xyz - c4.xyz; + float3 pc = p4.xyz - c4.xyz; + float3 nor = cross(ba, ac); + + return sqrt( + (sign(dot(cross(ba, nor), pa)) + + sign(dot(cross(cb, nor), pb)) + + sign(dot(cross(ac, nor), pc)) < 2.0f) + ? min(min( + dot2(ba * clamp(dot(ba, pa) / dot2(ba), 0.0f, 1.0f) - pa), + dot2(cb * clamp(dot(cb, pb) / dot2(cb), 0.0f, 1.0f) - pb)), + dot2(ac * clamp(dot(ac, pc) / dot2(ac), 0.0f, 1.0f) - pc)) + : dot(nor, pa) * dot(nor, pa) / dot2(nor)); + } + public static float udQuad(float3 p, float3 a, float3 b, float3 c, float3 d, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = rotWposW(a, wPos, wRot); + float4 b4 = rotWposW(b, wPos, wRot); + float4 c4 = rotWposW(c, wPos, wRot); + float4 d4 = rotWposW(d, wPos, wRot); + float3 ba = b4.xyz - a4.xyz; + float3 pa = p4.xyz - a4.xyz; + float3 cb = c4.xyz - b4.xyz; + float3 pb = p4.xyz - b4.xyz; + float3 dc = d4.xyz - c4.xyz; + float3 pc = p4.xyz - c4.xyz; + float3 ad = a4.xyz - d4.xyz; + float3 pd = p4.xyz - d4.xyz; + float3 nor = cross(ba, ad); + + return sqrt( + (sign(dot(cross(ba, nor), pa)) + + sign(dot(cross(cb, nor), pb)) + + sign(dot(cross(dc, nor), pc)) + + sign(dot(cross(ad, nor), pd)) < 3.0f) + ? min(min(min( + dot2(ba * clamp(dot(ba, pa) / dot2(ba), 0.0f, 1.0f) - pa), + dot2(cb * clamp(dot(cb, pb) / dot2(cb), 0.0f, 1.0f) - pb)), + dot2(dc * clamp(dot(dc, pc) / dot2(dc), 0.0f, 1.0f) - pc)), + dot2(ad * clamp(dot(ad, pd) / dot2(ad), 0.0f, 1.0f) - pd)) + : dot(nor, pa) * dot(nor, pa) / dot2(nor)); + } + public static float sdFractal(float3 z, float i, float s, float o, float wPos, float3 wRot) + { + float4 z4 = rotWposW(z, wPos, wRot); + int n = 0; + while (n < i) + { + if (z4.x + z4.y < 0) z4.xy = -z4.yx; + if (z4.x + z4.z < 0) z4.xz = -z4.zx; + if (z4.y + z4.z < 0) z4.zy = -z4.yz; + z4.xyz = z4.xyz * s - o * (s - 1.0f); + n++; + } + return length(z4.xyz) * pow(s, -n); + } + public static float sdTesseract(float3 p, float4 s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float4 d = abs(p4) - s; + return min(max(d.x, max(d.y, max(d.z, d.w))), 0.0f) + length(max(d, 0.0f)); + } + public static float sdHyperSphere(float3 p, float s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + return length(p4) - s; + } + public static float sdDuoCylinder(float3 p, float2 r1r2, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + float2 d = abs(new float2(length(new float2(p4.x, p4.z)), length(new float2(p4.y, p4.w)))) - r1r2; + return min(max(d.x, d.y), 0.0f) + length(max(d, 0.0f)); + } + public static float sdVerticalCapsule(float3 p, float h, float r, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4.y -= clamp(p4.y, 0.0f, h); + return length(p4) - r; + } + public static float sdFiveCell(float3 p, float4 a, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + return (max(max(max(abs(p4.x + p4.y + (p4.w / a.w)) - p4.z, abs(p4.x - p4.y + (p4.w / a.w)) + p4.z), abs(p4.x - p4.y - (p4.w / a.w)) + p4.z), abs(p4.x + p4.y - (p4.w / a.w)) - p4.z) - a.x) / sqrt(3.0f); + } + public static float sdSixteenCell(float3 p, float s, float wPos, float3 wRot) + { + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4); + return (p4.x + p4.y + p4.z + p4.w - s) * 0.57735027f; + } + } +} + diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs.meta new file mode 100644 index 0000000..a8594d5 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/DFs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99cd71fa846cf544a89c5ca7fcebdeab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs new file mode 100644 index 0000000..2bc94c7 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs @@ -0,0 +1,207 @@ +using System; +public class Helpers +{ + public static vector12 GetDimensionVectors(int i, ShapeDimensions shapeDimensions) + { + int len = Enum.GetNames(typeof(RaymarchRenderer.Shape)).Length; + + vector12[] dimensions = new vector12[len]; + + if (shapeDimensions == null) + return new vector12(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ; + + //sphere + dimensions[0] = new vector12(shapeDimensions.sphereRadius, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //torus + dimensions[1] = new vector12(shapeDimensions.torusThickness.x, shapeDimensions.torusThickness.y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //capped torus + dimensions[2] = new vector12(shapeDimensions.cappedTorusRo, shapeDimensions.cappedTorusRi, shapeDimensions.cappedTorusThickness.x, shapeDimensions.cappedTorusThickness.y, 0, 0, 0, 0, 0, 0, 0, 0); + + //link + dimensions[3] = new vector12(shapeDimensions.linkSeparation, shapeDimensions.linkRadius, shapeDimensions.linkThickness, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //cone + dimensions[4] = new vector12(shapeDimensions.coneTan.x, shapeDimensions.coneTan.y, shapeDimensions.coneHeight, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //infinite cone + dimensions[5] = new vector12(shapeDimensions.infConeTan.x, shapeDimensions.infConeTan.y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //plane + dimensions[6] = new vector12(shapeDimensions.planeNormal.x, shapeDimensions.planeNormal.y, shapeDimensions.planeNormal.z, shapeDimensions.planeDistance, 0, 0, 0, 0, 0, 0, 0, 0); + + //hexagonal prism + dimensions[7] = new vector12(shapeDimensions.hexPrismH.x, shapeDimensions.hexPrismH.y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //triangular prism + dimensions[8] = new vector12(shapeDimensions.triPrismH.x, shapeDimensions.triPrismH.y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //capsule + dimensions[9] = new vector12(shapeDimensions.capsuleA.x, shapeDimensions.capsuleA.y, shapeDimensions.capsuleA.z, shapeDimensions.capsuleB.x, shapeDimensions.capsuleB.y, shapeDimensions.capsuleB.z, shapeDimensions.capsuleR, 0, 0, 0, 0, 0); + + //infinite cylinder + dimensions[10] = new vector12(shapeDimensions.infCylC.x, shapeDimensions.infCylC.y, shapeDimensions.infCylC.z, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //box + dimensions[11] = new vector12(shapeDimensions.boxSize, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //round box + dimensions[12] = new vector12(shapeDimensions.roundBoxSize, shapeDimensions.roundBoxRoundFactor, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //rounded cylinder + dimensions[13] = new vector12(shapeDimensions.roundCylRa, shapeDimensions.roundCylRb, shapeDimensions.roundCylH, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //capped cone + dimensions[14] = new vector12(shapeDimensions.capConeH, shapeDimensions.capConeR1, shapeDimensions.capConeR2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //box frame + dimensions[15] = new vector12(shapeDimensions.boxFrameSize.x, shapeDimensions.boxFrameSize.y, shapeDimensions.boxFrameSize.z, shapeDimensions.boxFrameCavity, 0, 0, 0, 0, 0, 0, 0, 0); + + //solid angle + dimensions[16] = new vector12(shapeDimensions.solidAngleC.x, shapeDimensions.solidAngleC.y, shapeDimensions.solidAngleRa, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //cut sphere + dimensions[17] = new vector12(shapeDimensions.cutSphereR, shapeDimensions.cutSphereH, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //hollow sphere + dimensions[18] = new vector12(shapeDimensions.hollowSphereR, shapeDimensions.hollowSphereH, shapeDimensions.hollowSphereT, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //death star + dimensions[19] = new vector12(shapeDimensions.deathStarRa, shapeDimensions.deathStarRb, shapeDimensions.deathStarD, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //round cone + dimensions[20] = new vector12(shapeDimensions.roundConeR1, shapeDimensions.roundConeR2, shapeDimensions.roundConeH, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //ellipsoid + dimensions[21] = new vector12(shapeDimensions.ellipsoidRadius.x, shapeDimensions.ellipsoidRadius.y, shapeDimensions.ellipsoidRadius.z, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //rhombus + dimensions[22] = new vector12(shapeDimensions.rhombusLa, shapeDimensions.rhombusLb, shapeDimensions.rhombusH, shapeDimensions.rhombusRa, 0, 0, 0, 0, 0, 0, 0, 0); + + //octahedron + dimensions[23] = new vector12(shapeDimensions.octahedronSize, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //pyramid + dimensions[24] = new vector12(shapeDimensions.pyramidSize, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //triangle + dimensions[25] = new vector12(shapeDimensions.triangleSideA.x, shapeDimensions.triangleSideA.y, shapeDimensions.triangleSideA.z, shapeDimensions.triangleSideB.x, shapeDimensions.triangleSideB.y, shapeDimensions.triangleSideB.z, shapeDimensions.triangleSideC.x, shapeDimensions.triangleSideC.y, shapeDimensions.triangleSideC.z, 0, 0, 0); + + //quad + dimensions[26] = new vector12(shapeDimensions.quadSideA.x, shapeDimensions.quadSideA.y, shapeDimensions.quadSideA.z, shapeDimensions.quadSideB.x, shapeDimensions.quadSideB.y, shapeDimensions.quadSideB.z, shapeDimensions.quadSideC.x, shapeDimensions.quadSideC.y, shapeDimensions.quadSideC.z, shapeDimensions.quadSideD.x, shapeDimensions.quadSideD.y, shapeDimensions.quadSideD.z); + + //fractals + dimensions[27] = new vector12(shapeDimensions.fractalI, shapeDimensions.fractalS, shapeDimensions.fractalO, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //tesseract + dimensions[28] = new vector12(shapeDimensions.tesseractSize.x, shapeDimensions.tesseractSize.y, shapeDimensions.tesseractSize.z, shapeDimensions.tesseractSize.w, 0, 0, 0, 0, 0, 0, 0, 0); + + //hypersphere + dimensions[29] = new vector12(shapeDimensions.hyperSphereRadius, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //duocylinder + dimensions[30] = new vector12(shapeDimensions.duoCylR1R2.x, shapeDimensions.duoCylR1R2.y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //vertical capsule + dimensions[31] = new vector12(shapeDimensions.vertCapsuleH, shapeDimensions.vertCapsuleR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + //fivecell + dimensions[32] = new vector12(shapeDimensions.fiveCellA.x, shapeDimensions.fiveCellA.y, shapeDimensions.fiveCellA.z, shapeDimensions.fiveCellA.w, 0, 0, 0, 0, 0, 0, 0, 0); + + //sixteencell + dimensions[33] = new vector12(shapeDimensions.sixteenCellS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + return dimensions[i]; + } + //discard + /*public static float[] GetDimensionArray(int i) + { + int len = Enum.GetNames(typeof(RaymarchRenderer.Shape)).Length; + + float[][] dimensions = new float[len][]; + + //sphere + dimensions[0] = new float[] { .5f }; + + //torus + dimensions[1] = new float[] { .25f, .5f }; + + //capped torus + dimensions[2] = new float[] { .5f, .1f, .25f, .25f }; + + //link + dimensions[3] = new float[] { .13f, .2f, .09f }; + + //cone + dimensions[4] = new float[] { .25f, .25f, .5f }; + + //infinte cone + dimensions[5] = new float[] { .25f, .25f }; + + //plane + dimensions[6] = new float[] { 0, 1, 0, .25f }; + + //hexagonal prism + dimensions[7] = new float[] { .25f, .25f }; + + //triangular prism + dimensions[8] = new float[] { .25f, .25f }; + + //capsule + dimensions[9] = new float[] { .25f, .25f, .25f, .3f, .3f, .3f, .2f }; + + //infinite cylinder + dimensions[10] = new float[] { 1, 1, 1 }; + + //box + dimensions[11] = new float[] { .5f }; + + //round box + dimensions[12] = new float[] { .5f, .1f }; + + //rounded cylinder + dimensions[13] = new float[] { .5f, .1f, .5f }; + + //capped cone + dimensions[14] = new float[] { .5f, .5f, .1f }; + + //box frame + dimensions[15] = new float[] { .5f, .3f }; + + //solid angle + dimensions[16] = new float[] { .25f, .25f, .5f }; + + //cut sphere + dimensions[17] = new float[] { .5f, .1f }; + + //hollow sphere + dimensions[18] = new float[] { .5f, .5f, .1f }; + + //death star + dimensions[19] = new float[] { .5f, .35f, .5f }; + + //round cone + dimensions[20] = new float[] { .4f, .2f, .1f }; + + //ellipsoid + dimensions[21] = new float[] { .18f, .3f, .02f }; + + //rhombus + dimensions[22] = new float[] { .6f, .2f, .02f, .02f }; + + //octahedron + dimensions[23] = new float[] { .5f }; + + //pyramid + dimensions[24] = new float[] { .5f }; + + //triangle + dimensions[25] = new float[] { .1f, .1f, .1f, .2f, .2f, .2f, .3f, .3f, .3f }; + + //quad + dimensions[26] = new float[] { .1f, .1f, .1f, .2f, .2f, .2f, .3f, .3f, .3f, .4f, .4f, .4f }; + + return dimensions[i]; + }*/ +} \ No newline at end of file diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs.meta new file mode 100644 index 0000000..b8b7af0 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Helpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7dbe538a0d3dbd4897cb97fa59da67d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs new file mode 100644 index 0000000..456cb11 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs @@ -0,0 +1,256 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using static Unity.Mathematics.math; +using static Unity.Mathematics.MakraMathUtils; +using static RaymarchRenderer; + +namespace Unity.Mathematics +{ + public class RaymarchCollision : MonoBehaviour + { + [SerializeField] float offset = 1.5f; + [SerializeField] float maxMovement = 1f; + [SerializeField] Transform[] bounds; + Raymarcher raymarcher; + + private bool isDimesionChanging = false; + + private void Awake() + { + EventCenter.RegisterEvent(OnDimesionChanging); + } + + private void OnDestroy() + { + EventCenter.UnRegisterEvent(OnDimesionChanging); + } + + private void Start() + { + raymarcher = Camera.main.GetComponent(); + } + private void Update() + { + MoveToGround(); + CheckRaymarchDist(bounds); + } + public float GetShapeDistance(RaymarchRenderer rend, float3 p) + { + float wPos = rend.posW - raymarcher.wPos; + float3 wRot = rend.rotW - raymarcher.wRot; + + float3 shapePos = rend.transform.position; + float3 shapeRot = rend.transform.eulerAngles * Mathf.Deg2Rad; + + p -= shapePos; + + p.xz = mul(p.xz, float2x2(cos(shapeRot.y), sin(shapeRot.y), -sin(shapeRot.y), cos(shapeRot.y))); + p.yz = mul(p.yz, float2x2(cos(shapeRot.x), -sin(shapeRot.x), sin(shapeRot.x), cos(shapeRot.x))); + p.xy = mul(p.xy, float2x2(cos(shapeRot.z), -sin(shapeRot.z), sin(shapeRot.z), cos(shapeRot.z))); + + vector12 dimensions = Helpers.GetDimensionVectors((int)rend.shape, rend.dimensions); + + switch (rend.shape) + { + case RaymarchRenderer.Shape.Shpere: + return DFs.sdSphere(p, dimensions.a, wPos, wRot); + case RaymarchRenderer.Shape.Torus: + return DFs.sdTorus(p, new float2(dimensions.a, dimensions.b), wPos, wRot); + case RaymarchRenderer.Shape.CappedTorus: + return DFs.sdCappedTorus(p, dimensions.a, dimensions.b, new float2(dimensions.c, dimensions.d), wPos, wRot); + case RaymarchRenderer.Shape.Link: + return DFs.sdLink(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.Plane: + return DFs.sdPlane(p, new float3(dimensions.a, dimensions.b, dimensions.c), dimensions.d, wPos, wRot); + case RaymarchRenderer.Shape.Cone: + return DFs.sdCone(p, new float2(dimensions.a, dimensions.b), dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.InfCone: + return DFs.sdInfCone(p, new float2(dimensions.a, dimensions.b), wPos, wRot); + case RaymarchRenderer.Shape.HexPrism: + return DFs.sdHexPrism(p, new float2(dimensions.a, dimensions.b), wPos, wRot); + case RaymarchRenderer.Shape.TriPrism: + return DFs.sdTriPrism(p, new float2(dimensions.a, dimensions.b), wPos, wRot); + case RaymarchRenderer.Shape.Capsule: + return DFs.sdCapsule(p, new float3(dimensions.a, dimensions.b, dimensions.c), + new float3(dimensions.d, dimensions.e, dimensions.f),dimensions.g, + wPos, wRot); + case RaymarchRenderer.Shape.InfiniteCylinder: + return DFs.sdInfiniteCylinder(p, new float3(dimensions.a, dimensions.b, dimensions.c), wPos, wRot); + case RaymarchRenderer.Shape.Box: + return DFs.sdBox(p, dimensions.a, wPos, wRot); + case RaymarchRenderer.Shape.RoundBox: + return DFs.sdRoundBox(p, dimensions.a, dimensions.b, wPos, wRot); + case RaymarchRenderer.Shape.RoundedCylinder: + return DFs.sdRoundedCylinder(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.CappedCone: + return DFs.sdCappedCone(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.BoxFrame: + return DFs.sdBoxFrame(p, new float3(dimensions.a, dimensions.b, dimensions.c), dimensions.d, wPos, wRot); + case RaymarchRenderer.Shape.SolidAngle: + return DFs.sdSolidAngle(p, new float2(dimensions.a, dimensions.b), dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.CutSphere: + return DFs.sdCutSphere(p, dimensions.a, dimensions.b, wPos, wRot); + case RaymarchRenderer.Shape.CutHollowSphere: + return DFs.sdCutHollowSphere(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.DeathStar: + return DFs.sdDeathStar(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.RoundCone: + return DFs.sdRoundCone(p, dimensions.a, dimensions.b, dimensions.c, wPos, wRot); + case RaymarchRenderer.Shape.Ellipsoid: + return DFs.sdEllipsoid(p, new float3(dimensions.a, dimensions.b, dimensions.c), wPos, wRot); + case RaymarchRenderer.Shape.Rhombus: + return DFs.sdRhombus(p, dimensions.a, dimensions.b, dimensions.c, dimensions.d, wPos, wRot); + case RaymarchRenderer.Shape.Octahedron: + return DFs.sdOctahedron(p, dimensions.a, wPos, wRot); + case RaymarchRenderer.Shape.Pyramid: + return DFs.sdPyramid(p, dimensions.a, wPos, wRot); + case RaymarchRenderer.Shape.Triangle: + return DFs.udTriangle(p, + new float3(dimensions.a, dimensions.b, dimensions.c), + new float3(dimensions.d, dimensions.e, dimensions.f), + new float3(dimensions.g, dimensions.h, dimensions.i), + wPos, wRot); + case RaymarchRenderer.Shape.Quad: + return DFs.udQuad(p, + new float3(dimensions.a, dimensions.b, dimensions.c), + new float3(dimensions.d, dimensions.e, dimensions.f), + new float3(dimensions.g, dimensions.h, dimensions.i), + new float3(dimensions.j, dimensions.k, dimensions.l), + wPos, wRot); + case RaymarchRenderer.Shape.Fractal: + return DFs.sdFractal(p, + dimensions.a, dimensions.b, dimensions.c, + wPos, wRot); + case RaymarchRenderer.Shape.Tesseract: + return DFs.sdTesseract(p, + new float4(dimensions.a, dimensions.b, dimensions.c, dimensions.d), + wPos, wRot); + case RaymarchRenderer.Shape.HyperSphere: + return DFs.sdHyperSphere(p, + dimensions.a, + wPos, wRot); + case RaymarchRenderer.Shape.DuoCylinder: + return DFs.sdDuoCylinder(p, + new float2(dimensions.a, dimensions.b), + wPos, wRot); + case RaymarchRenderer.Shape.VerticalCapsule: + return DFs.sdVerticalCapsule(p, + dimensions.a, dimensions.b, + wPos, wRot); + case RaymarchRenderer.Shape.FiveCell: + return DFs.sdFiveCell(p, + new float4(dimensions.a, dimensions.b, dimensions.c, dimensions.d), + wPos, wRot); + case RaymarchRenderer.Shape.SixteenCell: + return DFs.sdSixteenCell(p, + dimensions.a, + wPos, wRot); + } + + return Camera.main.farClipPlane; + } + public RaymarchCollisionOutput DistanceField(Vector3 p) + { + float mod_x, mod_y, mod_z; + + if (raymarcher.loop.x != 0) + mod_x = sdFMod(ref p.x, raymarcher.loop.x); + if (raymarcher.loop.y != 0) + mod_y = sdFMod(ref p.y, raymarcher.loop.y); + if (raymarcher.loop.z != 0) + mod_z = sdFMod(ref p.z, raymarcher.loop.z); + + float sigmaDist = Mathf.Infinity; + RaymarchRenderer deltaCollider = null; + + foreach (var rend in raymarcher.renderers) + { + float deltaDist = GetShapeDistance(rend, p); + switch (rend.operation) + { + case Operation.Union: + //sigmaDist = sdUnion(sigmaDist, deltaDist); + if (deltaDist < sigmaDist) + { + sigmaDist = deltaDist; + deltaCollider = rend; + } + break; + case Operation.Intersect: + sigmaDist = sdIntersection(sigmaDist, deltaDist); + if (deltaDist < sigmaDist) + { + sigmaDist = deltaDist; + deltaCollider = rend; + } + break; + case Operation.Subtract: + sigmaDist = sdSubtraction(sigmaDist, deltaDist); + if (deltaDist < sigmaDist) + { + sigmaDist = deltaDist; + deltaCollider = rend; + } + break; + } + } + return new RaymarchCollisionOutput(sigmaDist, deltaCollider); + } + void CheckRaymarchDist(Transform[] ro) + { + + for (int i = 0; i < ro.Length; i++) + { + Vector3 p = ro[i].position; + //check hit + RaymarchCollisionOutput colliderOut = DistanceField(p); + + + if (colliderOut.dist < 0) //hit + { + //Debug.Log("Hit with: " + colliderOut.collider.name); + if (!isDimesionChanging) + { + //transform.Translate(ro[i].forward * colliderOut.dist * Time.fixedDeltaTime, Space.World); + EventCenter.PostEvent(new OnCollision4D(colliderOut.collider.gameObject)); + } + } + } + } + + //moves the player to the ground + void MoveToGround() + { + Vector3 p = transform.position; + //check hit + + RaymarchCollisionOutput colliderOut = DistanceField(p); + + float d = colliderOut.dist; + + d = Mathf.Min(d, maxMovement); + //Debug.Log(d); + + if(!isDimesionChanging) + transform.Translate(Vector3.down * d, Space.World); + } + + private void OnDimesionChanging(OnDimensionChanging data) + { + isDimesionChanging = data.isChanging; + } + } +} +public class RaymarchCollisionOutput +{ + public float dist; + public RaymarchRenderer collider; + + public RaymarchCollisionOutput(float _dist, RaymarchRenderer _collider) + { + this.dist = _dist; + this.collider = _collider; + } +} + diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs.meta new file mode 100644 index 0000000..79ae121 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchCollision.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b07ed07a76e4984a807d88c37b23503 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs new file mode 100644 index 0000000..c3603a0 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +[ExecuteInEditMode] +public class RaymarchRenderer : MonoBehaviour +{ + [HideInInspector] public bool editorStateChange; + public enum Shape + { + Shpere, + Torus, + CappedTorus, + Link, + Cone, + InfCone, + Plane, + HexPrism, + TriPrism, + Capsule, + InfiniteCylinder, + Box, + RoundBox, + RoundedCylinder, + CappedCone, + BoxFrame, + SolidAngle, + CutSphere, + CutHollowSphere, + DeathStar, + RoundCone, + Ellipsoid, + Rhombus, + Octahedron, + Pyramid, + Triangle, + Quad, + Fractal, + Tesseract, + HyperSphere, + DuoCylinder, + VerticalCapsule, + FiveCell, + SixteenCell + }; + public enum Operation + { + Union, + Subtract, + Intersect + }; + + public Shape shape; + public Operation operation; + public Color color = Color.red; + public Vector3 rotW; + public float posW; + + [Range(0f, 100)] + public float blendFactor; + + public ShapeDimensions dimensions; +/* void OnValidate() + { +#if UNITY_EDITOR + // Delay the execution of the asset check and creation to avoid issues during OnValidate. + EditorApplication.delayCall += CheckAndCreateAsset; +#endif + }*/ +#if UNITY_EDITOR + void CheckAndCreateAsset() + { + if (this == null || gameObject == null || !gameObject.activeInHierarchy) + return; + + if (dimensions == null) + dimensions = CreateShapeDimensionsAsset(); + + else if (!PrefabUtility.IsPartOfPrefabAsset(this)) + { + var allRenderers = FindObjectsOfType(); + int sharedCount = 0; + foreach (var renderer in allRenderers) + { + if (renderer != this && renderer.dimensions == dimensions) + sharedCount++; + } + //print(sharedCount); + if (sharedCount > 0) + dimensions = CloneShapeDimensionsAsset(dimensions); + } + } + + ShapeDimensions CloneShapeDimensionsAsset(ShapeDimensions originalAsset) + { + ShapeDimensions clonedAsset = Instantiate(originalAsset); + string folderPath = "Assets/5. ScriptableObject/GeneratedShape"; + + if (!System.IO.Directory.Exists(folderPath)) + { + AssetDatabase.CreateFolder("Assets", "ScriptableObjects"); + } + + string clonedAssetPath = AssetDatabase.GenerateUniqueAssetPath(folderPath + "/Cloned " + typeof(ShapeDimensions).ToString() + ".asset"); + AssetDatabase.CreateAsset(clonedAsset, clonedAssetPath); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = clonedAsset; + + return clonedAsset; + } + + ShapeDimensions CreateShapeDimensionsAsset() + { + ShapeDimensions asset = ScriptableObject.CreateInstance(); + + string folderPath = "Assets/5. ScriptableObject/GeneratedShape"; + + if (!System.IO.Directory.Exists(folderPath)) + { + AssetDatabase.CreateFolder("Assets", "ScriptableObjects"); + } + string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(folderPath + "/New " + typeof(ShapeDimensions).ToString() + ".asset"); + + AssetDatabase.CreateAsset(asset, assetPathAndName); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = asset; + + return asset; + } + /* private void OnDestroy() + { + if (!editorStateChange) + { + string path = AssetDatabase.GetAssetPath(dimensions); + AssetDatabase.DeleteAsset(path); + AssetDatabase.SaveAssets(); + } + }*/ +#endif +} + diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs.meta new file mode 100644 index 0000000..9abab06 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/RaymarchRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99eed1c698dde9040bfd7899717f77aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs new file mode 100644 index 0000000..c67ce16 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System.Linq.Expressions; + +[ExecuteInEditMode] +public class Raymarcher : SceneViewFilter +{ + List disposable = new List(); + [HideInInspector] public List renderers; + public Properties shapeProperties; + ComputeBuffer shapeBuffer; + Material raymarchMaterial; + private Camera _cam; + [Header("General Settings")] + [SerializeField] Shader shader; + [SerializeField] Light sun; + [SerializeField] public Vector3 loop; + [Header("4D Settings")] + [SerializeField] public float wPos; + [SerializeField] public Vector3 wRot; + [Header("Light Settings")] + [SerializeField] bool isLit; + [SerializeField] bool isShadowHard = true; + [SerializeField] bool isAO; + [SerializeField] Color lightCol; + [SerializeField] public float lightIntensity, shadowIntensity, shadowMin, shadowMax, shadowSmooth, AOStep, AOIntensity; + [SerializeField] int AOIteration; + [Header("Render Settings")] + [SerializeField] float maxSteps = 225; + [SerializeField] float maxDist = 1000; + [SerializeField] float surfDist = .01f; + public Material _raymarchMaterial + { + get + { + if (!raymarchMaterial && shader) + { + raymarchMaterial = new Material(shader); + raymarchMaterial.hideFlags = HideFlags.HideAndDontSave; + } + + return raymarchMaterial; + } + } + public Camera _camera + { + get + { + if (!_cam) + { + _cam = GetComponent(); + } + return _cam; + } + } + private void OnRenderImage(RenderTexture source, RenderTexture destination) + { + if (!raymarchMaterial) + { + Graphics.Blit(source, destination); + } + + RaymarchRender(); + + RenderTexture.active = destination; + _raymarchMaterial.SetTexture("_MainTex", source); + + GL.PushMatrix(); + GL.LoadOrtho(); + _raymarchMaterial.SetPass(0); + GL.Begin(GL.QUADS); + + //BL + GL.MultiTexCoord2(0, 0.0f, 0.0f); + GL.Vertex3(0.0f, 0.0f, 3.0f); + + //BR + GL.MultiTexCoord2(0, 1.0f, 0.0f); + GL.Vertex3(1.0f, 0.0f, 2.0f); + + //TR + GL.MultiTexCoord2(0, 1.0f, 1.0f); + GL.Vertex3(1.0f, 1.0f, 1.0f); + + //TL + GL.MultiTexCoord2(0, 0.0f, 1.0f); + GL.Vertex3(0.0f, 1.0f, 0.0f); + + GL.End(); + GL.PopMatrix(); + + foreach (var buffer in disposable) + buffer.Dispose(); + + } + void RaymarchRender() + { + renderers = new List(FindObjectsOfType()); + + if (renderers.Count != 0) + { + Properties[] properties = new Properties[renderers.Count]; + + for (int i = 0; i < renderers.Count; i++) + { + var s = renderers[i]; + + s.transform.localScale = Vector3.one; + Vector3 color = new Vector3(s.color.r, s.color.g, s.color.b); + + Properties p = new Properties() + { + pos = s.transform.position, + posW = s.posW - wPos, + rot = s.transform.eulerAngles * Mathf.Deg2Rad, + rotW = (s.rotW - wRot) * Mathf.Deg2Rad, + col = color, + blendFactor = s.blendFactor * 100, + shapeIndex = (int)s.shape, + opIndex = (int)s.operation, + dimensions = Helpers.GetDimensionVectors((int)s.shape, s.dimensions) + }; + properties[i] = p; + + //_raymarchMaterial.SetFloat("_BlendFactor", s.blendFactor * 10); + + if (renderers[i] == GetComponent()) + _raymarchMaterial.SetInt("_Rank", i); + } + + shapeBuffer = new ComputeBuffer(renderers.Count, 112); + shapeBuffer.SetData(properties); + + _raymarchMaterial.SetInt("_Count", renderers.Count); + _raymarchMaterial.SetBuffer("shapes", shapeBuffer); + _raymarchMaterial.SetFloat("_WPos", wPos); + _raymarchMaterial.SetVector("_WRot", wRot); + _raymarchMaterial.SetMatrix("_CamFrustrum", CamFrustrum(_camera)); + _raymarchMaterial.SetMatrix("_CamToWorld", _camera.cameraToWorldMatrix); + _raymarchMaterial.SetVector("_Loop", loop); + _raymarchMaterial.SetVector("_LightDir", sun ? sun.transform.forward : Vector3.down); + _raymarchMaterial.SetFloat("max_steps", maxSteps); + _raymarchMaterial.SetFloat("max_dist", maxDist); + _raymarchMaterial.SetFloat("surf_dist", surfDist); + _raymarchMaterial.SetColor("_LightCol", lightCol); + _raymarchMaterial.SetFloat("_LightIntensity", lightIntensity); + _raymarchMaterial.SetFloat("_ShadowIntensity", shadowIntensity); + _raymarchMaterial.SetFloat("_ShadowMin", shadowMin); + _raymarchMaterial.SetFloat("_ShadowMax", shadowMax); + _raymarchMaterial.SetFloat("_ShadowSmooth", shadowSmooth); + _raymarchMaterial.SetFloat("_AOStep", AOStep); + _raymarchMaterial.SetFloat("_AOIntensity", AOIntensity); + _raymarchMaterial.SetInt("_AOIteration", AOIteration); + + if (isLit) + _raymarchMaterial.SetInt("_isLit", 1); + else + _raymarchMaterial.SetInt("_isLit", 0); + + if (isShadowHard) + _raymarchMaterial.SetInt("_isShadowHard", 1); + else + _raymarchMaterial.SetInt("_isShadowHard", 0); + + if (isAO) + _raymarchMaterial.SetInt("_isAO", 1); + else + _raymarchMaterial.SetInt("_isAO", 0); + + /* SetShaderBoolean(() => isLit); + SetShaderBoolean(() => isWOverride); + SetShaderBoolean(() => isShadowHard);*/ + + disposable.Add(shapeBuffer); + } + } + void SetShaderBoolean(Expression> expr) + { + var body = (MemberExpression)expr.Body; + string variableName = body.Member.Name; + string propertyName = "_" + variableName; + + bool flag = expr.Compile().Invoke(); + _raymarchMaterial.SetInt(propertyName, flag ? 1 : 0); + } + + private Matrix4x4 CamFrustrum(Camera cam) + { + Matrix4x4 frustrum = Matrix4x4.identity; + float fov = Mathf.Tan((cam.fieldOfView * .5f) * Mathf.Deg2Rad); + + Vector3 goUp = Vector3.up * fov; + Vector3 goRight = Vector3.right * fov * cam.aspect; + + Vector3 TL = (-Vector3.forward - goRight + goUp); + Vector3 TR = (-Vector3.forward + goRight + goUp); + Vector3 BL = (-Vector3.forward - goRight - goUp); + Vector3 BR = (-Vector3.forward + goRight - goUp); + + frustrum.SetRow(0, TL); + frustrum.SetRow(1, TR); + frustrum.SetRow(2, BR); + frustrum.SetRow(3, BL); + + return frustrum; + } +} +public struct Properties +{ + public Vector3 pos; + public float posW; + public Vector3 rot; + public Vector3 rotW; + public Vector3 col; + public float blendFactor; + public int shapeIndex; + public int opIndex; + public vector12 dimensions; +} +public struct vector12 +{ + public float a; + public float b; + public float c; + public float d; + public float e; + public float f; + public float g; + public float h; + public float i; + public float j; + public float k; + public float l; + + public vector12(float _a, float _b, float _c, float _d, float _e, float _f, float _g, float _h, float _i, float _j, float _k, float _l) + { + this.a = _a; + this.b = _b; + this.c = _c; + this.d = _d; + this.e = _e; + this.f = _f; + this.g = _g; + this.h = _h; + this.i = _i; + this.j = _j; + this.k = _k; + this.l = _l; + } +} \ No newline at end of file diff --git a/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs.meta b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs.meta new file mode 100644 index 0000000..9c40e2a --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Raymarching Engine/Raymarcher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b51d3b1b63f090e4983f9b40bc5e24ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Scriptable Objects.meta b/4D Engine Unity/Assets/Scripts/Scriptable Objects.meta new file mode 100644 index 0000000..499b497 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Scriptable Objects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0457e429c8abad4786f1efd728c68b5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs b/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs new file mode 100644 index 0000000..1081353 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs @@ -0,0 +1,72 @@ +using UnityEngine; +[CreateAssetMenu(fileName = "Shape Dimensions", menuName = "Makra/Shape Dimensions")] +public class ShapeDimensions : ScriptableObject +{ + public float sphereRadius = .5f; + public Vector2 torusThickness = new Vector2(.4f, .1f); + public float cappedTorusRo = .25f; + public float cappedTorusRi = .1f; + public Vector2 cappedTorusThickness = new Vector2(.1f, .1f); + public float linkSeparation = .13f; + public float linkRadius = .2f; + public float linkThickness = .09f; + public Vector2 coneTan = new Vector2(1, 2); + public float coneHeight = 1f; + public Vector2 infConeTan = new Vector2(.1f, .1f); + public Vector3 planeNormal = new Vector3(0, .5f, .5f); + public float planeDistance = 1f; + public Vector2 hexPrismH = new Vector2(.25f, .25f); + public Vector2 triPrismH = new Vector2(.25f, .25f); + public Vector3 capsuleA = new Vector3(.25f, .1f, .25f); + public Vector3 capsuleB = new Vector3(.1f, .25f, .25f); + public float capsuleR = .25f; + public Vector3 infCylC = new Vector3(0, .25f, .25f); + public float boxSize = .25f; + public float roundBoxSize = .3f; + public float roundBoxRoundFactor = .1f; + public float roundCylRa = .25f; + public float roundCylRb = .1f; + public float roundCylH = .25f; + public float capConeH = .5f; + public float capConeR1 = .5f; + public float capConeR2 = .2f; + public Vector3 boxFrameSize = new Vector3(.5f, .3f, .2f); + public float boxFrameCavity = .1f; + public Vector2 solidAngleC = new Vector2(.25f, .25f); + public float solidAngleRa = .5f; + public float cutSphereR = .25f; + public float cutSphereH = .1f; + public float hollowSphereR = .35f; + public float hollowSphereH = .05f; + public float hollowSphereT = .05f; + public float deathStarRa = .5f; + public float deathStarRb = .35f; + public float deathStarD = .5f; + public float roundConeR1 = .1f; + public float roundConeR2 = .25f; + public float roundConeH = .4f; + public Vector3 ellipsoidRadius = new Vector3(.18f, .3f, .1f); + public float rhombusLa = .6f; + public float rhombusLb = .2f; + public float rhombusH = .02f; + public float rhombusRa = .02f; + public float octahedronSize = .5f; + public float pyramidSize = .5f; + public Vector3 triangleSideA = new Vector3(.3f, .5f, .15f); + public Vector3 triangleSideB = new Vector3(.8f, .2f, .1f); + public Vector3 triangleSideC = new Vector3(.7f, .3f, .5f); + public Vector3 quadSideA = new Vector3(.3f, .5f, .15f); + public Vector3 quadSideB = new Vector3(.8f, .2f, 0); + public Vector3 quadSideC = new Vector3(.9f, .3f, .5f); + public Vector3 quadSideD = new Vector3(.1f, .2f, .5f); + public float fractalI = 10f; + public float fractalS = 1.25f; + public float fractalO = 2f; + public Vector4 tesseractSize = new Vector4(.25f, .25f, .25f, .25f); + public float hyperSphereRadius = .5f; + public Vector2 duoCylR1R2 = new Vector2(.5f, .5f); + public float vertCapsuleH = .5f; + public float vertCapsuleR = .5f; + public Vector4 fiveCellA = new Vector4(.5f, .5f, .5f, .5f); + public float sixteenCellS = .5f; +} diff --git a/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs.meta b/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs.meta new file mode 100644 index 0000000..85bdb02 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Scriptable Objects/ShapeDimensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d09dd2715ecd3249b244f71f325d951 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils.meta b/4D Engine Unity/Assets/Scripts/Utils.meta new file mode 100644 index 0000000..251e64f --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8e90bdd9373508428eb19e19ed4fbe8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center.meta b/4D Engine Unity/Assets/Scripts/Utils/Event Center.meta new file mode 100644 index 0000000..c8a8028 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53c585a646918f8459dd7be45f78dee3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs b/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs new file mode 100644 index 0000000..fdb4912 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// Event Center handling events with or without arguments. +/// +public class EventCenter +{ + public static Dictionary eventSubscribers = new Dictionary(); + public static Dictionary eventSubscribersWithData = new Dictionary(); + + public delegate void CallbackWithData(T data) where T : IEventWithData; + + public static void RegisterEvent(Action callback) where T : IEvent + { + if (!eventSubscribers.ContainsKey(typeof(T))) + { + eventSubscribers.Add(typeof(T), callback); + } + else + { + eventSubscribers[typeof(T)] += callback; + } + } + + public static void RegisterEvent(CallbackWithData callback) where T : IEventWithData + { + if (!eventSubscribersWithData.ContainsKey(typeof(T))) + { + eventSubscribersWithData.Add(typeof(T), callback); + } + else + { + Delegate currentDelegate; + if (eventSubscribersWithData.TryGetValue(typeof(T), out currentDelegate)) + { + eventSubscribersWithData[typeof(T)] = Delegate.Combine(currentDelegate, callback); + } + } + } + + public static void UnRegisterEvent(Action callback) where T : IEvent + { + if (eventSubscribers.ContainsKey(typeof(T))) + { + eventSubscribers[typeof(T)] -= callback; + } + } + + public static void UnRegisterEvent(CallbackWithData callback) where T : IEventWithData + { + Delegate currentDelegate; + if (eventSubscribersWithData.TryGetValue(typeof(T), out currentDelegate)) + { + eventSubscribersWithData[typeof(T)] = Delegate.Remove(currentDelegate, callback); + } + } + + public static void PostEvent() where T : IEvent + { + if (eventSubscribers.ContainsKey(typeof(T))) + { + eventSubscribers[typeof(T)]?.Invoke(); + } + } + + public static void PostEvent(T eventData) where T : IEventWithData + { + if (eventSubscribersWithData.ContainsKey(typeof(T))) + { + if (eventSubscribersWithData[typeof(T)] != null) + { + ((CallbackWithData)eventSubscribersWithData[typeof(T)])?.Invoke(eventData); + } + } + } +} diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs.meta b/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs.meta new file mode 100644 index 0000000..a14ba26 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/EventCenter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5e4092d9a09ad5439f472039c1a8378 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs new file mode 100644 index 0000000..568a172 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs @@ -0,0 +1,8 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public interface IEvent +{ + +} diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs.meta b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs.meta new file mode 100644 index 0000000..06c157a --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 634280d7b925fed4a902ac9ffa156cc6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs new file mode 100644 index 0000000..a56a7c2 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs @@ -0,0 +1,8 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public interface IEventWithData +{ + +} diff --git a/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs.meta b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs.meta new file mode 100644 index 0000000..0fb4ea4 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Event Center/IEventWithData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed2bdcdf6c6a18745b61c42b6b065c52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter.meta b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter.meta new file mode 100644 index 0000000..d00d7ae --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9fcd6c6e1b5bf2c43aae1eac02697983 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs new file mode 100644 index 0000000..f1c37a0 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs @@ -0,0 +1,70 @@ +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +public class SceneViewFilter : MonoBehaviour +{ +#if UNITY_EDITOR + bool hasChanged = false; + + public virtual void OnValidate() + { + hasChanged = true; + } + + static SceneViewFilter() + { + SceneView.duringSceneGui += CheckMe; + } + + static void CheckMe(SceneView sv) + { + if (Event.current.type != EventType.Layout) + return; + if (!Camera.main) + return; + // Get a list of everything on the main camera that should be synced. + SceneViewFilter[] cameraFilters = Camera.main.GetComponents(); + SceneViewFilter[] sceneFilters = sv.camera.GetComponents(); + + // Let's see if the lists are different lengths or something like that. + // If so, we simply destroy all scene filters and recreate from maincame + if (cameraFilters.Length != sceneFilters.Length) + { + Recreate(sv); + return; + } + for (int i = 0; i < cameraFilters.Length; i++) + { + if (cameraFilters[i].GetType() != sceneFilters[i].GetType()) + { + Recreate(sv); + return; + } + } + + // Ok, WHICH filters, or their order hasn't changed. + // Let's copy all settings for any filter that has changed. + for (int i = 0; i < cameraFilters.Length; i++) + if (cameraFilters[i].hasChanged || sceneFilters[i].enabled != cameraFilters[i].enabled) + { + EditorUtility.CopySerialized(cameraFilters[i], sceneFilters[i]); + cameraFilters[i].hasChanged = false; + } + } + + static void Recreate(SceneView sv) + { + SceneViewFilter filter; + while (filter = sv.camera.GetComponent()) + DestroyImmediate(filter); + + foreach (SceneViewFilter f in Camera.main.GetComponents()) + { + SceneViewFilter newFilter = sv.camera.gameObject.AddComponent(f.GetType()) as SceneViewFilter; + EditorUtility.CopySerialized(f, newFilter); + } + } +#endif +} \ No newline at end of file diff --git a/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs.meta b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs.meta new file mode 100644 index 0000000..b677127 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Scene View Filter/SceneViewFilter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3b71f20285f7a14fb2f18ffc37610ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils.meta b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils.meta new file mode 100644 index 0000000..888c247 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4eab5b0520ceb6b468001a3a6c96cf72 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs new file mode 100644 index 0000000..09111e4 --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs @@ -0,0 +1,92 @@ +using UnityEngine; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics +{ + public static class MakraMathUtils + { + public static Vector2 Abs(Vector2 v) + { + return new Vector2(Mathf.Abs(v.x), Mathf.Abs(v.y)); + } + public static Vector3 Abs(Vector3 v) + { + return new Vector3(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z)); + } + public static Vector4 Abs(Vector4 v) + { + return new Vector4(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z), Mathf.Abs(v.w)); + } + public static Vector2 Max(Vector2 vec1, Vector2 vec2) + { + return new Vector2(Mathf.Max(vec1.x, vec2.x), Mathf.Max(vec1.y, vec2.y)); + } + public static Vector2 Min(Vector2 vec1, Vector2 vec2) + { + return new Vector2(Mathf.Max(vec1.x, vec2.x), Mathf.Max(vec1.y, vec2.y)); + } + public static Vector3 Max(Vector3 vec1, Vector3 vec2) + { + return new Vector3(Mathf.Max(vec1.x, vec2.x), Mathf.Max(vec1.y, vec2.y), Mathf.Max(vec1.z, vec2.z)); + } + public static Vector3 Min(Vector3 vec1, Vector3 vec2) + { + return new Vector3(Mathf.Min(vec1.x, vec2.x), Mathf.Min(vec1.y, vec2.y), Mathf.Min(vec1.z, vec2.z)); + } + public static Vector4 Max(Vector4 vec1, Vector4 vec2) + { + return new Vector4(Mathf.Max(vec1.x, vec2.x), Mathf.Max(vec1.y, vec2.y), Mathf.Max(vec1.z, vec2.z), Mathf.Max(vec1.w, vec2.w)); + } + public static Vector4 Min(Vector4 vec1, Vector4 vec2) + { + return new Vector4(Mathf.Min(vec1.x, vec2.x), Mathf.Min(vec1.y, vec2.y), Mathf.Min(vec1.z, vec2.z), Mathf.Min(vec1.w, vec2.w)); + } + public static float dot2(float3 f) + { + return dot(f, f); + } + public static float dot2(float2 f) + { + return dot(f, f); + } + public static float ndot(float2 a, float2 b) + { + return a.x * b.x - a.y * b.y; + } + public static float sdUnion(float d1, float d2) + { + return min(d1, d2); + } + public static float sdIntersection(float d1, float d2) + { + return max(d1, d2); + } + public static float sdSubtraction(float d1, float d2) + { + return max(-d1, d2); + } + public static float sdFMod(ref float p, float s) + { + float h = s * 0.5f; + float c = floor((p + h) / s); + p = fmod(p + h, s) - h; + p = fmod(-p + h, s) - h; + return c; + } + public static float4 rotWposW(float3 p, float wPos, float3 wRot) + { + float4 p4 = new float4(p, wPos); + + wRot *= math.radians(1f); + + p4.xz = mul(p4.xz, new float2x2(cos(wRot.y), sin(wRot.y), -sin(wRot.y), cos(wRot.y))); + p4.yz = mul(p4.yz, new float2x2(cos(wRot.x), -sin(wRot.x), sin(wRot.x), cos(wRot.x))); + p4.xy = mul(p4.xy, new float2x2(cos(wRot.z), -sin(wRot.z), sin(wRot.z), cos(wRot.z))); + p4.xw = mul(p4.xw, new float2x2(cos(wRot.x), sin(wRot.x), -sin(wRot.x), cos(wRot.x))); + p4.zw = mul(p4.zw, new float2x2(cos(wRot.z), -sin(wRot.z), sin(wRot.z), cos(wRot.z))); + p4.yw = mul(p4.yw, new float2x2(cos(wRot.y), -sin(wRot.y), sin(wRot.y), cos(wRot.y))); + + return p4; + } + } +} diff --git a/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs.meta b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs.meta new file mode 100644 index 0000000..a1dd40c --- /dev/null +++ b/4D Engine Unity/Assets/Scripts/Utils/Shader Math Utils/MakraMathUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d14e235e731ea94985e0db9e641d79a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders.meta b/4D Engine Unity/Assets/Shaders.meta new file mode 100644 index 0000000..4c0a7a1 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99e454f6ec27616449bb4d009bc61729 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher.meta b/4D Engine Unity/Assets/Shaders/Raymarcher.meta new file mode 100644 index 0000000..87a8fa9 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13d5381fe37d8d343ae63d2f5c9e33eb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader b/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader new file mode 100644 index 0000000..df33b33 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader @@ -0,0 +1,417 @@ +Shader"Makra/ImageEffectRaymarcher" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + // No culling or depth +Cull Off +ZWrite Off +ZTest Always + + Pass + { + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + + #include"UnityCG.cginc" + + + #include"Include/DFs.cginc" + +//#define max_steps 225 +//#define max_dist 1000 +//#define surf_dist 1e-2 + +struct vector12 +{ + float a; + float b; + float c; + float d; + float e; + float f; + float g; + float h; + float i; + float j; + float k; + float l; +}; + +struct Shape +{ + float3 pos; + float posW; + float3 rot; + float3 rotW; + float3 col; + float blendFactor; + int shapeIndex; + int opIndex; + vector12 dimensions; +}; + +float max_steps, max_dist, surf_dist; + +StructuredBuffer shapes; +int _Rank, _Count, _isLit, _isAO, _isShadowHard, _AOIteration; +sampler2D _MainTex; +uniform float4x4 _CamFrustrum, _CamToWorld; +sampler2D _CameraDepthTexture; +float3 _LightDir, _WRot, _Loop, _LightCol; +float _WPos, _LightIntensity, _ShadowMin, _ShadowMax, _ShadowIntensity, _ShadowSmooth, _AOStep, _AOIntensity; + +struct appdata +{ + float4 vertex : POSITION; + float2 uv : TEXCOORD0; +}; + +struct v2f +{ + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + float3 ray : TEXCOORD1; +}; + +v2f vert(appdata v) +{ + v2f o; + half index = v.vertex.z; + v.vertex.z = 0; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = v.uv.xy; + o.ray = _CamFrustrum[(int) index].xyz; + o.ray /= abs(o.ray.z); + o.ray = mul(_CamToWorld, o.ray); + return o; +} + +float GetDist(Shape shape, float3 p) +{ + float d = 0; + float wPos = shape.posW; + float3 wRot = shape.rotW; + + p -= shape.pos; + + p.xz = mul(p.xz, float2x2(cos(shape.rot.y), sin(shape.rot.y), -sin(shape.rot.y), cos(shape.rot.y))); + p.yz = mul(p.yz, float2x2(cos(shape.rot.x), -sin(shape.rot.x), sin(shape.rot.x), cos(shape.rot.x))); + p.xy = mul(p.xy, float2x2(cos(shape.rot.z), -sin(shape.rot.z), sin(shape.rot.z), cos(shape.rot.z))); + + switch (shape.shapeIndex) + { + case 0: + d = sdSphere(p, shape.dimensions.a, wPos, wRot); + break; + case 1: + d = sdTorus(p, float2(shape.dimensions.a, shape.dimensions.b), wPos, wRot); + break; + case 2: + d = sdCappedTorus(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 3: + d = sdLink(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 4: + d = sdCone(p, float2(shape.dimensions.a, shape.dimensions.b), shape.dimensions.c, wPos, wRot); + break; + case 5: + d = sdInfCone(p, float2(shape.dimensions.a, shape.dimensions.b), wPos, wRot); + break; + case 6: + d = sdPlane(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), shape.dimensions.d, wPos, wRot); + break; + case 7: + d = sdHexPrism(p, float2(shape.dimensions.a, shape.dimensions.b), wPos, wRot); + break; + case 8: + d = sdTriPrism(p, float2(shape.dimensions.a, shape.dimensions.b), wPos, wRot); + break; + case 9: + d = sdCapsule(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), + float3(shape.dimensions.d, shape.dimensions.e, shape.dimensions.f), + shape.dimensions.g, wPos, wRot); + break; + case 10: + d = sdInfiniteCylinder(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), wPos, wRot); + break; + case 11: + d = sdBox(p, shape.dimensions.a, wPos, wRot); + break; + case 12: + d = sdRoundBox(p, shape.dimensions.a, shape.dimensions.b, wPos, wRot); + break; + case 13: + d = sdRoundedCylinder(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 14: + d = sdCappedCone(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 15: + d = sdBoxFrame(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), shape.dimensions.d, wPos, wRot); + break; + case 16: + d = sdSolidAngle(p, float2(shape.dimensions.a, shape.dimensions.b), shape.dimensions.c, wPos, wRot); + break; + case 17: + d = sdCutSphere(p, shape.dimensions.a, shape.dimensions.b, wPos, wRot); + break; + case 18: + d = sdCutHollowSphere(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 19: + d = sdDeathStar(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 20: + d = sdRoundCone(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 21: + d = sdEllipsoid(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), wPos, wRot); + break; + case 22: + d = sdRhombus(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, shape.dimensions.d, wPos, wRot); + break; + case 23: + d = sdOctahedron(p, shape.dimensions.a, wPos, wRot); + break; + case 24: + d = sdPyramid(p, shape.dimensions.a, wPos, wRot); + break; + case 25: + d = udTriangle(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), + float3(shape.dimensions.d, shape.dimensions.e, shape.dimensions.f), + float3(shape.dimensions.g, shape.dimensions.h, shape.dimensions.i), wPos, wRot); + break; + case 26: + d = udQuad(p, float3(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c), + float3(shape.dimensions.d, shape.dimensions.e, shape.dimensions.f), + float3(shape.dimensions.g, shape.dimensions.h, shape.dimensions.i), + float3(shape.dimensions.j, shape.dimensions.k, shape.dimensions.l), wPos, wRot); + break; + case 27: + d = sdFractal(p, shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, wPos, wRot); + break; + case 28: + d = sdTesseract(p, float4(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, shape.dimensions.d), wPos, wRot); + break; + case 29: + d = sdHyperSphere(p, shape.dimensions.a, wPos, wRot); + break; + case 30: + d = sdDuoCylinder(p, float2(shape.dimensions.a, shape.dimensions.b), wPos, wRot); + break; + case 31: + d = sdVerticalCapsule(p, shape.dimensions.a, shape.dimensions.b, wPos, wRot); + break; + case 32: + d = sdFiveCell(p, float4(shape.dimensions.a, shape.dimensions.b, shape.dimensions.c, shape.dimensions.d), wPos, wRot); + break; + case 33: + d = sdSixteenCell(p, shape.dimensions.a, wPos, wRot); + break; + } + return d; +} + +float distanceField(float3 p) +{ + if (_Loop.x != 0) + float modx = sdFMod(p.x, _Loop.x); + if (_Loop.y != 0) + float mody = sdFMod(p.y, _Loop.y); + if (_Loop.z != 0) + float modz = sdFMod(p.z, _Loop.z); + + float sigmaDist = max_dist; + + for (int i = 0; i < _Count; i++) + { + Shape _shape = shapes[i]; + + float deltaDist = GetDist(_shape, p); + switch (_shape.opIndex) + { + case 0: + sigmaDist = sdUnion(sigmaDist, deltaDist); + break; + case 1: + sigmaDist = sdIntersection(sigmaDist, deltaDist); + break; + case 2: + sigmaDist = sdSubtraction(sigmaDist, deltaDist); + break; + } + } + return sigmaDist; +} + +float3 sigmaColor(float3 p) +{ + float3 sigmaCol = 1; + float sigmaDist = max_dist; + + for (int i = 0; i < _Count; i++) + { + Shape _shape = shapes[i]; + + float deltaDist = GetDist(_shape, p); + float3 deltaCol = _shape.col; + float h = clamp(0.5 + 25 * (sigmaDist - deltaDist) / _shape.blendFactor, 0.0, 1.0); + sigmaCol = lerp(sigmaCol, deltaCol, h); + switch (_shape.opIndex) + { + case 0: + sigmaDist = sdUnion(sigmaDist, deltaDist); + break; + case 1: + sigmaDist = sdIntersection(sigmaDist, deltaDist); + break; + case 2: + sigmaDist = sdSubtraction(sigmaDist, deltaDist); + break; + } + } + return sigmaCol; +} + +float3 getNormal(float3 p) +{ + float d = distanceField(p).x; + const float2 e = float2(.01, 0); + + float3 n = d - float3( + distanceField(p - e.xyy).x, + distanceField(p - e.yxy).x, + distanceField(p - e.yyx).x); + + return normalize(n); +} + +float hardShadow(float3 ro, float3 rd, float minDist, float maxDist) +{ + for (float dist = minDist; dist < maxDist;) + { + float h = distanceField(ro + rd * dist); + + if (h < surf_dist) + return 0; + + dist += h; + } + return 1; +} + +float softShadow(float3 ro, float3 rd, float minDist, float maxDist, float k) +{ + float result = 1; + for (float dist = minDist; dist < maxDist;) + { + float h = distanceField(ro + rd * dist); + + if (h < surf_dist) + return 0; + + result = min(result, k * h / dist); + dist += h; + } + return result; +} + +float AO(float3 p, float3 n) +{ + float step = _AOStep; + float ao = 0; + float dist; + + for (int i = 1; i <= _AOIteration; i++) + { + dist = step * i; + ao += max(0, (dist - distanceField(p + n * dist)) / dist); + } + return (1 - ao * _AOIntensity); +} + +float3 Shading(float3 p, float3 n) +{ + float3 result; + float3 rgbVal = sigmaColor(p); + float shadow = 1; + float3 light = float3(1, 1, 1); + + if (_isLit == 1) + { + light = normalizeF3(_LightCol * dot(-_LightDir, n)) * _LightIntensity; + + if (_isShadowHard == 1) + shadow = normalizeF3(hardShadow(p, -_LightDir, _ShadowMin, _ShadowMax)); + else if (_isShadowHard == 0) + shadow = normalizeF3(softShadow(p, -_LightDir, _ShadowMin, _ShadowMax, _ShadowSmooth)); + shadow = max(0, pow(shadow, _ShadowIntensity)); + } + + float ao = 1; + if (_isAO == 1) + ao = AO(p, n); + + result = rgbVal * light * shadow * ao; + + return result; +} + +fixed4 raymarching(float3 ro, float3 rd, float depth) +{ + fixed4 result; + float dist = 0; + + for (int i = 0; i < max_steps; i++) + { + if (dist > max_dist || dist >= depth) + { + result = fixed4(rd, 0); + break; + } + + float3 p = ro + rd * dist; + + float d = distanceField(p); + + if (d < surf_dist) + { + float3 n = getNormal(p); + float3 s = Shading(p, n); + fixed3 rgbVal = sigmaColor(p); + + //if (_isLit == 1) + //rgbVal = rgbVal * s; + + result = fixed4(s, 1); + break; + } + + dist += d; + } + + return result; +} + +fixed4 frag(v2f i) : SV_Target +{ + float depth = LinearEyeDepth(tex2D(_CameraDepthTexture, i.uv).r); + depth *= length(i.ray); + fixed3 col = tex2D(_MainTex, i.uv); + float3 rayDirection = normalize(i.ray.xyz); + float3 rayOrigin = _WorldSpaceCameraPos; + fixed4 finalRay = raymarching(rayOrigin, rayDirection, depth); + return fixed4(col * (1.0 - finalRay.w) + finalRay.xyz * finalRay.w, 1.0); +} + ENDCG + } + } +} diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader.meta b/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader.meta new file mode 100644 index 0000000..e534ac4 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/ImageEffectRaymarcher.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 23729623f4547244ebe3ef8c23c6d180 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/Include.meta b/4D Engine Unity/Assets/Shaders/Raymarcher/Include.meta new file mode 100644 index 0000000..0d81f10 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/Include.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc55db432cfb3bf4da7a459a428782ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc new file mode 100644 index 0000000..4facdbc --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc @@ -0,0 +1,412 @@ +#include "MakraMathUtils.cginc" + + //sphere +float sdSphere(float3 p, float r, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + return length(p4) - r; +} + + //torus +float sdTorus(float3 p, float2 s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float3 q = float3(length(p4.xz) - s.x, p4.y, p4.w); // Use p4.w to affect the distance calculation + return length(q) - s.y; // The distance calculation now includes the 4th dimension +} + + //capped torus +float sdCappedTorus(float3 p, float ro, float ri, float2 t, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4.x = abs(p4.x); + float x = (t.y * p4.x > t.x * p4.y) ? dot(p4.xy, t) : length(p4.xy); + return sqrt(dot(p4, p4) + ro * ro - 2 * ro * x) - ri; +} + + //link +float sdLink(float3 p, float s, float ro, float ri, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + // Adjust q to consider the separation in 4D by including the w component. + float4 q = float4(p4.x, max(abs(p4.y) - s, 0), p4.z, p4.w); + // Calculate the distance including the w component, which affects the final distance. + float2 q_xyw = float2(length(q.xy) - ro, length(float2(q.z, q.w))); + return length(q_xyw) - ri; +} + + + //cone +float sdCone(float3 p, float2 c, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 -= float4(0, h / 2, 0, wPos); + float2 q = h * float2(c.x / c.y, -1.0); + float2 w = float2(length(p4.xz), p4.y); + float2 a = w - q * clamp(dot(w, q) / dot(q, q), 0.0, 1.0); + float2 b = w - q * float2(clamp(w.x / q.x, 0.0, 1.0), 1.0); + float k = sign(q.y); + float d = min(dot(a, a), dot(b, b)); + float s = max(k * (w.x * q.y - w.y * q.x), k * (w.y - q.y)); + return sqrt(d) * sign(s); +} + + //infinite cone +float sdInfCone(float3 p, float2 c, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float2 q = float2(length(p4.xz), -p4.y); + float d = length(q - c * max(dot(q, c), 0.0)); + return d * ((q.x * c.y - q.y * c.x < 0.0) ? -1.0 : 1.0); +} + + //plane +float sdPlane(float3 p, float3 n, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 n4 = float4(n, 0); // Extend normal to 4D, w component is 0 + return dot(p4, n4) + h; +} + + //hexagonal prism +float sdHexPrism(float3 p, float2 h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + const float3 k = float3(-0.8660254, 0.5, 0.57735); + p4.xyz = abs(p4.xyz); + p4.xy -= 2.0 * min(dot(k.xy, p4.xy), 0.0) * k.xy; + float2 d = float2( + length(p4.xy - float2(clamp(p4.x, -k.z * h.x, k.z * h.x), h.x)) * sign(p4.y - h.x), + p4.z - h.y); + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); +} + + //triangular prism +float sdTriPrism(float3 p, float2 h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4); + return max(q.z - h.y, max(q.x * 0.866025 + p4.y * 0.5, -p4.y) - h.x * 0.5); +} + + //capsule +float sdCapsule(float3 p, float3 a, float3 b, float r, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = float4(a, wPos); + float4 b4 = float4(b, wPos); + float4 pa = p4 - a4, ba = b4 - a4; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0); + return length(pa - ba * h) - r; +} + + //infinite cylinder +float sdInfiniteCylinder(float3 p, float3 c, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 c4 = float4(c, wPos); + return length(p4.xz - c4.xy) - c4.z; +} + + + + //box +float sdBox(float3 p, float s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4) - float4(s, s, s, wPos); + return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0); +} + //round box +float sdRoundBox(float3 p, float s, float t, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 q = abs(p4) - float4(s, s, s, wPos); + return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - t; +} + + + //rounded cylinder +float sdRoundedCylinder(float3 p, float ra, float rb, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float2 d = float2(length(p4.xz) - 2.0 * ra + rb, abs(p4.y) - h); + return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - rb; +} + //capped cone +float sdCappedCone(float3 p, float h, float r1, float r2, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 -= float4(0, h / 2, 0, wPos); + float2 q = float2(length(p4.xz), p4.y); + float2 k1 = float2(r2, h); + float2 k2 = float2(r2 - r1, 2.0 * h); + float2 ca = float2(q.x - min(q.x, (q.y < 0.0) ? r1 : r2), abs(q.y) - h); + float2 cb = q - k1 + k2 * clamp(dot(k1 - q, k2) / dot2(k2), 0.0, 1.0); + float s = (cb.x < 0.0 && ca.y < 0.0) ? -1.0 : 1.0; + return s * sqrt(min(dot2(ca), dot2(cb))); +} + + + //box frame +float sdBoxFrame(float3 p, float3 s, float t, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4) - float4(s, wPos); + float4 q = abs(p4 + float4(t, t, t, wPos)) - float4(t, t, t, wPos); + return min(min( + length(max(float4(p4.x, q.y, q.z, p4.w), 0.0)) + min(max(p4.x, max(q.y, q.z)), 0.0), + length(max(float4(q.x, p4.y, q.z, p4.w), 0.0)) + min(max(q.x, max(p4.y, q.z)), 0.0)), + length(max(float4(q.x, q.y, p4.z, p4.w), 0.0)) + min(max(q.x, max(q.y, p4.z)), 0.0)); +} + + //solid angle +float sdSolidAngle(float3 p, float2 c, float ra, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float2 q = float2(length(p4.xz), p4.y); + float l = length(q) - ra; + float m = length(q - c * clamp(dot(q, c), 0.0, ra)); + return max(l, m * sign(c.y * q.x - c.x * q.y)); +} + + //cut sphere +float sdCutSphere(float3 p, float r, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float w = sqrt(r * r - h * h); + float2 q = float2(length(p4.xz), p4.y); + float s = max((h - r) * q.x * q.x + w * w * (h + r - 2.0 * q.y), h * q.x - w * q.y); + return (s < 0.0) ? length(q) - r : ((q.x < w) ? h - q.y : length(q - float2(w, h))); +} + + //cut hollow sphere +float sdCutHollowSphere(float3 p, float r, float h, float t, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float w = sqrt(r * r - h * h); + float2 q = float2(length(p4.xz), p4.y); + return ((h * q.x < w * q.y) ? length(q - float2(w, h)) : abs(length(q) - r)) - t; +} + + //death star +float sdDeathStar(float3 p, float ra, float rb, float d, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float a = (ra * ra - rb * rb + d * d) / (2.0 * d); + float b = sqrt(max(ra * ra - a * a, 0.0)); + float2 p2 = float2(p4.x, length(p4.yz)); + if (p2.x * b - p2.y * a > d * max(b - p2.y, 0.0)) + return length(p2 - float2(a, b)); + else + return max((length(p2) - ra), -(length(p2 - float2(d, 0)) - rb)); +} + + + //round cone +float sdRoundCone(float3 p, float r1, float r2, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float b = (r1 - r2) / h; + float a = sqrt(1.0 - b * b); + float2 q = float2(length(p4.xz), p4.y); + float k = dot(q, float2(-b, a)); + if (k < 0.0) + return length(q) - r1; + if (k > a * h) + return length(q - float2(0.0, h)) - r2; + return dot(q, float2(a, b)) - r1; +} + + //ellipsoid +float sdEllipsoid(float3 p, float3 r, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float k0 = length(p4 / float4(r, 1)); + float k1 = length(p4 / (float4(r, 1) * float4(r, 1))); + return k0 * (k0 - 1.0) / k1; +} + + //rhombus +float sdRhombus(float3 p, float la, float lb, float h, float ra, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 p4_swapped = float4(p4.x, p4.z, -p4.y, p4.w); // Swap and negate to match original orientation + p4_swapped.xyz = abs(p4_swapped.xyz); + float2 b = float2(la, lb); + float f = clamp((ndot(b, b - 2.0 * p4_swapped.xz)) / dot(b, b), -1.0, 1.0); + float2 q = float2(length(p4_swapped.xz - 0.5 * b * float2(1.0 - f, 1.0 + f)) * sign(p4_swapped.x * b.y + p4_swapped.z * b.x - b.x * b.y) - ra, p4_swapped.y - h); + return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)); +} + + + //octahedron +float sdOctahedron(float3 p, float s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4); + float m = p4.x + p4.y + p4.z - s; + float4 q; + if (3.0 * p4.x < m) + q = p4.xyzx; + else if (3.0 * p4.y < m) + q = p4.yzxy; + else if (3.0 * p4.z < m) + q = p4.zxyz; + else + return m * 0.57735027; + + float k = clamp(0.5 * (q.z - q.y + s), 0.0, s); + return length(float3(q.x, q.y - s + k, q.z - k)); +} + //pyramid +float sdPyramid(float3 p, float h, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 += float4(0, h / 2, 0, wPos); + float m2 = h * h + 0.25; + + p4.xz = abs(p4.xz); + p4.xz = (p4.z > p4.x) ? p4.zx : p4.xz; + p4.xz -= 0.5; + + float4 q = float4(p4.z, h * p4.y - 0.5 * p4.x, h * p4.x + 0.5 * p4.y, p4.w); + + float s = max(-q.x, 0.0); + float t = clamp((q.y - 0.5 * p4.z) / (m2 + 0.25), 0.0, 1.0); + + float a = m2 * (q.x + s) * (q.x + s) + q.y * q.y; + float b = m2 * (q.x + 0.5 * t) * (q.x + 0.5 * t) + (q.y - m2 * t) * (q.y - m2 * t); + + float d2 = min(q.y, -q.x * m2 - q.y * 0.5) > 0.0 ? 0.0 : min(a, b); + + return sqrt((d2 + q.z * q.z) / m2) * sign(max(q.z, -p4.y)); +} + + //triangle +float udTriangle(float3 p, float3 a, float3 b, float3 c, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = rotWposW(a, wPos, wRot); + float4 b4 = rotWposW(b, wPos, wRot); + float4 c4 = rotWposW(c, wPos, wRot); + float3 ba = b4.xyz - a4.xyz; + float3 pa = p4.xyz - a4.xyz; + float3 cb = c4.xyz - b4.xyz; + float3 pb = p4.xyz - b4.xyz; + float3 ac = a4.xyz - c4.xyz; + float3 pc = p4.xyz - c4.xyz; + float3 nor = cross(ba, ac); + + return sqrt( + (sign(dot(cross(ba, nor), pa)) + + sign(dot(cross(cb, nor), pb)) + + sign(dot(cross(ac, nor), pc)) < 2.0) + ? min(min( + dot2(ba * clamp(dot(ba, pa) / dot2(ba), 0.0, 1.0) - pa), + dot2(cb * clamp(dot(cb, pb) / dot2(cb), 0.0, 1.0) - pb)), + dot2(ac * clamp(dot(ac, pc) / dot2(ac), 0.0, 1.0) - pc)) + : dot(nor, pa) * dot(nor, pa) / dot2(nor)); +} + + //quad +float udQuad(float3 p, float3 a, float3 b, float3 c, float3 d, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 a4 = rotWposW(a, wPos, wRot); + float4 b4 = rotWposW(b, wPos, wRot); + float4 c4 = rotWposW(c, wPos, wRot); + float4 d4 = rotWposW(d, wPos, wRot); + float3 ba = b4.xyz - a4.xyz; + float3 pa = p4.xyz - a4.xyz; + float3 cb = c4.xyz - b4.xyz; + float3 pb = p4.xyz - b4.xyz; + float3 dc = d4.xyz - c4.xyz; + float3 pc = p4.xyz - c4.xyz; + float3 ad = a4.xyz - d4.xyz; + float3 pd = p4.xyz - d4.xyz; + float3 nor = cross(ba, ad); + + return sqrt( + (sign(dot(cross(ba, nor), pa)) + + sign(dot(cross(cb, nor), pb)) + + sign(dot(cross(dc, nor), pc)) + + sign(dot(cross(ad, nor), pd)) < 3.0) + ? min(min(min( + dot2(ba * clamp(dot(ba, pa) / dot2(ba), 0.0, 1.0) - pa), + dot2(cb * clamp(dot(cb, pb) / dot2(cb), 0.0, 1.0) - pb)), + dot2(dc * clamp(dot(dc, pc) / dot2(dc), 0.0, 1.0) - pc)), + dot2(ad * clamp(dot(ad, pd) / dot2(ad), 0.0, 1.0) - pd)) + : dot(nor, pa) * dot(nor, pa) / dot2(nor)); +} + + //fractal +float sdFractal(float3 z, float i, float s, float o, float wPos, float3 wRot) +{ + float4 z4 = rotWposW(z, wPos, wRot); + int n = 0; + while (n < i) + { + if (z4.x + z4.y < 0) + z4.xy = -z4.yx; + if (z4.x + z4.z < 0) + z4.xz = -z4.zx; + if (z4.y + z4.z < 0) + z4.zy = -z4.yz; + z4.xyz = z4.xyz * s - o * (s - 1.0); + n++; + } + return (length(z4.xyz)) * pow(s, -float(n)); +} + //tesseract +float sdTesseract(float3 p, float4 s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float4 d = abs(p4) - s; + return min(max(d.x, max(d.y, max(d.z, d.w))), 0.0) + length(max(d, 0.0)); +} + + //hypersphere +float sdHyperSphere(float3 p, float s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + return length(p4) - s; +} + + //duoCylinder +float sdDuoCylinder(float3 p, float2 r1r2, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + float2 d = abs(float2(length(p4.xz), length(p4.yw))) - r1r2; + return min(max(d.x, d.y), 0.) + length(max(d, 0.)); +} + //verticalCapsule +float sdVerticalCapsule(float3 p, float h, float r, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4.y -= clamp(p4.y, 0.0, h); + return length(p4) - r; +} + +float sdFiveCell(float3 p, float4 a, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + return (max(max(max(abs(p4.x + p4.y + (p4.w / a.w)) - p4.z, abs(p4.x - p4.y + (p4.w / a.w)) + p4.z), abs(p4.x - p4.y - (p4.w / a.w)) + p4.z), abs(p4.x + p4.y - (p4.w / a.w)) - p4.z) - a.x) / sqrt(3.); +} + +float sdSixteenCell(float3 p, float s, float wPos, float3 wRot) +{ + float4 p4 = rotWposW(p, wPos, wRot); + p4 = abs(p4); + return (p4.x + p4.y + p4.z + p4.w - s) * 0.57735027f; +} + + + + + + + + + + \ No newline at end of file diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc.meta b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc.meta new file mode 100644 index 0000000..7c5da97 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/DFs.cginc.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 602c0ea5411b5b945ae5dc3d32152fe7 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc new file mode 100644 index 0000000..d1608ff --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc @@ -0,0 +1,56 @@ +float ndot(float2 a, float2 b) +{ + return a.x * b.x - a.y * b.y; +} + +float dot2(float3 f) +{ + return dot(f, f); +} + +float dot2(float2 f) +{ + return dot(f, f); +} + +float sdUnion(float d1, float d2) +{ + return min(d1, d2); +} + +float sdIntersection(float d1, float d2) +{ + return max(d1, d2); +} + +float sdSubtraction(float d1, float d2) +{ + return max(-d1, d2); +} + +float sdFMod(inout float p, float s) +{ + float h = s * .5f; + float c = floor((p + h) / s); + p = fmod(p + h, s) - h; + p = fmod(-p + h, s) - h; + return c; +} + +float4 rotWposW(float3 p, float wPos, float3 wRot) +{ + float4 p4 = float4(p, wPos); + //4d rot matrix + p4.xz = mul(p4.xz, float2x2(cos(wRot.y), sin(wRot.y), -sin(wRot.y), cos(wRot.y))); + p4.yz = mul(p4.yz, float2x2(cos(wRot.x), -sin(wRot.x), sin(wRot.x), cos(wRot.x))); + p4.xy = mul(p4.xy, float2x2(cos(wRot.z), -sin(wRot.z), sin(wRot.z), cos(wRot.z))); + p4.xw = mul(p4.xw, float2x2(cos(wRot.x), sin(wRot.x), -sin(wRot.x), cos(wRot.x))); + p4.zw = mul(p4.zw, float2x2(cos(wRot.z), -sin(wRot.z), sin(wRot.z), cos(wRot.z))); + p4.yw = mul(p4.yw, float2x2(cos(wRot.y), -sin(wRot.y), sin(wRot.y), cos(wRot.y))); + return p4; +} + +float3 normalizeF3(float3 f) +{ + return (f * 0.5) + 0.5; +} \ No newline at end of file diff --git a/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc.meta b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc.meta new file mode 100644 index 0000000..d9860b9 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Raymarcher/Include/MakraMathUtils.cginc.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 516ba30e0e0c8c44c94dc149b4fcf080 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Skybox.meta b/4D Engine Unity/Assets/Shaders/Skybox.meta new file mode 100644 index 0000000..d53a97f --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Skybox.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f435bc613b50e7249b9ce3f5efb387df +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader b/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader new file mode 100644 index 0000000..ef29abe --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader @@ -0,0 +1,165 @@ +// Made with Amplify Shader Editor +// Available at the Unity Asset Store - http://u3d.as/y3X +Shader "Skybox Gradient" +{ + Properties + { + _Top("Top", Color) = (1,1,1,0) + _Bottom("Bottom", Color) = (0,0,0,0) + _mult("mult", Float) = 1 + _pwer("pwer", Float) = 1 + [Toggle(_SCREENSPACE_ON)] _Screenspace("Screen space", Float) = 0 + + } + + SubShader + { + + + Tags { "RenderType"="Opaque" } + LOD 100 + + CGINCLUDE + #pragma target 3.0 + ENDCG + Blend Off + Cull Back + ColorMask RGBA + ZWrite On + ZTest LEqual + Offset 0 , 0 + + + + Pass + { + Name "Unlit" + Tags { "LightMode"="ForwardBase" } + CGPROGRAM + + + + #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX + //only defining to not throw compilation error over Unity 5.5 + #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input) + #endif + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + #include "UnityCG.cginc" + #pragma shader_feature_local _SCREENSPACE_ON + + + struct appdata + { + float4 vertex : POSITION; + float4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + struct v2f + { + float4 vertex : SV_POSITION; +#ifdef ASE_NEEDS_FRAG_WORLD_POSITION + float3 worldPos : TEXCOORD0; +#endif + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + float4 ase_texcoord1 : TEXCOORD1; + float4 ase_texcoord2 : TEXCOORD2; + }; + + uniform float4 _Bottom; + uniform float4 _Top; + uniform float _mult; + uniform float _pwer; + + + v2f vert ( appdata v ) + { + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + UNITY_TRANSFER_INSTANCE_ID(v, o); + + float4 ase_clipPos = UnityObjectToClipPos(v.vertex); + float4 screenPos = ComputeScreenPos(ase_clipPos); + o.ase_texcoord2 = screenPos; + + o.ase_texcoord1 = v.vertex; + float3 vertexValue = float3(0, 0, 0); + #if ASE_ABSOLUTE_VERTEX_POS + vertexValue = v.vertex.xyz; + #endif + vertexValue = vertexValue; + #if ASE_ABSOLUTE_VERTEX_POS + v.vertex.xyz = vertexValue; + #else + v.vertex.xyz += vertexValue; + #endif + o.vertex = UnityObjectToClipPos(v.vertex); + +#ifdef ASE_NEEDS_FRAG_WORLD_POSITION + o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz; +#endif + return o; + } + + fixed4 frag (v2f i ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + fixed4 finalColor; +#ifdef ASE_NEEDS_FRAG_WORLD_POSITION + float3 WorldPosition = i.worldPos; +#endif + float4 screenPos = i.ase_texcoord2; + float4 ase_screenPosNorm = screenPos / screenPos.w; + ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5; + #ifdef _SCREENSPACE_ON + float staticSwitch13 = ase_screenPosNorm.y; + #else + float staticSwitch13 = i.ase_texcoord1.xyz.y; + #endif + float4 lerpResult3 = lerp( _Bottom , _Top , pow( saturate( ( staticSwitch13 * _mult ) ) , _pwer )); + + + finalColor = lerpResult3; + return finalColor; + } + ENDCG + } + } + CustomEditor "ASEMaterialInspector" + + +} +/*ASEBEGIN +Version=17900 +583;335;1337;674;1593.788;-18.25439;1;True;False +Node;AmplifyShaderEditor.ScreenPosInputsNode;2;-1169.49,131.1642;Float;False;0;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.PosVertexDataNode;11;-1161.67,307.9635;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.RangedFloatNode;7;-792.1788,414.5748;Inherit;False;Property;_mult;mult;2;0;Create;True;0;0;False;0;1;4.92;0;0;0;1;FLOAT;0 +Node;AmplifyShaderEditor.StaticSwitch;13;-889.7883,173.2544;Inherit;False;Property;_Screenspace;Screen space;4;0;Create;True;0;0;False;0;0;0;1;True;;Toggle;2;Key0;Key1;Create;True;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0 +Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-614.1788,236.5748;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 +Node;AmplifyShaderEditor.RangedFloatNode;10;-468.1788,419.5748;Inherit;False;Property;_pwer;pwer;3;0;Create;True;0;0;False;0;1;0.11;0;0;0;1;FLOAT;0 +Node;AmplifyShaderEditor.SaturateNode;9;-440.1788,230.5748;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 +Node;AmplifyShaderEditor.PowerNode;8;-272.1788,210.5748;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0 +Node;AmplifyShaderEditor.ColorNode;4;-608.5,-26.84821;Inherit;False;Property;_Top;Top;0;0;Create;True;0;0;False;0;1,1,1,0;1,0.8153982,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.ColorNode;5;-638.7576,-235.1903;Inherit;False;Property;_Bottom;Bottom;1;0;Create;True;0;0;False;0;0,0,0,0;0.009242773,1,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.LerpOp;3;-177.5,-1.5;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0 +Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;217,-21;Float;False;True;-1;2;ASEMaterialInspector;100;1;Skybox Gradient;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;0;False;-1;True;True;True;True;True;0;False;-1;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=Opaque=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;0 +WireConnection;13;1;11;2 +WireConnection;13;0;2;2 +WireConnection;6;0;13;0 +WireConnection;6;1;7;0 +WireConnection;9;0;6;0 +WireConnection;8;0;9;0 +WireConnection;8;1;10;0 +WireConnection;3;0;5;0 +WireConnection;3;1;4;0 +WireConnection;3;2;8;0 +WireConnection;1;0;3;0 +ASEEND*/ +//CHKSM=10A953E42BF3BDE16D41184C21492EC6476FED6F \ No newline at end of file diff --git a/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader.meta b/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader.meta new file mode 100644 index 0000000..4d63eb6 --- /dev/null +++ b/4D Engine Unity/Assets/Shaders/Skybox/Skybox Gradient.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 83bc7667c314e854dac5bee83506d664 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/4D Engine Unity/Packages/manifest.json b/4D Engine Unity/Packages/manifest.json new file mode 100644 index 0000000..8713807 --- /dev/null +++ b/4D Engine Unity/Packages/manifest.json @@ -0,0 +1,42 @@ +{ + "dependencies": { + "com.unity.collab-proxy": "2.2.0", + "com.unity.feature.development": "1.0.1", + "com.unity.mathematics": "1.2.6", + "com.unity.textmeshpro": "3.0.6", + "com.unity.timeline": "1.7.4", + "com.unity.ugui": "1.0.0", + "com.unity.visualscripting": "1.8.0", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/4D Engine Unity/Packages/packages-lock.json b/4D Engine Unity/Packages/packages-lock.json new file mode 100644 index 0000000..5440f37 --- /dev/null +++ b/4D Engine Unity/Packages/packages-lock.json @@ -0,0 +1,389 @@ +{ + "dependencies": { + "com.unity.collab-proxy": { + "version": "2.2.0", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.editorcoroutines": { + "version": "1.0.0", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.feature.development": { + "version": "1.0.1", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.ide.visualstudio": "2.0.18", + "com.unity.ide.rider": "3.0.21", + "com.unity.ide.vscode": "1.2.5", + "com.unity.editorcoroutines": "1.0.0", + "com.unity.performance.profile-analyzer": "1.2.2", + "com.unity.test-framework": "1.1.33", + "com.unity.testtools.codecoverage": "1.2.3" + } + }, + "com.unity.ide.rider": { + "version": "3.0.21", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.18", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.5", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.mathematics": { + "version": "1.2.6", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.performance.profile-analyzer": { + "version": "1.2.2", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.settings-manager": { + "version": "2.0.1", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.33", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.testtools.codecoverage": { + "version": "1.2.3", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.0.16", + "com.unity.settings-manager": "1.0.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.textmeshpro": { + "version": "3.0.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.timeline": { + "version": "1.7.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.visualscripting": { + "version": "1.8.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/4D Engine Unity/ProjectSettings/AudioManager.asset b/4D Engine Unity/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000..07ebfb0 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 1024 diff --git a/4D Engine Unity/ProjectSettings/ClusterInputManager.asset b/4D Engine Unity/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/4D Engine Unity/ProjectSettings/DynamicsManager.asset b/4D Engine Unity/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000..cdc1f3e --- /dev/null +++ b/4D Engine Unity/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0 + m_ClothInterCollisionStiffness: 0 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_DefaultMaxAngluarSpeed: 7 diff --git a/4D Engine Unity/ProjectSettings/EditorBuildSettings.asset b/4D Engine Unity/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000..0147887 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: [] + m_configObjects: {} diff --git a/4D Engine Unity/ProjectSettings/EditorSettings.asset b/4D Engine Unity/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000..1e44a0a --- /dev/null +++ b/4D Engine Unity/ProjectSettings/EditorSettings.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_ExternalVersionControlSupport: Visible Meta Files + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 0 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref + m_ProjectGenerationRootNamespace: + m_CollabEditorSettings: + inProgressEnabled: 1 + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_ShowLightmapResolutionOverlay: 1 + m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 1 diff --git a/4D Engine Unity/ProjectSettings/GraphicsSettings.asset b/4D Engine Unity/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000..43369e3 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,63 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 + m_AllowEnlightenSupportForUpgradedProject: 0 diff --git a/4D Engine Unity/ProjectSettings/InputManager.asset b/4D Engine Unity/ProjectSettings/InputManager.asset new file mode 100644 index 0000000..17c8f53 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/4D Engine Unity/ProjectSettings/MemorySettings.asset b/4D Engine Unity/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..5b5face --- /dev/null +++ b/4D Engine Unity/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/4D Engine Unity/ProjectSettings/NavMeshAreas.asset b/4D Engine Unity/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..3b0b7c3 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/4D Engine Unity/ProjectSettings/PackageManagerSettings.asset b/4D Engine Unity/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 0000000..112a053 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_Modified: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -830 + m_OriginalInstanceId: -832 + m_LoadAssets: 0 diff --git a/4D Engine Unity/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/4D Engine Unity/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json new file mode 100644 index 0000000..3c7b4c1 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -0,0 +1,5 @@ +{ + "m_Dictionary": { + "m_DictionaryValues": [] + } +} \ No newline at end of file diff --git a/4D Engine Unity/ProjectSettings/Physics2DSettings.asset b/4D Engine Unity/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000..47880b1 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 1 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/4D Engine Unity/ProjectSettings/PresetManager.asset b/4D Engine Unity/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..67a94da --- /dev/null +++ b/4D Engine Unity/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/4D Engine Unity/ProjectSettings/ProjectSettings.asset b/4D Engine Unity/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000..51bfd52 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,846 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 26 + productGUID: f664632d7697f2d4d9b55af832f7f920 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: 4D Engine Unity + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1920 + defaultScreenHeight: 1080 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_SpriteBatchVertexThreshold: 300 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 1 + androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 1 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 0 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchNVNGraphicsFirmwareMemory: 32 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 1 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + bundleVersion: 0.1 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + useHDRDisplay: 0 + hdrBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: {} + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 0 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 22 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 1 + strictShaderVariantMatching: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 12.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 12.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea + templatePackageId: com.unity.template.3d@8.1.1 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + m_BuildTargetBatching: + - m_BuildTarget: Standalone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: tvOS + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: Android + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: iPhone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: WebGL + m_StaticBatching: 0 + m_DynamicBatching: 0 + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 1 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 1 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 1 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 1 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 1 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 1 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 1 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 1 + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AppleTVSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: WebGLSupport + m_APIs: 0b000000 + m_Automatic: 1 + m_BuildTargetVRSettings: + - m_BuildTarget: Standalone + m_Enabled: 0 + m_Devices: + - Oculus + - OpenVR + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Android + m_EncodingQuality: 1 + - m_BuildTarget: iPhone + m_EncodingQuality: 1 + - m_BuildTarget: tvOS + m_EncodingQuality: 1 + m_BuildTargetGroupHDRCubemapEncodingQuality: + - m_BuildTarget: Android + m_EncodingQuality: 1 + - m_BuildTarget: iPhone + m_EncodingQuality: 1 + - m_BuildTarget: tvOS + m_EncodingQuality: 1 + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: + - m_BuildTarget: Android + m_Encoding: 1 + - m_BuildTarget: iPhone + m_Encoding: 1 + - m_BuildTarget: tvOS + m_Encoding: 1 + m_BuildTargetDefaultTextureCompressionFormat: + - m_BuildTarget: Android + m_Format: 3 + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 10.13.0 + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 1 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 16 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 + scriptingDefineSymbols: {} + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: {} + il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + managedStrippingLevel: + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + QNX: 1 + Stadia: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + selectedPlatform: 0 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 1 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: 4D Engine Unity + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: 4D Engine Unity + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: + UNet: 1 + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 1 + embeddedLinuxEnableGamepadInput: 1 + hmiLogStartupTiming: 0 + hmiCpuConfiguration: + apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 diff --git a/4D Engine Unity/ProjectSettings/ProjectVersion.txt b/4D Engine Unity/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..56ddb83 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2022.3.0f1 +m_EditorVersionWithRevision: 2022.3.0f1 (fb119bb0b476) diff --git a/4D Engine Unity/ProjectSettings/QualitySettings.asset b/4D Engine Unity/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000..7b7658d --- /dev/null +++ b/4D Engine Unity/ProjectSettings/QualitySettings.asset @@ -0,0 +1,232 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Lumin: 5 + Nintendo 3DS: 5 + Nintendo Switch: 5 + PS4: 5 + PSP2: 2 + Stadia: 5 + Standalone: 5 + WebGL: 3 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/4D Engine Unity/ProjectSettings/TagManager.asset b/4D Engine Unity/ProjectSettings/TagManager.asset new file mode 100644 index 0000000..1c92a78 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/4D Engine Unity/ProjectSettings/TimeManager.asset b/4D Engine Unity/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000..558a017 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/4D Engine Unity/ProjectSettings/UnityConnectSettings.asset b/4D Engine Unity/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..a88bee0 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/4D Engine Unity/ProjectSettings/VFXManager.asset b/4D Engine Unity/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000..3a95c98 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/VFXManager.asset @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/4D Engine Unity/ProjectSettings/VersionControlSettings.asset b/4D Engine Unity/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 0000000..dca2881 --- /dev/null +++ b/4D Engine Unity/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/4D Engine Unity/ProjectSettings/XRSettings.asset b/4D Engine Unity/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000..482590c --- /dev/null +++ b/4D Engine Unity/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file