├── .gitignore └── DualContouringGPU ├── Assets ├── Blue.mat ├── Blue.mat.meta ├── New Terrain.asset ├── New Terrain.asset.meta ├── Red.mat ├── Red.mat.meta ├── Resources.meta ├── Resources │ ├── ChunkMesh.prefab │ └── ChunkMesh.prefab.meta ├── Scripts.meta ├── Scripts │ ├── Chunk.cs │ ├── Chunk.cs.meta │ ├── ComputeVoxels.compute │ ├── ComputeVoxels.compute.meta │ ├── DensityFunctions.cs │ ├── DensityFunctions.cs.meta │ ├── MeshINfo.cs │ ├── MeshINfo.cs.meta │ ├── Octree.cs │ ├── Octree.cs.meta │ ├── PerlinNoise.cs │ ├── PerlinNoise.cs.meta │ ├── QEF.compute │ ├── QEF.compute.meta │ ├── QEF.cs │ ├── QEF.cs.meta │ ├── SVD.cs │ ├── SVD.cs.meta │ ├── SimplexNoiseGenerator.cs │ ├── SimplexNoiseGenerator.cs.meta │ ├── Test.cs │ ├── Test.cs.meta │ ├── ThreadedChunkLoading.cs │ └── ThreadedChunkLoading.cs.meta ├── Standard Assets.meta ├── Standard Assets │ ├── Characters.meta │ ├── Characters │ │ ├── FirstPersonCharacter.meta │ │ └── FirstPersonCharacter │ │ │ ├── Audio.meta │ │ │ ├── Audio │ │ │ ├── Footstep01.wav │ │ │ ├── Footstep01.wav.meta │ │ │ ├── Footstep02.wav │ │ │ ├── Footstep02.wav.meta │ │ │ ├── Footstep03.wav │ │ │ ├── Footstep03.wav.meta │ │ │ ├── Footstep04.wav │ │ │ ├── Footstep04.wav.meta │ │ │ ├── Jump.wav │ │ │ ├── Jump.wav.meta │ │ │ ├── Land.wav │ │ │ └── Land.wav.meta │ │ │ ├── FirstPersonCharacterGuidelines.txt │ │ │ ├── FirstPersonCharacterGuidelines.txt.meta │ │ │ ├── Prefabs.meta │ │ │ ├── Prefabs │ │ │ ├── FPSController.prefab │ │ │ ├── FPSController.prefab.meta │ │ │ ├── RigidBodyFPSController.prefab │ │ │ └── RigidBodyFPSController.prefab.meta │ │ │ ├── Scripts.meta │ │ │ └── Scripts │ │ │ ├── FirstPersonController.cs │ │ │ ├── FirstPersonController.cs.meta │ │ │ ├── HeadBob.cs │ │ │ ├── HeadBob.cs.meta │ │ │ ├── MouseLook.cs │ │ │ ├── MouseLook.cs.meta │ │ │ ├── RigidbodyFirstPersonController.cs │ │ │ └── RigidbodyFirstPersonController.cs.meta │ ├── CrossPlatformInput.meta │ ├── CrossPlatformInput │ │ ├── CrossPlatformInputGuidelines.txt │ │ ├── CrossPlatformInputGuidelines.txt.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── CarTiltControls.prefab │ │ │ ├── CarTiltControls.prefab.meta │ │ │ ├── DualTouchControls.prefab │ │ │ ├── DualTouchControls.prefab.meta │ │ │ ├── MobileAircraftControls.prefab │ │ │ ├── MobileAircraftControls.prefab.meta │ │ │ ├── MobileSingleStickControl.prefab │ │ │ ├── MobileSingleStickControl.prefab.meta │ │ │ ├── MobileTiltControlRig.prefab │ │ │ └── MobileTiltControlRig.prefab.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── AxisTouchButton.cs │ │ │ ├── AxisTouchButton.cs.meta │ │ │ ├── ButtonHandler.cs │ │ │ ├── ButtonHandler.cs.meta │ │ │ ├── CrossPlatformInputManager.cs │ │ │ ├── CrossPlatformInputManager.cs.meta │ │ │ ├── InputAxisScrollbar.cs │ │ │ ├── InputAxisScrollbar.cs.meta │ │ │ ├── Joystick.cs │ │ │ ├── Joystick.cs.meta │ │ │ ├── MobileControlRig.cs │ │ │ ├── MobileControlRig.cs.meta │ │ │ ├── PlatformSpecific.meta │ │ │ ├── PlatformSpecific │ │ │ │ ├── MobileInput.cs │ │ │ │ ├── MobileInput.cs.meta │ │ │ │ ├── StandaloneInput.cs │ │ │ │ └── StandaloneInput.cs.meta │ │ │ ├── TiltInput.cs │ │ │ ├── TiltInput.cs.meta │ │ │ ├── TouchPad.cs │ │ │ ├── TouchPad.cs.meta │ │ │ ├── VirtualInput.cs │ │ │ └── VirtualInput.cs.meta │ │ ├── Sprites.meta │ │ └── Sprites │ │ │ ├── ButtonAcceleratorOverSprite.png │ │ │ ├── ButtonAcceleratorOverSprite.png.meta │ │ │ ├── ButtonAcceleratorUpSprite.png │ │ │ ├── ButtonAcceleratorUpSprite.png.meta │ │ │ ├── ButtonArrowOverSprite.png │ │ │ ├── ButtonArrowOverSprite.png.meta │ │ │ ├── ButtonArrowUpSprite.png │ │ │ ├── ButtonArrowUpSprite.png.meta │ │ │ ├── ButtonBrakeOverSprite.png │ │ │ ├── ButtonBrakeOverSprite.png.meta │ │ │ ├── ButtonBrakeUpSprite.png │ │ │ ├── ButtonBrakeUpSprite.png.meta │ │ │ ├── ButtonCameraCycleUpSprite.png │ │ │ ├── ButtonCameraCycleUpSprite.png.meta │ │ │ ├── ButtonResetSprite.png │ │ │ ├── ButtonResetSprite.png.meta │ │ │ ├── ButtonSpacebarSprite.png │ │ │ ├── ButtonSpacebarSprite.png.meta │ │ │ ├── ButtonThumbstickOverSprite.png │ │ │ ├── ButtonThumbstickOverSprite.png.meta │ │ │ ├── ButtonThumbstickUpSprite.png │ │ │ ├── ButtonThumbstickUpSprite.png.meta │ │ │ ├── ButtonTimescaleFullUpSprite.png │ │ │ ├── ButtonTimescaleFullUpSprite.png.meta │ │ │ ├── ButtonTimescaleSlowUpSprite.png │ │ │ ├── ButtonTimescaleSlowUpSprite.png.meta │ │ │ ├── SliderBackgroundSprite.png │ │ │ ├── SliderBackgroundSprite.png.meta │ │ │ ├── SliderHandleSprite.png │ │ │ ├── SliderHandleSprite.png.meta │ │ │ ├── TouchpadSprite.png │ │ │ └── TouchpadSprite.png.meta │ ├── Environment.meta │ ├── Environment │ │ ├── TerrainAssets.meta │ │ └── TerrainAssets │ │ │ ├── BillboardTextures.meta │ │ │ ├── BillboardTextures │ │ │ ├── GrassFrond01AlbedoAlpha.psd │ │ │ ├── GrassFrond01AlbedoAlpha.psd.meta │ │ │ ├── GrassFrond02AlbedoAlpha.psd │ │ │ └── GrassFrond02AlbedoAlpha.psd.meta │ │ │ ├── SurfaceTextures.meta │ │ │ └── SurfaceTextures │ │ │ ├── CliffAlbedoSpecular.psd │ │ │ ├── CliffAlbedoSpecular.psd.meta │ │ │ ├── GrassHillAlbedo.psd │ │ │ ├── GrassHillAlbedo.psd.meta │ │ │ ├── GrassRockyAlbedo.psd │ │ │ ├── GrassRockyAlbedo.psd.meta │ │ │ ├── MudRockyAlbedoSpecular.bmp │ │ │ ├── MudRockyAlbedoSpecular.bmp.meta │ │ │ ├── MudRockyNormals.bmp │ │ │ ├── MudRockyNormals.bmp.meta │ │ │ ├── SandAlbedo.psd │ │ │ └── SandAlbedo.psd.meta │ ├── Utility.meta │ └── Utility │ │ ├── ActivateTrigger.cs │ │ ├── ActivateTrigger.cs.meta │ │ ├── AutoMobileShaderSwitch.cs │ │ ├── AutoMobileShaderSwitch.cs.meta │ │ ├── AutoMoveAndRotate.cs │ │ ├── AutoMoveAndRotate.cs.meta │ │ ├── CameraRefocus.cs │ │ ├── CameraRefocus.cs.meta │ │ ├── CurveControlledBob.cs │ │ ├── CurveControlledBob.cs.meta │ │ ├── DragRigidbody.cs │ │ ├── DragRigidbody.cs.meta │ │ ├── DynamicShadowSettings.cs │ │ ├── DynamicShadowSettings.cs.meta │ │ ├── FOVKick.cs │ │ ├── FOVKick.cs.meta │ │ ├── FPSCounter.cs │ │ ├── FPSCounter.cs.meta │ │ ├── FollowTarget.cs │ │ ├── FollowTarget.cs.meta │ │ ├── ForcedReset.cs │ │ ├── ForcedReset.cs.meta │ │ ├── LerpControlledBob.cs │ │ ├── LerpControlledBob.cs.meta │ │ ├── ObjectResetter.cs │ │ ├── ObjectResetter.cs.meta │ │ ├── ParticleSystemDestroyer.cs │ │ ├── ParticleSystemDestroyer.cs.meta │ │ ├── PlatformSpecificContent.cs │ │ ├── PlatformSpecificContent.cs.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ ├── FramerateCounter.prefab │ │ └── FramerateCounter.prefab.meta │ │ ├── SimpleActivatorMenu.cs │ │ ├── SimpleActivatorMenu.cs.meta │ │ ├── SimpleMouseRotator.cs │ │ ├── SimpleMouseRotator.cs.meta │ │ ├── SmoothFollow.cs │ │ ├── SmoothFollow.cs.meta │ │ ├── TimedObjectActivator.cs │ │ ├── TimedObjectActivator.cs.meta │ │ ├── TimedObjectDestructor.cs │ │ ├── TimedObjectDestructor.cs.meta │ │ ├── WaypointCircuit.cs │ │ ├── WaypointCircuit.cs.meta │ │ ├── WaypointProgressTracker.cs │ │ └── WaypointProgressTracker.cs.meta ├── TestShader.shader ├── TestShader.shader.meta ├── grassNormal.jpg ├── grassNormal.jpg.meta ├── testScene.unity └── testScene.unity.meta └── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt 22 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Blue.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Blue.mat -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 963d0abd8a6010849b18fa718cf3ce71 3 | timeCreated: 1432354608 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/New Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/New Terrain.asset -------------------------------------------------------------------------------- /DualContouringGPU/Assets/New Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51179c1fadfa04b42a01468bb991609a 3 | timeCreated: 1433873122 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Red.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Red.mat -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f843cb7ae939024088c9598b1725a04 3 | timeCreated: 1432354616 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c06a2f05f646d440bc8e3ef6abb6d39 3 | folderAsset: yes 4 | timeCreated: 1432402137 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Resources/ChunkMesh.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Resources/ChunkMesh.prefab -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Resources/ChunkMesh.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c751d69303c800478ccab50df19047b 3 | timeCreated: 1432402141 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03e6f1a74b412cf40a937592b7e8814e 3 | folderAsset: yes 4 | timeCreated: 1432316441 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/Chunk.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfae803fa4234f54094c30e641ff93d6 3 | timeCreated: 1432401715 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/ComputeVoxels.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc6af497b34a35e48a82b7262b544b74 3 | timeCreated: 1432497635 4 | licenseType: Free 5 | ComputeShaderImporter: 6 | currentBuildTarget: 5 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/DensityFunctions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | using Code.Noise; 5 | 6 | public class DensityFunctions 7 | { 8 | static float Sphere(Vector3 worldPosition, Vector3 origin, float radius) 9 | { 10 | return (worldPosition - origin).magnitude - radius; 11 | } 12 | 13 | static float Cuboid(Vector3 worldPosition, Vector3 origin, Vector3 halfDimensions) 14 | { 15 | Vector3 local_pos = worldPosition - origin; 16 | Vector3 pos = local_pos; 17 | 18 | Vector3 d = new Vector3(Mathf.Abs(pos.x), Mathf.Abs(pos.y), Mathf.Abs(pos.z)) - halfDimensions; 19 | float m = Mathf.Max(d.x, Mathf.Max(d.y, d.z)); 20 | return Mathf.Min(m, Vector3.Max(d, Vector3.zero).magnitude); 21 | } 22 | 23 | static float Torus(Vector3 worldPosition, Vector3 origin) 24 | { 25 | Vector3 local_pos = worldPosition - origin; 26 | float xt = local_pos.x; 27 | float yt = local_pos.y; 28 | float zt = local_pos.z; 29 | float _radius = 10.0f; 30 | float _radius2 = 2.33f; 31 | 32 | float x = xt; 33 | float y = yt; 34 | float z = zt; 35 | 36 | float x2 = Mathf.Sqrt(x * x + z * z) - _radius / 2.0f; 37 | float d = x2 * x2 + y * y - _radius2 * _radius2; 38 | 39 | return d; 40 | } 41 | 42 | static float Torus2(Vector3 worldPosition, Vector3 origin) 43 | { 44 | Vector3 local_pos = worldPosition - origin; 45 | float xt = local_pos.x; 46 | float yt = local_pos.y; 47 | float zt = local_pos.z; 48 | float _radius = 10.0f; 49 | float _radius2 = 2.33f; 50 | 51 | /*if (xt < origin.x - _radius * 3 || xt > origin.x + _radius * 3 || 52 | yt < origin.y - _radius * 3 || yt > origin.y + _radius * 3 || 53 | zt < origin.z - _radius * 3 || zt > origin.z + _radius * 3) 54 | return 0.01f;*/ 55 | 56 | float step = 11.0f; 57 | //double y = fmod((double) abs(yt), step) - step / 2.0f; 58 | float y = yt; 59 | 60 | double mod = Math.IEEERemainder(Math.Abs(zt), (double) step); 61 | float z1 = (float) mod; 62 | //float x1 = xt; 63 | float x2 = Mathf.Sqrt(xt * xt + z1 * z1) - _radius / 2.0f; 64 | float d = x2 * x2 + (y) * (y/* - cos(xt)*/) - _radius2 * _radius2; 65 | 66 | //double x = sqrt(xt * xt + zt * zt) - _radius / 2.0f; 67 | //double d = x * x + yt * yt - _radius2 * _radius2; 68 | return d; 69 | } 70 | 71 | static float Torus3(Vector3 worldPosition, Vector3 origin) 72 | { 73 | Vector3 local_pos = worldPosition - origin; 74 | float xt = local_pos.x; 75 | float yt = local_pos.y; 76 | float zt = local_pos.z; 77 | float _radius = 9.0f; 78 | float _radius2 = 2.33f; 79 | 80 | float step = 10.0f; 81 | //double y = fmod((double) abs(yt), step) - step / 2.0f; 82 | float y = yt; 83 | 84 | 85 | double mod = Math.IEEERemainder(Math.Abs(zt), (double) step); 86 | float z1 = (float) mod; 87 | mod = Math.IEEERemainder(Math.Abs(xt), (double) step); 88 | float x1 = (float) mod; 89 | float x2 = Mathf.Sqrt(x1 * x1 + z1 * z1) - _radius / 2.0f; 90 | float d = x2 * x2 + y * y - _radius2 * _radius2; 91 | return d; 92 | } 93 | 94 | public static float FractalNoise(int octaves, float frequency, float lacunarity, float persistence, Vector2 position) 95 | { 96 | float SCALE = 1.0f / 128.0f; 97 | Vector2 p = position * SCALE; 98 | float noise = 0.0f; 99 | 100 | float amplitude = 1.0f; 101 | p *= frequency; 102 | 103 | for (int i = 0; i < octaves; i++) 104 | { 105 | noise += Noise.Perlin(p.x, p.y) * amplitude; 106 | p *= lacunarity; 107 | amplitude *= persistence; 108 | } 109 | 110 | // move into [0, 1] range 111 | return 0.5f + (0.5f * noise); 112 | } 113 | 114 | public static float Density_Func(Vector3 worldPosition) 115 | { 116 | float MAX_HEIGHT = 64.0f; 117 | float noise = FractalNoise(4, 0.5343f, 2.2324f, 0.68324f, new Vector2(worldPosition.x, worldPosition.z)); 118 | float terrain = worldPosition.y - (MAX_HEIGHT * noise); 119 | //float terrain = worldPosition.y - (MAX_HEIGHT); 120 | 121 | //float cube = Cuboid(worldPosition, new Vector3(-4.0f, 20.0f, -4.0f), new Vector3(4.0f, 4.0f, 4.0f)); 122 | //float sphere = Sphere(worldPosition, new Vector3(15.0f, 2.5f, 1.0f), 10.0f); 123 | //float torus = Torus(worldPosition, new Vector3(0.0f, 9.5f, -4.0f)); 124 | //float torus2 = Torus2(worldPosition, new Vector3(0.0f, 5.0f, -4.0f)); 125 | 126 | //float torus2 = Torus3(worldPosition, new Vector3(0.0f, 2.0f, -4.0f)); 127 | float torus3 = Torus3(worldPosition, new Vector3(10.0f, 20.5f, 20.0f)); 128 | return Mathf.Max(-torus3, terrain); 129 | //return Mathf.Max(-torus2, Mathf.Max(-torus3, terrain)); 130 | //return terrain; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/DensityFunctions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1fdd54fbdced4444bcb6a15c86c7e15 3 | timeCreated: 1432316492 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/MeshINfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MeshINfo : MonoBehaviour 5 | { 6 | public int vertexCount = 0; 7 | public Vector3 chunkMin = Vector3.zero; 8 | // Use this for initialization 9 | void Start () { 10 | 11 | } 12 | 13 | // Update is called once per frame 14 | void Update () { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/MeshINfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2bb549efb0835a41a664b3e03f92e33 3 | timeCreated: 1433263754 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/Octree.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff6d78f075d36a2408595aed8c474f39 3 | timeCreated: 1432318700 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/PerlinNoise.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Code.Noise 4 | { 5 | public partial class Noise 6 | { 7 | #region static readonlys 8 | private static readonly Vector3[] Grad3 = { 9 | new Vector3(1,1,0), new Vector3(-1,1,0), new Vector3(1,-1,0), new Vector3(-1,-1,0), 10 | new Vector3(1,0,1), new Vector3(-1,0,1), new Vector3(1,0,-1), new Vector3(-1,0,-1), 11 | new Vector3(0,1,1), new Vector3(0,-1,1), new Vector3(0,1,-1), new Vector3(0,-1,-1) 12 | }; 13 | 14 | private static readonly int[] Perm = {151,160,137,91,90,15, 15 | 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 16 | 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 17 | 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, 18 | 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, 19 | 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, 20 | 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, 21 | 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, 22 | 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, 23 | 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, 24 | 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, 25 | 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 26 | 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180, 27 | 151,160,137,91,90,15, 28 | 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 29 | 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 30 | 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, 31 | 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, 32 | 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, 33 | 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, 34 | 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, 35 | 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, 36 | 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, 37 | 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, 38 | 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 39 | 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; 40 | 41 | //private static readonly int[] Perm = new int[512]; 42 | #endregion 43 | 44 | public static float Perlin(float x, float y) 45 | { 46 | var i = x > 0 ? (int)x : (int)x - 1; 47 | var j = y > 0 ? (int)y : (int)y - 1; 48 | 49 | x = x - i; 50 | y = y - j; 51 | 52 | i = i & 255; 53 | j = j & 255; 54 | 55 | var gll = Perm[i + Perm[j]] % 12; 56 | var glh = Perm[i + Perm[j + 1]] % 12; 57 | var ghl = Perm[i + 1 + Perm[j]] % 12; 58 | var ghh = Perm[i + 1 + Perm[j + 1]] % 12; 59 | 60 | var nll = Vector2.Dot(Grad3[gll], new Vector2(x, y)); 61 | var nlh = Vector2.Dot(Grad3[glh], new Vector2(x, y - 1)); 62 | var nhl = Vector2.Dot(Grad3[ghl], new Vector2(x - 1, y)); 63 | var nhh = Vector2.Dot(Grad3[ghh], new Vector2(x - 1, y - 1)); 64 | 65 | var u = (float)(x * x * x * (x * (x * 6 - 15) + 10)); 66 | var v = (float)(y * y * y * (y * (y * 6 - 15) + 10)); 67 | 68 | //var nyl = Mathf.Lerp(nll, nhl, u); 69 | var nyl = (1-u)*nll + u*nhl; 70 | //var nyh = Mathf.Lerp(nlh, nhh, u); 71 | var nyh = (1-u)*nlh + u*nhh; 72 | 73 | //var nxy = Mathf.Lerp(nyl, nyh, v); 74 | var nxy = (1-v)*nyl + v*nyh; 75 | 76 | return nxy; 77 | 78 | 79 | } 80 | 81 | public static float Perlin(float x, float y, float z) 82 | { 83 | var X = x > 0 ? (int)x : (int)x - 1; 84 | var Y = y > 0 ? (int)y : (int)y - 1; 85 | var Z = z > 0 ? (int)z : (int)z - 1; 86 | 87 | x = x - X; 88 | y = y - Y; 89 | z = z - Z; 90 | 91 | X = X & 255; 92 | Y = Y & 255; 93 | Z = Z & 255; 94 | 95 | var gi000 = Perm[X + Perm[Y + Perm[Z]]] % 12; 96 | var gi001 = Perm[X + Perm[Y + Perm[Z + 1]]] % 12; 97 | var gi010 = Perm[X + Perm[Y + 1 + Perm[Z]]] % 12; 98 | var gi011 = Perm[X + Perm[Y + 1 + Perm[Z + 1]]] % 12; 99 | var gi100 = Perm[X + 1 + Perm[Y + Perm[Z]]] % 12; 100 | var gi101 = Perm[X + 1 + Perm[Y + Perm[Z + 1]]] % 12; 101 | var gi110 = Perm[X + 1 + Perm[Y + 1 + Perm[Z]]] % 12; 102 | var gi111 = Perm[X + 1 + Perm[Y + 1 + Perm[Z + 1]]] % 12; 103 | 104 | 105 | //TODO: inline the dot products to speed up perlin noise 106 | var n000 = Vector2.Dot(Grad3[gi000], new Vector3( x, y, z)); 107 | var n100 = Vector2.Dot(Grad3[gi100], new Vector3(x - 1, y, z)); 108 | var n010 = Vector2.Dot(Grad3[gi010], new Vector3(x, y - 1, z)); 109 | var n110 = Vector2.Dot(Grad3[gi110], new Vector3(x - 1, y - 1, z)); 110 | var n001 = Vector2.Dot(Grad3[gi001], new Vector3( x, y, z - 1)); 111 | var n101 = Vector2.Dot(Grad3[gi101], new Vector3(x - 1, y, z - 1)); 112 | var n011 = Vector2.Dot(Grad3[gi011], new Vector3(x, y - 1, z - 1)); 113 | var n111 = Vector2.Dot(Grad3[gi111], new Vector3(x - 1, y - 1, z - 1)); 114 | 115 | var u = (float)(x * x * x * (x * (x * 6 - 15) + 10)); 116 | var v = (float)(y * y * y * (y * (y * 6 - 15) + 10)); 117 | var w = (float)(z * z * z * (z * (z * 6 - 15) + 10)); 118 | 119 | //TODO: inline lerps to speed up perlin noise 120 | var nx00 = Mathf.Lerp(n000, n100, u); 121 | var nx01 = Mathf.Lerp(n001, n101, u); 122 | var nx10 = Mathf.Lerp(n010, n110, u); 123 | var nx11 = Mathf.Lerp(n011, n111, u); 124 | 125 | var nxy0 = Mathf.Lerp(nx00, nx10, v); 126 | var nxy1 = Mathf.Lerp(nx01, nx11, v); 127 | 128 | 129 | var nxyz = Mathf.Lerp(nxy0, nxy1, w); 130 | 131 | return nxyz; 132 | 133 | 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/PerlinNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dc3ee0b5b1a46245aff5c006f507cb4 3 | timeCreated: 1432573009 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/QEF.compute: -------------------------------------------------------------------------------- 1 | #pragma kernel CSMain 2 | 3 | [numthreads(8,8,8)] 4 | void CSMain (int3 id : SV_DispatchThreadID) 5 | { 6 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/QEF.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45dcf2bb8e6490945a8d4fe44e413555 3 | timeCreated: 1433026726 4 | licenseType: Free 5 | ComputeShaderImporter: 6 | currentBuildTarget: 5 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/QEF.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class QefData 5 | { 6 | public float ata_00, ata_01, ata_02, ata_11, ata_12, ata_22; 7 | public float atb_x, atb_y, atb_z; 8 | public float btb; 9 | 10 | public float massPoint_x, massPoint_y, massPoint_z; 11 | public int numPoints; 12 | 13 | public QefData() 14 | { 15 | this.clear(); 16 | } 17 | 18 | public QefData(float ata_00, float ata_01, 19 | float ata_02, float ata_11, float ata_12, 20 | float ata_22, float atb_x, float atb_y, 21 | float atb_z, float btb, float massPoint_x, 22 | float massPoint_y, float massPoint_z, 23 | int numPoints) 24 | { 25 | this.set(ata_00, ata_01, ata_02, ata_11, ata_12, ata_22, atb_x, atb_y, 26 | atb_z, btb, massPoint_x, massPoint_y, massPoint_z, numPoints); 27 | } 28 | 29 | public QefData(QefData rhs) 30 | { 31 | this.set(rhs); 32 | } 33 | 34 | public void add(QefData rhs) 35 | { 36 | this.ata_00 += rhs.ata_00; 37 | this.ata_01 += rhs.ata_01; 38 | this.ata_02 += rhs.ata_02; 39 | this.ata_11 += rhs.ata_11; 40 | this.ata_12 += rhs.ata_12; 41 | this.ata_22 += rhs.ata_22; 42 | this.atb_x += rhs.atb_x; 43 | this.atb_y += rhs.atb_y; 44 | this.atb_y += rhs.atb_z; 45 | this.btb += rhs.btb; 46 | this.massPoint_x += rhs.massPoint_x; 47 | this.massPoint_y += rhs.massPoint_y; 48 | this.massPoint_z += rhs.massPoint_z; 49 | this.numPoints += rhs.numPoints; 50 | } 51 | 52 | public void clear() 53 | { 54 | this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 55 | } 56 | 57 | public void set(float ata_00, float ata_01, 58 | float ata_02, float ata_11, float ata_12, 59 | float ata_22, float atb_x, float atb_y, 60 | float atb_z, float btb, float massPoint_x, 61 | float massPoint_y, float massPoint_z, 62 | int numPoints) 63 | { 64 | this.ata_00 = ata_00; 65 | this.ata_01 = ata_01; 66 | this.ata_02 = ata_02; 67 | this.ata_11 = ata_11; 68 | this.ata_12 = ata_12; 69 | this.ata_22 = ata_22; 70 | this.atb_x = atb_x; 71 | this.atb_y = atb_y; 72 | this.atb_z = atb_z; 73 | this.btb = btb; 74 | this.massPoint_x = massPoint_x; 75 | this.massPoint_y = massPoint_y; 76 | this.massPoint_z = massPoint_z; 77 | this.numPoints = numPoints; 78 | } 79 | 80 | public void set(QefData rhs) 81 | { 82 | this.set(rhs.ata_00, rhs.ata_01, rhs.ata_02, rhs.ata_11, rhs.ata_12, 83 | rhs.ata_22, rhs.atb_x, rhs.atb_y, rhs.atb_z, rhs.btb, 84 | rhs.massPoint_x, rhs.massPoint_y, rhs.massPoint_z, 85 | rhs.numPoints); 86 | } 87 | } 88 | 89 | public class QefSolver 90 | { 91 | private QefData data; 92 | private SMat3 ata; 93 | private Vec3 atb, massPoint, x; 94 | private bool hasSolution; 95 | 96 | public QefSolver() 97 | { 98 | data = new QefData(); 99 | ata = new SMat3(); 100 | atb = new Vec3(); 101 | massPoint = new Vec3(); 102 | x = new Vec3(); 103 | hasSolution = false; 104 | } 105 | 106 | private static void normalize(out float nx, out float ny, out float nz, float ix, float iy, float iz) 107 | { 108 | Vec3 tmpv = new Vec3(ix, iy, iz); 109 | VecUtils.normalize(out tmpv, tmpv); 110 | nx = tmpv.x; 111 | ny = tmpv.y; 112 | nz = tmpv.z; 113 | } 114 | 115 | public Vec3 getMassPoint() { return massPoint; } 116 | 117 | public void add(float px, float py, float pz, 118 | float nx, float ny, float nz) 119 | { 120 | this.hasSolution = false; 121 | normalize(out nx, out ny, out nz, nx, ny, nz); 122 | this.data.ata_00 += nx * nx; 123 | this.data.ata_01 += nx * ny; 124 | this.data.ata_02 += nx * nz; 125 | this.data.ata_11 += ny * ny; 126 | this.data.ata_12 += ny * nz; 127 | this.data.ata_22 += nz * nz; 128 | 129 | float dot = nx * px + ny * py + nz * pz; 130 | this.data.atb_x += dot * nx; 131 | this.data.atb_y += dot * ny; 132 | this.data.atb_z += dot * nz; 133 | this.data.btb += dot * dot; 134 | this.data.massPoint_x += px; 135 | this.data.massPoint_y += py; 136 | this.data.massPoint_z += pz; 137 | ++this.data.numPoints; 138 | } 139 | 140 | public void add(Vec3 p, Vec3 n) 141 | { 142 | this.add(p.x, p.y, p.z, n.x, n.y, n.z); 143 | } 144 | 145 | public void add(QefData rhs) 146 | { 147 | this.hasSolution = false; 148 | this.data.add(rhs); 149 | } 150 | 151 | public QefData getData() 152 | { 153 | return data; 154 | } 155 | 156 | public float getError() 157 | { 158 | if (!this.hasSolution) 159 | { 160 | throw new UnityException("Illegal state"); 161 | } 162 | 163 | return this.getError(this.x); 164 | } 165 | 166 | public float getError(Vec3 pos) 167 | { 168 | if (!this.hasSolution) 169 | { 170 | this.setAta(); 171 | this.setAtb(); 172 | } 173 | 174 | Vec3 atax; 175 | MatUtils.vmul_symmetric(out atax, this.ata, pos); 176 | return VecUtils.dot(pos, atax) - 2.0f * VecUtils.dot(pos, this.atb) 177 | + this.data.btb; 178 | } 179 | 180 | public void reset() 181 | { 182 | this.hasSolution = false; 183 | this.data.clear(); 184 | } 185 | 186 | public float solve(out Vec3 outx, float svd_tol, 187 | int svd_sweeps, float pinv_tol) 188 | { 189 | if (this.data.numPoints == 0) 190 | { 191 | throw new UnityException("..."); 192 | } 193 | 194 | this.massPoint.set(this.data.massPoint_x, this.data.massPoint_y, this.data.massPoint_z); 195 | VecUtils.scale(out this.massPoint, 1.0f / this.data.numPoints, this.massPoint); 196 | 197 | this.setAta(); 198 | this.setAtb(); 199 | 200 | Vec3 tmpv; 201 | MatUtils.vmul_symmetric(out tmpv, this.ata, this.massPoint); 202 | VecUtils.sub(out this.atb, this.atb, tmpv); 203 | 204 | this.x.clear(); 205 | float result = Svd.solveSymmetric(this.ata, this.atb, out this.x, 206 | svd_tol, svd_sweeps, pinv_tol); 207 | VecUtils.addScaled(out this.x, 1.0f, this.massPoint); 208 | 209 | this.setAtb(); 210 | outx = x; 211 | this.hasSolution = true; 212 | return result; 213 | } 214 | 215 | private void setAta() 216 | { 217 | this.ata.setSymmetric(this.data.ata_00, this.data.ata_01, 218 | this.data.ata_02, this.data.ata_11, 219 | this.data.ata_12, this.data.ata_22); 220 | } 221 | 222 | private void setAtb() 223 | { 224 | this.atb.set(this.data.atb_x, this.data.atb_y, this.data.atb_z); 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/QEF.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0cf26d936e803e489cb88ccb43a238c 3 | timeCreated: 1432319111 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/SVD.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5344155d6c7647458109d88dd401156 3 | timeCreated: 1432323847 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/SimplexNoiseGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23021eaa70c366d40a368109fef3f40a 3 | timeCreated: 1432318083 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/Test.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e8403f1af128ca47adb46a06461e291 3 | timeCreated: 1432352903 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/ThreadedChunkLoading.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | using System.Threading; 5 | using System.Collections.Generic; 6 | 7 | public class ThreadedJob 8 | { 9 | private bool m_IsDone = false; 10 | protected object m_Handle = new object(); 11 | protected Thread m_Thread = null; 12 | 13 | 14 | public bool isDone 15 | { 16 | get 17 | { 18 | bool tmp; 19 | lock(m_Handle) 20 | { 21 | tmp = m_IsDone; 22 | } 23 | return tmp; 24 | } 25 | set 26 | { 27 | lock(m_Handle) 28 | { 29 | m_IsDone = value; 30 | } 31 | } 32 | } 33 | 34 | 35 | public virtual void Start() 36 | { 37 | m_Thread = new Thread(Run); 38 | m_Thread.Start(); 39 | } 40 | 41 | public virtual void Abort() 42 | { 43 | m_Thread.Abort(); 44 | } 45 | 46 | protected virtual void ThreadFunction() { } 47 | 48 | protected virtual void OnFinished() { } 49 | 50 | public virtual bool Update() 51 | { 52 | 53 | if (isDone) 54 | { 55 | OnFinished(); 56 | return true; 57 | } 58 | 59 | return false; 60 | } 61 | 62 | private void Run() 63 | { 64 | ThreadFunction(); 65 | isDone = true; 66 | } 67 | } 68 | 69 | public class ThreadedChunkLoader : ThreadedJob 70 | { 71 | private int i_Count = 0; 72 | private Vector3[] i_VoxMins = null; 73 | private uint[] i_VoxMaterials = null; 74 | private Octree.GPUVOX[] i_Voxs = null; 75 | private Octree i_Tree = null; 76 | private Vector3 i_Min = Vector3.zero; 77 | private int i_Size = 0; 78 | 79 | private Test m_Test; 80 | 81 | public OctreeNode m_Root = null; 82 | public List m_Vertices; 83 | public List m_Normals; 84 | public List m_Indices; 85 | 86 | private bool updatingChunk; 87 | private Chunk chunkToUpdate; 88 | 89 | 90 | public ThreadedChunkLoader(Test test) 91 | { 92 | chunkToUpdate = null; 93 | updatingChunk = false; 94 | m_Test = test; 95 | m_Vertices = new List(); 96 | m_Normals = new List(); 97 | m_Indices = new List(); 98 | } 99 | 100 | public void setData(Octree tree, int count, Vector3[] voxMins, uint[] voxMats, Octree.GPUVOX[] voxs, Vector3 min, int octreeSize) 101 | { 102 | i_Tree = tree; 103 | i_Count = count; 104 | i_VoxMins = voxMins; 105 | i_VoxMaterials = voxMats; 106 | i_Voxs = voxs; 107 | i_Min = min; 108 | i_Size = octreeSize; 109 | } 110 | 111 | public void setChunkForUpdate(Chunk chunk) 112 | { 113 | chunkToUpdate = chunk; 114 | updatingChunk = true; 115 | } 116 | 117 | protected override void ThreadFunction() 118 | { 119 | if (i_Tree != null && i_Count > 0 && i_VoxMins.Length > 0 && i_VoxMaterials.Length > 0 && i_Voxs.Length > 0 && i_Size != 0) 120 | { 121 | 122 | List computedVoxels = new List(); 123 | 124 | 125 | int HIGHEST_VOXEL_RES = 64; 126 | int voxelSize = HIGHEST_VOXEL_RES / i_Size; 127 | for (int i = 0; i < i_Count; i++) 128 | { 129 | if (i_Voxs[i].numPoints != 0) 130 | { 131 | OctreeNode leaf = new OctreeNode(); 132 | leaf.type = OctreeNodeType.Node_Leaf; 133 | leaf.size = voxelSize; 134 | OctreeDrawInfo drawInfo = new OctreeDrawInfo(); 135 | drawInfo.position = i_Voxs[i].vertPoint; 136 | drawInfo.averageNormal = i_Voxs[i].avgNormal; 137 | drawInfo.corners = (int) i_VoxMaterials[i]; 138 | leaf.drawInfo = drawInfo; 139 | leaf.min = i_VoxMins[i]; 140 | computedVoxels.Add(leaf); 141 | } 142 | } 143 | 144 | //Debug.Log(computedVoxels.Count); 145 | 146 | if (computedVoxels.Count > 0) 147 | { 148 | if (updatingChunk && chunkToUpdate != null) 149 | chunkToUpdate.DestroyOctree(); 150 | m_Root = i_Tree.ConstructUpwards(computedVoxels, i_Min, HIGHEST_VOXEL_RES); 151 | if (m_Root != null) 152 | { 153 | i_Tree.GenerateMeshFromOctree(m_Root, m_Vertices, m_Normals, m_Indices, voxelSize); 154 | } 155 | } 156 | 157 | //m_Vertices.TrimExcess(); 158 | //m_Normals.TrimExcess(); 159 | //m_Indices.TrimExcess(); 160 | 161 | computedVoxels.Clear(); 162 | computedVoxels = null; 163 | 164 | i_Min = Vector3.zero; 165 | i_Size = 0; 166 | i_Count = 0; 167 | i_Tree = null; 168 | //Array.Clear(i_VoxMins, 0, i_VoxMins.Length); 169 | i_VoxMins = null; 170 | //Array.Clear(i_VoxMaterials, 0, i_VoxMaterials.Length); 171 | i_VoxMaterials = null; 172 | //Array.Clear(i_Voxs, 0, i_Voxs.Length); 173 | i_Voxs = null; 174 | 175 | //Debug.Log ("Finished loading chunk"); 176 | 177 | if (!updatingChunk) 178 | m_Test.informGame(); 179 | 180 | if (updatingChunk) 181 | { 182 | m_Test.informGame(chunkToUpdate); 183 | chunkToUpdate = null; 184 | updatingChunk = false; 185 | } 186 | 187 | } 188 | } 189 | 190 | protected override void OnFinished() 191 | { 192 | Debug.Log ("Finished"); 193 | } 194 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Scripts/ThreadedChunkLoading.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 167645c77ec53ba4bad97a91695a4689 3 | timeCreated: 1432933528 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d11359bf2260fdf4c9b85f7f270ea349 3 | folderAsset: yes 4 | timeCreated: 1432354346 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c32f58513a41ef4dab9cb7704c5fb92 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 943e057eaae705e43b9e9b2e53d6adb0 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dac79461900e0f4c93561031c2e6902 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep01.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42e65e088b3f4374e851b8dbd38f3df9 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep02.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bc94ec6ed537e743b481638bdcd503d 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep03.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a9383dda6cabc047b7a297602e93eb4 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Footstep04.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9714160ce34f2b4ab63ff8c27bd68e1 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Jump.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5897aeed9b676024fbb8c694b421a861 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Audio/Land.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b09d59f4499d45428baa7a21e954296 3 | AudioImporter: 4 | serializedVersion: 5 5 | format: -1 6 | loadType: 1 7 | quality: -1 8 | sampleRate: 0 9 | forceToMono: 0 10 | preloadAudioData: 1 11 | loadInBackground: 0 12 | overrideSampleRate: 0 13 | optimizeSampleRate: 0 14 | 3D: 1 15 | userData: 16 | assetBundleName: 17 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt: -------------------------------------------------------------------------------- 1 | The first-person character is a single prefab which is designed to be used as-is. There's usually no need to create your own from the separate scripts provided. Just drop the prefab into your scene and you're good to go. 2 | 3 | 4 | The simplest way to get started with the First Person Character is to follow these steps: 5 | 6 | 1) Start with a suitable scene. There ought to be enough flat ground to walk around on. 7 | 8 | 2) Place the "FirstPersonCharacter" prefab in the scene. 9 | 10 | 3) If present, delete the "Main Camera" that exists in new scenes by default. The First Person Character prefab contains its own camera, so you don't need the default camera, or any of the camera rigs to use it. 11 | 12 | The first-person character is made up of a few components acting together. The FirstPersonCharacter script provides the functionality of moving, strafing and jumping. The SimpleMouseRotator provides the functionality of turning the body of the character left and right, and another copy of the same script on the "FirstPersonCamera" controls the looking-up-and-down effect. 13 | 14 | There is also an optional "Head Bob" script which provides a head bobbing effect and optionally also plays footstep sounds in sync with the head bobbing. This script can be disabled or removed if required. 15 | 16 | There are a number of simple adjustable settings on each component allowing you to change the movement speed, jump power, head bob style, and more. For more detail about each setting, see the comments in each script. 17 | 18 | The Character script also requires references to "zero friction" and "max friction" physics materials. These are provided already set-up for you. 19 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/FirstPersonCharacterGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc9b000e9b8028247bd816e159382646 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bfb2599080d5d24e84362b4ae314ae7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/FPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e9e851c0e142814dac026a256ba2ac0 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100004 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 20: {fileID: 2000000} 12 | - 81: {fileID: 8100000} 13 | - 114: {fileID: 11400006} 14 | m_Layer: 0 15 | m_Name: MainCamera 16 | m_TagString: MainCamera 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1 &100006 22 | GameObject: 23 | m_ObjectHideFlags: 0 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | serializedVersion: 4 27 | m_Component: 28 | - 4: {fileID: 400002} 29 | - 54: {fileID: 5400000} 30 | - 136: {fileID: 13600000} 31 | - 114: {fileID: 11400004} 32 | m_Layer: 0 33 | m_Name: RigidBodyFPSController 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!4 &400000 40 | Transform: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 100004} 45 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 46 | m_LocalPosition: {x: 0, y: .600000024, z: 0} 47 | m_LocalScale: {x: 1, y: 1, z: 1} 48 | m_Children: [] 49 | m_Father: {fileID: 400002} 50 | m_RootOrder: 0 51 | --- !u!4 &400002 52 | Transform: 53 | m_ObjectHideFlags: 1 54 | m_PrefabParentObject: {fileID: 0} 55 | m_PrefabInternal: {fileID: 100100000} 56 | m_GameObject: {fileID: 100006} 57 | m_LocalRotation: {x: 0, y: 1, z: 0, w: -1.62920685e-07} 58 | m_LocalPosition: {x: -30, y: 1, z: 25} 59 | m_LocalScale: {x: 1, y: 1, z: 1} 60 | m_Children: 61 | - {fileID: 400000} 62 | m_Father: {fileID: 0} 63 | m_RootOrder: 0 64 | --- !u!20 &2000000 65 | Camera: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100004} 70 | m_Enabled: 1 71 | serializedVersion: 2 72 | m_ClearFlags: 1 73 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 74 | m_NormalizedViewPortRect: 75 | serializedVersion: 2 76 | x: 0 77 | y: 0 78 | width: 1 79 | height: 1 80 | near clip plane: .300000012 81 | far clip plane: 1000 82 | field of view: 60 83 | orthographic: 0 84 | orthographic size: 5 85 | m_Depth: 0 86 | m_CullingMask: 87 | serializedVersion: 2 88 | m_Bits: 4294967295 89 | m_RenderingPath: -1 90 | m_TargetTexture: {fileID: 0} 91 | m_TargetDisplay: 0 92 | m_HDR: 0 93 | m_OcclusionCulling: 1 94 | m_StereoConvergence: 10 95 | m_StereoSeparation: .0219999999 96 | --- !u!54 &5400000 97 | Rigidbody: 98 | m_ObjectHideFlags: 1 99 | m_PrefabParentObject: {fileID: 0} 100 | m_PrefabInternal: {fileID: 100100000} 101 | m_GameObject: {fileID: 100006} 102 | serializedVersion: 2 103 | m_Mass: 10 104 | m_Drag: 0 105 | m_AngularDrag: .0500000007 106 | m_UseGravity: 1 107 | m_IsKinematic: 0 108 | m_Interpolate: 0 109 | m_Constraints: 112 110 | m_CollisionDetection: 0 111 | --- !u!81 &8100000 112 | AudioListener: 113 | m_ObjectHideFlags: 1 114 | m_PrefabParentObject: {fileID: 0} 115 | m_PrefabInternal: {fileID: 100100000} 116 | m_GameObject: {fileID: 100004} 117 | m_Enabled: 1 118 | --- !u!114 &11400004 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 1 121 | m_PrefabParentObject: {fileID: 0} 122 | m_PrefabInternal: {fileID: 100100000} 123 | m_GameObject: {fileID: 100006} 124 | m_Enabled: 1 125 | m_EditorHideFlags: 0 126 | m_Script: {fileID: 11500000, guid: 81c9795a96c094f4cbde4d65546aa9b2, type: 3} 127 | m_Name: 128 | m_EditorClassIdentifier: 129 | cam: {fileID: 2000000} 130 | movementSettings: 131 | ForwardSpeed: 8 132 | BackwardSpeed: 4 133 | StrafeSpeed: 4 134 | RunMultiplier: 2 135 | RunKey: 304 136 | JumpForce: 50 137 | SlopeCurveModifier: 138 | serializedVersion: 2 139 | m_Curve: 140 | - time: -90 141 | value: 1 142 | inSlope: 0 143 | outSlope: 0 144 | tangentMode: 0 145 | - time: 0 146 | value: 1 147 | inSlope: 0 148 | outSlope: 0 149 | tangentMode: 0 150 | - time: 90 151 | value: 0 152 | inSlope: 0 153 | outSlope: 0 154 | tangentMode: 0 155 | m_PreInfinity: 2 156 | m_PostInfinity: 2 157 | CurrentTargetSpeed: 8 158 | mouseLook: 159 | XSensitivity: 2 160 | YSensitivity: 2 161 | clampVerticalRotation: 1 162 | MinimumX: -45 163 | MaximumX: 90 164 | smooth: 1 165 | smoothTime: 18 166 | advancedSettings: 167 | groundCheckDistance: .100000001 168 | stickToGroundHelperDistance: .600000024 169 | slowDownRate: 20 170 | airControl: 0 171 | --- !u!114 &11400006 172 | MonoBehaviour: 173 | m_ObjectHideFlags: 1 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 100100000} 176 | m_GameObject: {fileID: 100004} 177 | m_Enabled: 1 178 | m_EditorHideFlags: 0 179 | m_Script: {fileID: 11500000, guid: 83c81407209f85e4c87c0cda8b32868e, type: 3} 180 | m_Name: 181 | m_EditorClassIdentifier: 182 | Camera: {fileID: 2000000} 183 | motionBob: 184 | HorizontalBobRange: .100000001 185 | VerticalBobRange: .0500000007 186 | Bobcurve: 187 | serializedVersion: 2 188 | m_Curve: 189 | - time: 0 190 | value: 0 191 | inSlope: 0 192 | outSlope: 0 193 | tangentMode: 0 194 | - time: .5 195 | value: 1 196 | inSlope: 0 197 | outSlope: 0 198 | tangentMode: 0 199 | - time: 1 200 | value: 0 201 | inSlope: 0 202 | outSlope: 0 203 | tangentMode: 0 204 | - time: 1.5 205 | value: -1 206 | inSlope: 0 207 | outSlope: 0 208 | tangentMode: 0 209 | - time: 2 210 | value: 0 211 | inSlope: 0 212 | outSlope: 0 213 | tangentMode: 0 214 | m_PreInfinity: 2 215 | m_PostInfinity: 2 216 | VerticaltoHorizontalRatio: 2 217 | jumpAndLandingBob: 218 | BobDuration: .150000006 219 | BobAmount: .200000003 220 | rigidbodyFirstPersonController: {fileID: 11400004} 221 | StrideInterval: 4 222 | RunningStrideLengthen: .722000003 223 | --- !u!136 &13600000 224 | CapsuleCollider: 225 | m_ObjectHideFlags: 1 226 | m_PrefabParentObject: {fileID: 0} 227 | m_PrefabInternal: {fileID: 100100000} 228 | m_GameObject: {fileID: 100006} 229 | m_Material: {fileID: 13400000, guid: cf63880488ec29f43a759ecd9c6c5123, type: 2} 230 | m_IsTrigger: 0 231 | m_Enabled: 1 232 | m_Radius: .5 233 | m_Height: 1.60000002 234 | m_Direction: 1 235 | m_Center: {x: 0, y: 0, z: 0} 236 | --- !u!1001 &100100000 237 | Prefab: 238 | m_ObjectHideFlags: 1 239 | serializedVersion: 2 240 | m_Modification: 241 | m_TransformParent: {fileID: 0} 242 | m_Modifications: [] 243 | m_RemovedComponents: [] 244 | m_ParentPrefab: {fileID: 0} 245 | m_RootGameObject: {fileID: 100006} 246 | m_IsPrefabParent: 1 247 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6453f8e1f814744d8b94e5a6d1f9942 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 314f49b24dc9d5d40956a7b28c67b237 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/FirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05ec5cf00ca181d45a42ba1870e148c3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.Utility; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | public class HeadBob : MonoBehaviour 8 | { 9 | public Camera Camera; 10 | public CurveControlledBob motionBob = new CurveControlledBob(); 11 | public LerpControlledBob jumpAndLandingBob = new LerpControlledBob(); 12 | public RigidbodyFirstPersonController rigidbodyFirstPersonController; 13 | public float StrideInterval; 14 | [Range(0f, 1f)] public float RunningStrideLengthen; 15 | 16 | // private CameraRefocus m_CameraRefocus; 17 | private bool m_PreviouslyGrounded; 18 | private Vector3 m_OriginalCameraPosition; 19 | 20 | 21 | private void Start() 22 | { 23 | motionBob.Setup(Camera, StrideInterval); 24 | m_OriginalCameraPosition = Camera.transform.localPosition; 25 | // m_CameraRefocus = new CameraRefocus(Camera, transform.root.transform, Camera.transform.localPosition); 26 | } 27 | 28 | 29 | private void Update() 30 | { 31 | // m_CameraRefocus.GetFocusPoint(); 32 | Vector3 newCameraPosition; 33 | if (rigidbodyFirstPersonController.Velocity.magnitude > 0 && rigidbodyFirstPersonController.Grounded) 34 | { 35 | Camera.transform.localPosition = motionBob.DoHeadBob(rigidbodyFirstPersonController.Velocity.magnitude*(rigidbodyFirstPersonController.Running ? RunningStrideLengthen : 1f)); 36 | newCameraPosition = Camera.transform.localPosition; 37 | newCameraPosition.y = Camera.transform.localPosition.y - jumpAndLandingBob.Offset(); 38 | } 39 | else 40 | { 41 | newCameraPosition = Camera.transform.localPosition; 42 | newCameraPosition.y = m_OriginalCameraPosition.y - jumpAndLandingBob.Offset(); 43 | } 44 | Camera.transform.localPosition = newCameraPosition; 45 | 46 | if (!m_PreviouslyGrounded && rigidbodyFirstPersonController.Grounded) 47 | { 48 | StartCoroutine(jumpAndLandingBob.DoBobCycle()); 49 | } 50 | 51 | m_PreviouslyGrounded = rigidbodyFirstPersonController.Grounded; 52 | // m_CameraRefocus.SetFocusPoint(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/HeadBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83c81407209f85e4c87c0cda8b32868e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Characters.FirstPerson 6 | { 7 | [Serializable] 8 | public class MouseLook 9 | { 10 | public float XSensitivity = 2f; 11 | public float YSensitivity = 2f; 12 | public bool clampVerticalRotation = true; 13 | public float MinimumX = -90F; 14 | public float MaximumX = 90F; 15 | public bool smooth; 16 | public float smoothTime = 5f; 17 | 18 | 19 | private Quaternion m_CharacterTargetRot; 20 | private Quaternion m_CameraTargetRot; 21 | 22 | 23 | public void Init(Transform character, Transform camera) 24 | { 25 | m_CharacterTargetRot = character.localRotation; 26 | m_CameraTargetRot = camera.localRotation; 27 | } 28 | 29 | 30 | public void LookRotation(Transform character, Transform camera) 31 | { 32 | float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity; 33 | float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity; 34 | 35 | m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); 36 | m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); 37 | 38 | if(clampVerticalRotation) 39 | m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); 40 | 41 | if(smooth) 42 | { 43 | character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, 44 | smoothTime * Time.deltaTime); 45 | camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, 46 | smoothTime * Time.deltaTime); 47 | } 48 | else 49 | { 50 | character.localRotation = m_CharacterTargetRot; 51 | camera.localRotation = m_CameraTargetRot; 52 | } 53 | } 54 | 55 | 56 | Quaternion ClampRotationAroundXAxis(Quaternion q) 57 | { 58 | q.x /= q.w; 59 | q.y /= q.w; 60 | q.z /= q.w; 61 | q.w = 1.0f; 62 | 63 | float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); 64 | 65 | angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); 66 | 67 | q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); 68 | 69 | return q; 70 | } 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37e60a97f2c87ae41b6cdc1055d78cb9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81c9795a96c094f4cbde4d65546aa9b2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb6d0d11aa24844488ea026462c8b6aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt: -------------------------------------------------------------------------------- 1 | 2 | Importing the CrossPlatformInput package adds a menu item to Unity, "CrossPlatformInput", which allows you to enable or disable the CrossPlatformInput in the editor. You must enable the CrossPlatformInput in order to see the control rigs in the editor, and to start using Unity Remote to control your game. 3 | 4 | The CrossPlatformInput sample assets contains two main sections. 5 | 6 | 1) The folder of prefabs provide a variety of ready-to-use "MobileControlRigs". Each control rig is suitable for a different purpose, and each implements the touch or tilt-based equivalent of some of the default standalone axes or buttons. These are ready to drop into your scene, and to use them you simply need to read the axes via the CrossPlatformInput class, rather than Unity's regular Input class. 7 | 8 | 2) The set of scripts provided are the scripts we used to put together the control rigs prefabs. They provide a simplified way of reading basic mobile input, such as tilt, taps and swipe gestures. They are designed so that various mobile controls can be read in the same way as regular Unity axes and buttons. You can use these scripts to build your own MobileControlRigs. 9 | 10 | 11 | 12 | For example the Car control rig feeds the tilt input of the mobile device to the "Horizontal" axis, and has an accelerator and brake touch button which are fed as a pair into the "Vertical" axis. These are virtual equivalents of the real "Horizontal" and "Vertical" axes defined in Unity's Input Manager. 13 | 14 | Therefore when you read CrossPlatformInput.GetAxis("Horizontal"), you will either get the "real" input value - if your build target is non-mobile, or the value from the mobile control rig - if your build target is set to a mobile platform. 15 | 16 | The CrossPlatformInput scripts and prefabs are provided together as an example of how you can implement a cross-platform control solution in Unity. They also allow us to provide our other sample scenes in a form that can be published as standalone or to mobile targets with no modification. 17 | 18 | To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your scene (or create your own), and then make calls to CrossPlatformInput functions, referring to the axes and buttons that the Rig implements. 19 | 20 | When reading input from the CrossPlatformInput class, the values returned will be taken either from Unity's Input Manager settings, or from the mobile-specific controls set up, depending on which build target you have selected. 21 | 22 | The CrossPlatformInput class is designed to be called instead of Unity's own Input class, and so mirrors certain parts of the Input API - specifically the functions relating to Axes and Buttons: 23 | GetAxis, GetAxisRaw 24 | GetButton, GetButtonDown, GetButtonUp 25 | 26 | Notes for coders: 27 | This package sets two compiler define symbols. One is always set automatically, the other is optionally set from a menu item. 28 | 29 | Importing the "CrossPlatformInput" package will automatically add a compiler define symbol, "CROSS_PLATFORM_INPUT". This enables the CrossPlatformInput functions defined in some of the other Sample Asset packages (such as the Characters, Planes, etc). Without this symbol defined, those packages use Unity's regular Input class, which means they can be imported alone and still work without the CrossPlatformInput package. 30 | 31 | The optional define (which is set by default, but can be disabled using the "Mobile Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active when a mobile build target is selected. It also enables certain mobile-specific control nuances in some of the packages, which make more sense when the character or vehicle is being controlled using mobile input (such as auto-leveling the character's look direction). This define is optional because some developers prefer to use standalone input methods instead of the Unity Remote app, when testing mobile apps in the editor's play mode. 32 | 33 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b997593a4f12c4c991490593f3b513 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f030ca9293dfc164c8bc07b982e19f38 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/CarTiltControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174090ae7f9eff84abe76f0ff062efac 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/DualTouchControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2169821f0567671499a5c10104c69c24 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileAircraftControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3369231b1ed7ad34e84d9240a571db81 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileSingleStickControl.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9529ecc3d479da5499993355e6c2cb4f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400004} 12 | m_Layer: 0 13 | m_Name: MobileTiltControlRig 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!1 &100002 20 | GameObject: 21 | m_ObjectHideFlags: 0 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | serializedVersion: 4 25 | m_Component: 26 | - 4: {fileID: 400002} 27 | - 114: {fileID: 11400000} 28 | m_Layer: 0 29 | m_Name: TiltSteerInputH 30 | m_TagString: Untagged 31 | m_Icon: {fileID: 0} 32 | m_NavMeshLayer: 0 33 | m_StaticEditorFlags: 0 34 | m_IsActive: 1 35 | --- !u!1 &100004 36 | GameObject: 37 | m_ObjectHideFlags: 0 38 | m_PrefabParentObject: {fileID: 0} 39 | m_PrefabInternal: {fileID: 100100000} 40 | serializedVersion: 4 41 | m_Component: 42 | - 4: {fileID: 400004} 43 | - 114: {fileID: 11400002} 44 | m_Layer: 0 45 | m_Name: TiltSteerInputV 46 | m_TagString: Untagged 47 | m_Icon: {fileID: 0} 48 | m_NavMeshLayer: 0 49 | m_StaticEditorFlags: 0 50 | m_IsActive: 1 51 | --- !u!4 &400000 52 | Transform: 53 | m_ObjectHideFlags: 1 54 | m_PrefabParentObject: {fileID: 0} 55 | m_PrefabInternal: {fileID: 100100000} 56 | m_GameObject: {fileID: 100000} 57 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 58 | m_LocalPosition: {x: 385.509033, y: 268.018066, z: -62.2695312} 59 | m_LocalScale: {x: 1, y: 1, z: 1} 60 | m_Children: 61 | - {fileID: 400004} 62 | - {fileID: 400002} 63 | m_Father: {fileID: 0} 64 | m_RootOrder: 0 65 | --- !u!4 &400002 66 | Transform: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 100002} 71 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 72 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 73 | m_LocalScale: {x: 1, y: 1, z: 1} 74 | m_Children: [] 75 | m_Father: {fileID: 400000} 76 | m_RootOrder: 1 77 | --- !u!4 &400004 78 | Transform: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 100004} 83 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 84 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 85 | m_LocalScale: {x: 1, y: 1, z: 1} 86 | m_Children: [] 87 | m_Father: {fileID: 400000} 88 | m_RootOrder: 0 89 | --- !u!114 &11400000 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 1 92 | m_PrefabParentObject: {fileID: 0} 93 | m_PrefabInternal: {fileID: 100100000} 94 | m_GameObject: {fileID: 100002} 95 | m_Enabled: 1 96 | m_EditorHideFlags: 0 97 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 98 | m_Name: 99 | m_EditorClassIdentifier: 100 | mapping: 101 | type: 0 102 | axisName: Horizontal 103 | tiltAroundAxis: 0 104 | fullTiltAngle: 50 105 | centreAngleOffset: 0 106 | --- !u!114 &11400002 107 | MonoBehaviour: 108 | m_ObjectHideFlags: 1 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 100100000} 111 | m_GameObject: {fileID: 100004} 112 | m_Enabled: 1 113 | m_EditorHideFlags: 0 114 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 115 | m_Name: 116 | m_EditorClassIdentifier: 117 | mapping: 118 | type: 0 119 | axisName: Vertical 120 | tiltAroundAxis: 1 121 | fullTiltAngle: -35 122 | centreAngleOffset: 45 123 | --- !u!114 &11400004 124 | MonoBehaviour: 125 | m_ObjectHideFlags: 1 126 | m_PrefabParentObject: {fileID: 0} 127 | m_PrefabInternal: {fileID: 100100000} 128 | m_GameObject: {fileID: 100000} 129 | m_Enabled: 1 130 | m_EditorHideFlags: 0 131 | m_Script: {fileID: 11500000, guid: 71398ce7fbc3a5b4fa50b50bd54317a7, type: 3} 132 | m_Name: 133 | m_EditorClassIdentifier: 134 | --- !u!1001 &100100000 135 | Prefab: 136 | m_ObjectHideFlags: 1 137 | serializedVersion: 2 138 | m_Modification: 139 | m_TransformParent: {fileID: 0} 140 | m_Modifications: [] 141 | m_RemovedComponents: [] 142 | m_ParentPrefab: {fileID: 0} 143 | m_RootGameObject: {fileID: 100000} 144 | m_IsPrefabParent: 1 145 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 999388b68bb99b44099461bfbed94358 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d88a0b7dd92c5524aaf2d65e569a6213 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 8 | { 9 | // designed to work in a pair with another axis touch button 10 | // (typically with one having -1 and one having 1 axisValues) 11 | public string axisName = "Horizontal"; // The name of the axis 12 | public float axisValue = 1; // The axis that the value has 13 | public float responseSpeed = 3; // The speed at which the axis touch button responds 14 | public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre 15 | 16 | AxisTouchButton m_PairedWith; // Which button this one is paired with 17 | CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input 18 | 19 | void OnEnable() 20 | { 21 | if (!CrossPlatformInputManager.AxisExists(axisName)) 22 | { 23 | // if the axis doesnt exist create a new one in cross platform input 24 | m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName); 25 | CrossPlatformInputManager.RegisterVirtualAxis(m_Axis); 26 | } 27 | else 28 | { 29 | m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName); 30 | } 31 | FindPairedButton(); 32 | } 33 | 34 | void FindPairedButton() 35 | { 36 | // find the other button witch which this button should be paired 37 | // (it should have the same axisName) 38 | var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[]; 39 | 40 | if (otherAxisButtons != null) 41 | { 42 | for (int i = 0; i < otherAxisButtons.Length; i++) 43 | { 44 | if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this) 45 | { 46 | m_PairedWith = otherAxisButtons[i]; 47 | } 48 | } 49 | } 50 | } 51 | 52 | void OnDisable() 53 | { 54 | // The object is disabled so remove it from the cross platform input system 55 | m_Axis.Remove(); 56 | } 57 | 58 | 59 | public void OnPointerDown(PointerEventData data) 60 | { 61 | if (m_PairedWith == null) 62 | { 63 | FindPairedButton(); 64 | } 65 | // update the axis and record that the button has been pressed this frame 66 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime)); 67 | } 68 | 69 | 70 | public void OnPointerUp(PointerEventData data) 71 | { 72 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime)); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab98b66288df7b4fa182075f2f12bd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class ButtonHandler : MonoBehaviour 7 | { 8 | 9 | public string Name; 10 | 11 | void OnEnable() 12 | { 13 | 14 | } 15 | 16 | public void SetDownState() 17 | { 18 | CrossPlatformInputManager.SetButtonDown(Name); 19 | } 20 | 21 | 22 | public void SetUpState() 23 | { 24 | CrossPlatformInputManager.SetButtonUp(Name); 25 | } 26 | 27 | 28 | public void SetAxisPositiveState() 29 | { 30 | CrossPlatformInputManager.SetAxisPositive(Name); 31 | } 32 | 33 | 34 | public void SetAxisNeutralState() 35 | { 36 | CrossPlatformInputManager.SetAxisZero(Name); 37 | } 38 | 39 | 40 | public void SetAxisNegativeState() 41 | { 42 | CrossPlatformInputManager.SetAxisNegative(Name); 43 | } 44 | 45 | public void Update() 46 | { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bf3be603548374ca46f521a3aa7fda 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ac1ce5a5adfd9f46adbf5b6f752a47c 3 | labels: 4 | - Done 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: -1010 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class InputAxisScrollbar : MonoBehaviour 7 | { 8 | public string axis; 9 | 10 | void Update() { } 11 | 12 | public void HandleInput(float value) 13 | { 14 | CrossPlatformInputManager.SetAxis(axis, (value*2f) - 1f); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3269566d48b8447bb48d2259e28f8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class Joystick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler 8 | { 9 | public enum AxisOption 10 | { 11 | // Options for which axes to use 12 | Both, // Use both 13 | OnlyHorizontal, // Only horizontal 14 | OnlyVertical // Only vertical 15 | } 16 | 17 | public int MovementRange = 100; 18 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 19 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 20 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 21 | 22 | Vector3 m_StartPos; 23 | bool m_UseX; // Toggle for using the x axis 24 | bool m_UseY; // Toggle for using the Y axis 25 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 26 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 27 | 28 | void OnEnable() 29 | { 30 | m_StartPos = transform.position; 31 | CreateVirtualAxes(); 32 | } 33 | 34 | void UpdateVirtualAxes(Vector3 value) 35 | { 36 | var delta = m_StartPos - value; 37 | delta.y = -delta.y; 38 | delta /= MovementRange; 39 | if (m_UseX) 40 | { 41 | m_HorizontalVirtualAxis.Update(-delta.x); 42 | } 43 | 44 | if (m_UseY) 45 | { 46 | m_VerticalVirtualAxis.Update(delta.y); 47 | } 48 | } 49 | 50 | void CreateVirtualAxes() 51 | { 52 | // set axes to use 53 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 54 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 55 | 56 | // create new axes based on axes to use 57 | if (m_UseX) 58 | { 59 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 60 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 61 | } 62 | if (m_UseY) 63 | { 64 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 65 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 66 | } 67 | } 68 | 69 | 70 | public void OnDrag(PointerEventData data) 71 | { 72 | Vector3 newPos = Vector3.zero; 73 | 74 | if (m_UseX) 75 | { 76 | int delta = (int)(data.position.x - m_StartPos.x); 77 | delta = Mathf.Clamp(delta, - MovementRange, MovementRange); 78 | newPos.x = delta; 79 | } 80 | 81 | if (m_UseY) 82 | { 83 | int delta = (int)(data.position.y - m_StartPos.y); 84 | delta = Mathf.Clamp(delta, -MovementRange, MovementRange); 85 | newPos.y = delta; 86 | } 87 | transform.position = new Vector3(m_StartPos.x + newPos.x, m_StartPos.y + newPos.y, m_StartPos.z + newPos.z); 88 | UpdateVirtualAxes(transform.position); 89 | } 90 | 91 | 92 | public void OnPointerUp(PointerEventData data) 93 | { 94 | transform.position = m_StartPos; 95 | UpdateVirtualAxes(m_StartPos); 96 | } 97 | 98 | 99 | public void OnPointerDown(PointerEventData data) { } 100 | 101 | void OnDisable() 102 | { 103 | // remove the joysticks from the cross platform input 104 | if (m_UseX) 105 | { 106 | m_HorizontalVirtualAxis.Remove(); 107 | } 108 | if (m_UseY) 109 | { 110 | m_VerticalVirtualAxis.Remove(); 111 | } 112 | } 113 | } 114 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00c3c865782347f41b6358d9fba14b48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | using UnityEngine; 6 | 7 | 8 | namespace UnityStandardAssets.CrossPlatformInput 9 | { 10 | [ExecuteInEditMode] 11 | public class MobileControlRig : MonoBehaviour 12 | { 13 | // this script enables or disables the child objects of a control rig 14 | // depending on whether the USE_MOBILE_INPUT define is declared. 15 | 16 | // This define is set or unset by a menu item that is included with 17 | // the Cross Platform Input package. 18 | 19 | #if !UNITY_EDITOR 20 | void OnEnable() 21 | { 22 | CheckEnableControlRig(); 23 | } 24 | #endif 25 | 26 | #if UNITY_EDITOR 27 | 28 | private void OnEnable() 29 | { 30 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 31 | EditorApplication.update += Update; 32 | } 33 | 34 | 35 | private void OnDisable() 36 | { 37 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 38 | EditorApplication.update -= Update; 39 | } 40 | 41 | 42 | private void Update() 43 | { 44 | CheckEnableControlRig(); 45 | } 46 | #endif 47 | 48 | 49 | private void CheckEnableControlRig() 50 | { 51 | #if MOBILE_INPUT 52 | EnableControlRig(true); 53 | #else 54 | EnableControlRig(false); 55 | #endif 56 | } 57 | 58 | 59 | private void EnableControlRig(bool enabled) 60 | { 61 | foreach (Transform t in transform) 62 | { 63 | t.gameObject.SetActive(enabled); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71398ce7fbc3a5b4fa50b50bd54317a7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3f33f034733d9f4f9d439d80e26bdce 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class MobileInput : VirtualInput 7 | { 8 | private void AddButton(string name) 9 | { 10 | // we have not registered this button yet so add it, happens in the constructor 11 | CrossPlatformInputManager.RegisterVirtualButton(new CrossPlatformInputManager.VirtualButton(name)); 12 | } 13 | 14 | 15 | private void AddAxes(string name) 16 | { 17 | // we have not registered this button yet so add it, happens in the constructor 18 | CrossPlatformInputManager.RegisterVirtualAxis(new CrossPlatformInputManager.VirtualAxis(name)); 19 | } 20 | 21 | 22 | public override float GetAxis(string name, bool raw) 23 | { 24 | if (!m_VirtualAxes.ContainsKey(name)) 25 | { 26 | AddAxes(name); 27 | } 28 | return m_VirtualAxes[name].GetValue; 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | if (!m_VirtualButtons.ContainsKey(name)) 35 | { 36 | AddButton(name); 37 | } 38 | m_VirtualButtons[name].Pressed(); 39 | } 40 | 41 | 42 | public override void SetButtonUp(string name) 43 | { 44 | if (!m_VirtualButtons.ContainsKey(name)) 45 | { 46 | AddButton(name); 47 | } 48 | m_VirtualButtons[name].Released(); 49 | } 50 | 51 | 52 | public override void SetAxisPositive(string name) 53 | { 54 | if (!m_VirtualAxes.ContainsKey(name)) 55 | { 56 | AddAxes(name); 57 | } 58 | m_VirtualAxes[name].Update(1f); 59 | } 60 | 61 | 62 | public override void SetAxisNegative(string name) 63 | { 64 | if (!m_VirtualAxes.ContainsKey(name)) 65 | { 66 | AddAxes(name); 67 | } 68 | m_VirtualAxes[name].Update(-1f); 69 | } 70 | 71 | 72 | public override void SetAxisZero(string name) 73 | { 74 | if (!m_VirtualAxes.ContainsKey(name)) 75 | { 76 | AddAxes(name); 77 | } 78 | m_VirtualAxes[name].Update(0f); 79 | } 80 | 81 | 82 | public override void SetAxis(string name, float value) 83 | { 84 | if (!m_VirtualAxes.ContainsKey(name)) 85 | { 86 | AddAxes(name); 87 | } 88 | m_VirtualAxes[name].Update(value); 89 | } 90 | 91 | 92 | public override bool GetButtonDown(string name) 93 | { 94 | if (m_VirtualButtons.ContainsKey(name)) 95 | { 96 | return m_VirtualButtons[name].GetButtonDown; 97 | } 98 | 99 | AddButton(name); 100 | return m_VirtualButtons[name].GetButtonDown; 101 | } 102 | 103 | 104 | public override bool GetButtonUp(string name) 105 | { 106 | if (m_VirtualButtons.ContainsKey(name)) 107 | { 108 | return m_VirtualButtons[name].GetButtonUp; 109 | } 110 | 111 | AddButton(name); 112 | return m_VirtualButtons[name].GetButtonUp; 113 | } 114 | 115 | 116 | public override bool GetButton(string name) 117 | { 118 | if (m_VirtualButtons.ContainsKey(name)) 119 | { 120 | return m_VirtualButtons[name].GetButton; 121 | } 122 | 123 | AddButton(name); 124 | return m_VirtualButtons[name].GetButton; 125 | } 126 | 127 | 128 | public override Vector3 MousePosition() 129 | { 130 | return virtualMousePosition; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9703d53e47195aa4190acd11369ccd1b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class StandaloneInput : VirtualInput 7 | { 8 | public override float GetAxis(string name, bool raw) 9 | { 10 | return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name); 11 | } 12 | 13 | 14 | public override bool GetButton(string name) 15 | { 16 | return Input.GetButton(name); 17 | } 18 | 19 | 20 | public override bool GetButtonDown(string name) 21 | { 22 | return Input.GetButtonDown(name); 23 | } 24 | 25 | 26 | public override bool GetButtonUp(string name) 27 | { 28 | return Input.GetButtonUp(name); 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | throw new Exception( 35 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 36 | } 37 | 38 | 39 | public override void SetButtonUp(string name) 40 | { 41 | throw new Exception( 42 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 43 | } 44 | 45 | 46 | public override void SetAxisPositive(string name) 47 | { 48 | throw new Exception( 49 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 50 | } 51 | 52 | 53 | public override void SetAxisNegative(string name) 54 | { 55 | throw new Exception( 56 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 57 | } 58 | 59 | 60 | public override void SetAxisZero(string name) 61 | { 62 | throw new Exception( 63 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 64 | } 65 | 66 | 67 | public override void SetAxis(string name, float value) 68 | { 69 | throw new Exception( 70 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 71 | } 72 | 73 | 74 | public override Vector3 MousePosition() 75 | { 76 | return Input.mousePosition; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9961032f4f02c4f41997c3ea399d2f22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.CrossPlatformInput 8 | { 9 | // helps with managing tilt input on mobile devices 10 | public class TiltInput : MonoBehaviour 11 | { 12 | // options for the various orientations 13 | public enum AxisOptions 14 | { 15 | ForwardAxis, 16 | SidewaysAxis, 17 | } 18 | 19 | 20 | [Serializable] 21 | public class AxisMapping 22 | { 23 | public enum MappingType 24 | { 25 | NamedAxis, 26 | MousePositionX, 27 | MousePositionY, 28 | MousePositionZ 29 | }; 30 | 31 | 32 | public MappingType type; 33 | public string axisName; 34 | } 35 | 36 | 37 | public AxisMapping mapping; 38 | public AxisOptions tiltAroundAxis = AxisOptions.ForwardAxis; 39 | public float fullTiltAngle = 25; 40 | public float centreAngleOffset = 0; 41 | 42 | 43 | private CrossPlatformInputManager.VirtualAxis m_SteerAxis; 44 | 45 | 46 | private void OnEnable() 47 | { 48 | if (mapping.type == AxisMapping.MappingType.NamedAxis) 49 | { 50 | m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName); 51 | CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis); 52 | } 53 | } 54 | 55 | 56 | private void Update() 57 | { 58 | float angle = 0; 59 | if (Input.acceleration != Vector3.zero) 60 | { 61 | switch (tiltAroundAxis) 62 | { 63 | case AxisOptions.ForwardAxis: 64 | angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + 65 | centreAngleOffset; 66 | break; 67 | case AxisOptions.SidewaysAxis: 68 | angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + 69 | centreAngleOffset; 70 | break; 71 | } 72 | } 73 | 74 | float axisValue = Mathf.InverseLerp(-fullTiltAngle, fullTiltAngle, angle)*2 - 1; 75 | switch (mapping.type) 76 | { 77 | case AxisMapping.MappingType.NamedAxis: 78 | m_SteerAxis.Update(axisValue); 79 | break; 80 | case AxisMapping.MappingType.MousePositionX: 81 | CrossPlatformInputManager.SetVirtualMousePositionX(axisValue*Screen.width); 82 | break; 83 | case AxisMapping.MappingType.MousePositionY: 84 | CrossPlatformInputManager.SetVirtualMousePositionY(axisValue*Screen.width); 85 | break; 86 | case AxisMapping.MappingType.MousePositionZ: 87 | CrossPlatformInputManager.SetVirtualMousePositionZ(axisValue*Screen.width); 88 | break; 89 | } 90 | } 91 | 92 | 93 | private void OnDisable() 94 | { 95 | m_SteerAxis.Remove(); 96 | } 97 | } 98 | } 99 | 100 | 101 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 102 | { 103 | #if UNITY_EDITOR 104 | [CustomPropertyDrawer(typeof (TiltInput.AxisMapping))] 105 | public class TiltInputAxisStylePropertyDrawer : PropertyDrawer 106 | { 107 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 108 | { 109 | EditorGUI.BeginProperty(position, label, property); 110 | 111 | float x = position.x; 112 | float y = position.y; 113 | float inspectorWidth = position.width; 114 | 115 | // Don't make child fields be indented 116 | var indent = EditorGUI.indentLevel; 117 | EditorGUI.indentLevel = 0; 118 | 119 | var props = new[] {"type", "axisName"}; 120 | var widths = new[] {.4f, .6f}; 121 | if (property.FindPropertyRelative("type").enumValueIndex > 0) 122 | { 123 | // hide name if not a named axis 124 | props = new[] {"type"}; 125 | widths = new[] {1f}; 126 | } 127 | const float lineHeight = 18; 128 | for (int n = 0; n < props.Length; ++n) 129 | { 130 | float w = widths[n]*inspectorWidth; 131 | 132 | // Calculate rects 133 | Rect rect = new Rect(x, y, w, lineHeight); 134 | x += w; 135 | 136 | EditorGUI.PropertyField(rect, property.FindPropertyRelative(props[n]), GUIContent.none); 137 | } 138 | 139 | // Set indent back to what it was 140 | EditorGUI.indentLevel = indent; 141 | EditorGUI.EndProperty(); 142 | } 143 | } 144 | #endif 145 | } 146 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c2d84226fbbaf94e9c1451f1c39b06a 3 | labels: 4 | - Not 5 | - Fully 6 | - Implemented 7 | MonoImporter: 8 | serializedVersion: 2 9 | defaultReferences: [] 10 | executionOrder: -1001 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | [RequireComponent(typeof(Image))] 9 | public class TouchPad : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 10 | { 11 | // Options for which axes to use 12 | public enum AxisOption 13 | { 14 | Both, // Use both 15 | OnlyHorizontal, // Only horizontal 16 | OnlyVertical // Only vertical 17 | } 18 | 19 | 20 | public enum ControlStyle 21 | { 22 | Absolute, // operates from teh center of the image 23 | Relative, // operates from the center of the initial touch 24 | Swipe, // swipe to touch touch no maintained center 25 | } 26 | 27 | 28 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 29 | public ControlStyle controlStyle = ControlStyle.Absolute; // control style to use 30 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 31 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 32 | public float Xsensitivity = 1f; 33 | public float Ysensitivity = 1f; 34 | 35 | Vector3 m_StartPos; 36 | Vector2 m_PreviousDelta; 37 | Vector3 m_JoytickOutput; 38 | bool m_UseX; // Toggle for using the x axis 39 | bool m_UseY; // Toggle for using the Y axis 40 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 41 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 42 | bool m_Dragging; 43 | int m_Id = -1; 44 | Vector2 m_PreviousTouchPos; // swipe style control touch 45 | 46 | 47 | #if !UNITY_EDITOR 48 | private Vector3 m_Center; 49 | private Image m_Image; 50 | #else 51 | Vector3 m_PreviousMouse; 52 | #endif 53 | 54 | void OnEnable() 55 | { 56 | CreateVirtualAxes(); 57 | #if !UNITY_EDITOR 58 | m_Image = GetComponent(); 59 | m_Center = m_Image.transform.position; 60 | #endif 61 | } 62 | 63 | void CreateVirtualAxes() 64 | { 65 | // set axes to use 66 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 67 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 68 | 69 | // create new axes based on axes to use 70 | if (m_UseX) 71 | { 72 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 73 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 74 | } 75 | if (m_UseY) 76 | { 77 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 78 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 79 | } 80 | } 81 | 82 | void UpdateVirtualAxes(Vector3 value) 83 | { 84 | value = value.normalized; 85 | if (m_UseX) 86 | { 87 | m_HorizontalVirtualAxis.Update(value.x); 88 | } 89 | 90 | if (m_UseY) 91 | { 92 | m_VerticalVirtualAxis.Update(value.y); 93 | } 94 | } 95 | 96 | 97 | public void OnPointerDown(PointerEventData data) 98 | { 99 | m_Dragging = true; 100 | m_Id = data.pointerId; 101 | #if !UNITY_EDITOR 102 | if (controlStyle != ControlStyle.Absolute ) 103 | m_Center = data.position; 104 | #endif 105 | } 106 | 107 | void Update() 108 | { 109 | if (!m_Dragging) 110 | { 111 | return; 112 | } 113 | if (Input.touchCount >= m_Id + 1 && m_Id != -1) 114 | { 115 | #if !UNITY_EDITOR 116 | 117 | if (controlStyle == ControlStyle.Swipe) 118 | { 119 | m_Center = m_PreviousTouchPos; 120 | m_PreviousTouchPos = Input.touches[m_Id].position; 121 | } 122 | Vector2 pointerDelta = new Vector2(Input.touches[m_Id].position.x - m_Center.x , Input.touches[m_Id].position.y - m_Center.y).normalized; 123 | pointerDelta.x *= Xsensitivity; 124 | pointerDelta.y *= Ysensitivity; 125 | #else 126 | Vector2 pointerDelta; 127 | pointerDelta.x = Input.mousePosition.x - m_PreviousMouse.x; 128 | pointerDelta.y = Input.mousePosition.y - m_PreviousMouse.y; 129 | m_PreviousMouse = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f); 130 | #endif 131 | UpdateVirtualAxes(new Vector3(pointerDelta.x, pointerDelta.y, 0)); 132 | } 133 | } 134 | 135 | 136 | public void OnPointerUp(PointerEventData data) 137 | { 138 | m_Dragging = false; 139 | m_Id = -1; 140 | UpdateVirtualAxes(Vector3.zero); 141 | } 142 | 143 | void OnDisable() 144 | { 145 | if (CrossPlatformInputManager.AxisExists(horizontalAxisName)) 146 | CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName); 147 | 148 | if (CrossPlatformInputManager.AxisExists(verticalAxisName)) 149 | CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName); 150 | } 151 | } 152 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1caf40fc8bebb6b43b2550c05ca791d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | public abstract class VirtualInput 9 | { 10 | public Vector3 virtualMousePosition { get; private set; } 11 | 12 | 13 | protected Dictionary m_VirtualAxes = 14 | new Dictionary(); 15 | // Dictionary to store the name relating to the virtual axes 16 | protected Dictionary m_VirtualButtons = 17 | new Dictionary(); 18 | protected List m_AlwaysUseVirtual = new List(); 19 | // list of the axis and button names that have been flagged to always use a virtual axis or button 20 | 21 | 22 | public bool AxisExists(string name) 23 | { 24 | return m_VirtualAxes.ContainsKey(name); 25 | } 26 | 27 | public bool ButtonExists(string name) 28 | { 29 | return m_VirtualButtons.ContainsKey(name); 30 | } 31 | 32 | 33 | public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) 34 | { 35 | // check if we already have an axis with that name and log and error if we do 36 | if (m_VirtualAxes.ContainsKey(axis.name)) 37 | { 38 | Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); 39 | } 40 | else 41 | { 42 | // add any new axes 43 | m_VirtualAxes.Add(axis.name, axis); 44 | 45 | // if we dont want to match with the input manager setting then revert to always using virtual 46 | if (!axis.matchWithInputManager) 47 | { 48 | m_AlwaysUseVirtual.Add(axis.name); 49 | } 50 | } 51 | } 52 | 53 | 54 | public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) 55 | { 56 | // check if already have a buttin with that name and log an error if we do 57 | if (m_VirtualButtons.ContainsKey(button.name)) 58 | { 59 | Debug.LogError("There is already a virtual button named " + button.name + " registered."); 60 | } 61 | else 62 | { 63 | // add any new buttons 64 | m_VirtualButtons.Add(button.name, button); 65 | 66 | // if we dont want to match to the input manager then always use a virtual axis 67 | if (!button.matchWithInputManager) 68 | { 69 | m_AlwaysUseVirtual.Add(button.name); 70 | } 71 | } 72 | } 73 | 74 | 75 | public void UnRegisterVirtualAxis(string name) 76 | { 77 | // if we have an axis with that name then remove it from our dictionary of registered axes 78 | if (m_VirtualAxes.ContainsKey(name)) 79 | { 80 | m_VirtualAxes.Remove(name); 81 | } 82 | } 83 | 84 | 85 | public void UnRegisterVirtualButton(string name) 86 | { 87 | // if we have a button with this name then remove it from our dictionary of registered buttons 88 | if (m_VirtualButtons.ContainsKey(name)) 89 | { 90 | m_VirtualButtons.Remove(name); 91 | } 92 | } 93 | 94 | 95 | // returns a reference to a named virtual axis if it exists otherwise null 96 | public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name) 97 | { 98 | return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null; 99 | } 100 | 101 | 102 | public void SetVirtualMousePositionX(float f) 103 | { 104 | virtualMousePosition = new Vector3(f, virtualMousePosition.y, virtualMousePosition.z); 105 | } 106 | 107 | 108 | public void SetVirtualMousePositionY(float f) 109 | { 110 | virtualMousePosition = new Vector3(virtualMousePosition.x, f, virtualMousePosition.z); 111 | } 112 | 113 | 114 | public void SetVirtualMousePositionZ(float f) 115 | { 116 | virtualMousePosition = new Vector3(virtualMousePosition.x, virtualMousePosition.y, f); 117 | } 118 | 119 | 120 | public abstract float GetAxis(string name, bool raw); 121 | 122 | public abstract bool GetButton(string name); 123 | public abstract bool GetButtonDown(string name); 124 | public abstract bool GetButtonUp(string name); 125 | 126 | public abstract void SetButtonDown(string name); 127 | public abstract void SetButtonUp(string name); 128 | public abstract void SetAxisPositive(string name); 129 | public abstract void SetAxisNegative(string name); 130 | public abstract void SetAxisZero(string name); 131 | public abstract void SetAxis(string name, float value); 132 | public abstract Vector3 MousePosition(); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f57aeb1b8dce3342bea5c28ac17db24 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c4bc148459cd764dbb1d4e94e49299b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb5f6e2757c821940b69cf1456f7865a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f588d850485d0ae479d73cf3bd0b7b00 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b611e658efbf443b686a4036f74fe3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db017495c69e8140a56a0e2b669e3f8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1a64ea234fb2343b8d0686c51280de 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827c9cd4a3943534f909ac6473e17288 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3983c59ebf804b4abba687bd7c9e92f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a94c9a7eb94ceec4a8d67a1890e22e51 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: ResetButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d8675433a508ec47b8f895201eacf20 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 40, y: 40, z: 40, w: 40} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5485e2f56028a3c4cb54f5caa167377e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9866a92691696b346901281f2b329034 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c6271a290ef75b4c97d58746c86c5b8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7c6e4896067aa4fa512a00f692ac1c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea5873cfd9158664f89459f0c9e1d853 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: SliderBackground 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 31, y: 15, z: 31, w: 15} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0626b924325d1c34cafa6b22297f4e4f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f1fee3de32377429fd1348fae62b10 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 65, y: 65, z: 65, w: 65} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ca8c4e270f964e0da9f731d7d34b123 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e6f84bf81c8d4de280f1133cff7e601 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cba4562cece794697b418ce8e7c04b3c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond01AlbedoAlpha.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond01AlbedoAlpha.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond01AlbedoAlpha.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c528fec5d95e4ac28cf46399b887662 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 2 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 128 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 128 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 128 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 128 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond02AlbedoAlpha.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond02AlbedoAlpha.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/BillboardTextures/GrassFrond02AlbedoAlpha.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6cdc79ec19714fcd980ca3f6ac01a0a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 0 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 128 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 128 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 128 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 128 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f9d71771b07cb6438e0d35b038b43a7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/CliffAlbedoSpecular.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/CliffAlbedoSpecular.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/CliffAlbedoSpecular.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18214e9d6af6248559d501391856f1c7 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 2 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 0 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 256 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 256 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 256 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 256 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassHillAlbedo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassHillAlbedo.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassHillAlbedo.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6e0767b1f8c34890ac245217f4b9731 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 2 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 0 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 128 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 128 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 128 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 128 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassRockyAlbedo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassRockyAlbedo.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/GrassRockyAlbedo.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 440eb36db91ca410f800ff3cfe43572f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 2 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 0 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 256 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 256 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 256 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 256 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyAlbedoSpecular.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyAlbedoSpecular.bmp -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyAlbedoSpecular.bmp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef5c51cfa2ce46043a41a376b560c525 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 256 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 256 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 256 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 256 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyNormals.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyNormals.bmp -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyNormals.bmp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58a059b07b093a745b47c2191525ddce 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 1 17 | externalNormalMap: 1 18 | heightScale: .300000012 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 1 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 256 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 256 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 256 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 256 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/SandAlbedo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/SandAlbedo.psd -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/SandAlbedo.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfd675cc0db1d4656b75dc6d6ba91142 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 2 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 1 32 | mipBias: 0 33 | wrapMode: 0 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: 48 | - buildTarget: iPhone 49 | maxTextureSize: 256 50 | textureFormat: -1 51 | compressionQuality: 50 52 | - buildTarget: Android 53 | maxTextureSize: 256 54 | textureFormat: -1 55 | compressionQuality: 50 56 | - buildTarget: BlackBerry 57 | maxTextureSize: 256 58 | textureFormat: -1 59 | compressionQuality: 50 60 | - buildTarget: WP8 61 | maxTextureSize: 256 62 | textureFormat: -1 63 | compressionQuality: 50 64 | spriteSheet: 65 | sprites: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fb26caddeedb41c9ae5c09a23c52942 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ActivateTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class ActivateTrigger : MonoBehaviour 8 | { 9 | // A multi-purpose script which causes an action to occur when 10 | // a trigger collider is entered. 11 | public enum Mode 12 | { 13 | Trigger = 0, // Just broadcast the action on to the target 14 | Replace = 1, // replace target with source 15 | Activate = 2, // Activate the target GameObject 16 | Enable = 3, // Enable a component 17 | Animate = 4, // Start animation on target 18 | Deactivate = 5 // Decativate target GameObject 19 | } 20 | 21 | public Mode action = Mode.Activate; // The action to accomplish 22 | public Object target; // The game object to affect. If none, the trigger work on this game object 23 | public GameObject source; 24 | public int triggerCount = 1; 25 | public bool repeatTrigger = false; 26 | 27 | 28 | private void DoActivateTrigger() 29 | { 30 | triggerCount--; 31 | 32 | if (triggerCount == 0 || repeatTrigger) 33 | { 34 | Object currentTarget = target ?? gameObject; 35 | Behaviour targetBehaviour = currentTarget as Behaviour; 36 | GameObject targetGameObject = currentTarget as GameObject; 37 | if (targetBehaviour != null) 38 | { 39 | targetGameObject = targetBehaviour.gameObject; 40 | } 41 | 42 | switch (action) 43 | { 44 | case Mode.Trigger: 45 | if (targetGameObject != null) 46 | { 47 | targetGameObject.BroadcastMessage("DoActivateTrigger"); 48 | } 49 | break; 50 | case Mode.Replace: 51 | if (source != null) 52 | { 53 | if (targetGameObject != null) 54 | { 55 | Instantiate(source, targetGameObject.transform.position, 56 | targetGameObject.transform.rotation); 57 | DestroyObject(targetGameObject); 58 | } 59 | } 60 | break; 61 | case Mode.Activate: 62 | if (targetGameObject != null) 63 | { 64 | targetGameObject.SetActive(true); 65 | } 66 | break; 67 | case Mode.Enable: 68 | if (targetBehaviour != null) 69 | { 70 | targetBehaviour.enabled = true; 71 | } 72 | break; 73 | case Mode.Animate: 74 | if (targetGameObject != null) 75 | { 76 | targetGameObject.GetComponent().Play(); 77 | } 78 | break; 79 | case Mode.Deactivate: 80 | if (targetGameObject != null) 81 | { 82 | targetGameObject.SetActive(false); 83 | } 84 | break; 85 | } 86 | } 87 | } 88 | 89 | 90 | private void OnTriggerEnter(Collider other) 91 | { 92 | DoActivateTrigger(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ActivateTrigger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8634e062924929664361c08745211fb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/AutoMobileShaderSwitch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4978ff6447f9040b84acc89b0bbdc8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/AutoMoveAndRotate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class AutoMoveAndRotate : MonoBehaviour 7 | { 8 | public Vector3andSpace moveUnitsPerSecond; 9 | public Vector3andSpace rotateDegreesPerSecond; 10 | public bool ignoreTimescale; 11 | private float m_LastRealTime; 12 | 13 | 14 | private void Start() 15 | { 16 | m_LastRealTime = Time.realtimeSinceStartup; 17 | } 18 | 19 | 20 | // Update is called once per frame 21 | private void Update() 22 | { 23 | float deltaTime = Time.deltaTime; 24 | if (ignoreTimescale) 25 | { 26 | deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); 27 | m_LastRealTime = Time.realtimeSinceStartup; 28 | } 29 | transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); 30 | transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); 31 | } 32 | 33 | 34 | [Serializable] 35 | public class Vector3andSpace 36 | { 37 | public Vector3 value; 38 | public Space space = Space.Self; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/AutoMoveAndRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1347817507220a4384f3ff6f7c24546 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/CameraRefocus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class CameraRefocus 7 | { 8 | public Camera Camera; 9 | public Vector3 Lookatpoint; 10 | public Transform Parent; 11 | 12 | private Vector3 m_OrigCameraPos; 13 | private bool m_Refocus; 14 | 15 | 16 | public CameraRefocus(Camera camera, Transform parent, Vector3 origCameraPos) 17 | { 18 | m_OrigCameraPos = origCameraPos; 19 | Camera = camera; 20 | Parent = parent; 21 | } 22 | 23 | 24 | public void ChangeCamera(Camera camera) 25 | { 26 | Camera = camera; 27 | } 28 | 29 | 30 | public void ChangeParent(Transform parent) 31 | { 32 | Parent = parent; 33 | } 34 | 35 | 36 | public void GetFocusPoint() 37 | { 38 | RaycastHit hitInfo; 39 | if (Physics.Raycast(Parent.transform.position + m_OrigCameraPos, Parent.transform.forward, out hitInfo, 40 | 100f)) 41 | { 42 | Lookatpoint = hitInfo.point; 43 | m_Refocus = true; 44 | return; 45 | } 46 | m_Refocus = false; 47 | } 48 | 49 | 50 | public void SetFocusPoint() 51 | { 52 | if (m_Refocus) 53 | { 54 | Camera.transform.LookAt(Lookatpoint); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/CameraRefocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1e2e7a54dcc8694ab1eca46d072f264 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/CurveControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class CurveControlledBob 9 | { 10 | public float HorizontalBobRange = 0.33f; 11 | public float VerticalBobRange = 0.33f; 12 | public AnimationCurve Bobcurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), 13 | new Keyframe(1f, 0f), new Keyframe(1.5f, -1f), 14 | new Keyframe(2f, 0f)); // sin curve for head bob 15 | public float VerticaltoHorizontalRatio = 1f; 16 | 17 | private float m_CyclePositionX; 18 | private float m_CyclePositionY; 19 | private float m_BobBaseInterval; 20 | private Vector3 m_OriginalCameraPosition; 21 | private float m_Time; 22 | 23 | 24 | public void Setup(Camera camera, float bobBaseInterval) 25 | { 26 | m_BobBaseInterval = bobBaseInterval; 27 | m_OriginalCameraPosition = camera.transform.localPosition; 28 | 29 | // get the length of the curve in time 30 | m_Time = Bobcurve[Bobcurve.length - 1].time; 31 | } 32 | 33 | 34 | public Vector3 DoHeadBob(float speed) 35 | { 36 | float xPos = m_OriginalCameraPosition.x + (Bobcurve.Evaluate(m_CyclePositionX)*HorizontalBobRange); 37 | float yPos = m_OriginalCameraPosition.y + (Bobcurve.Evaluate(m_CyclePositionY)*VerticalBobRange); 38 | 39 | m_CyclePositionX += (speed*Time.deltaTime)/m_BobBaseInterval; 40 | m_CyclePositionY += ((speed*Time.deltaTime)/m_BobBaseInterval)*VerticaltoHorizontalRatio; 41 | 42 | if (m_CyclePositionX > m_Time) 43 | { 44 | m_CyclePositionX = m_CyclePositionX - m_Time; 45 | } 46 | if (m_CyclePositionY > m_Time) 47 | { 48 | m_CyclePositionY = m_CyclePositionY - m_Time; 49 | } 50 | 51 | return new Vector3(xPos, yPos, 0f); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/CurveControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492f54f4accf00440828ffcb9e4fcc19 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/DragRigidbody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class DragRigidbody : MonoBehaviour 8 | { 9 | const float k_Spring = 50.0f; 10 | const float k_Damper = 5.0f; 11 | const float k_Drag = 10.0f; 12 | const float k_AngularDrag = 5.0f; 13 | const float k_Distance = 0.2f; 14 | const bool k_AttachToCenterOfMass = false; 15 | 16 | private SpringJoint m_SpringJoint; 17 | 18 | 19 | private void Update() 20 | { 21 | // Make sure the user pressed the mouse down 22 | if (!Input.GetMouseButtonDown(0)) 23 | { 24 | return; 25 | } 26 | 27 | var mainCamera = FindCamera(); 28 | 29 | // We need to actually hit an object 30 | RaycastHit hit = new RaycastHit(); 31 | if ( 32 | !Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition).origin, 33 | mainCamera.ScreenPointToRay(Input.mousePosition).direction, out hit, 100, 34 | Physics.DefaultRaycastLayers)) 35 | { 36 | return; 37 | } 38 | // We need to hit a rigidbody that is not kinematic 39 | if (!hit.rigidbody || hit.rigidbody.isKinematic) 40 | { 41 | return; 42 | } 43 | 44 | if (!m_SpringJoint) 45 | { 46 | var go = new GameObject("Rigidbody dragger"); 47 | Rigidbody body = go.AddComponent(); 48 | m_SpringJoint = go.AddComponent(); 49 | body.isKinematic = true; 50 | } 51 | 52 | m_SpringJoint.transform.position = hit.point; 53 | m_SpringJoint.anchor = Vector3.zero; 54 | 55 | m_SpringJoint.spring = k_Spring; 56 | m_SpringJoint.damper = k_Damper; 57 | m_SpringJoint.maxDistance = k_Distance; 58 | m_SpringJoint.connectedBody = hit.rigidbody; 59 | 60 | StartCoroutine("DragObject", hit.distance); 61 | } 62 | 63 | 64 | private IEnumerator DragObject(float distance) 65 | { 66 | var oldDrag = m_SpringJoint.connectedBody.drag; 67 | var oldAngularDrag = m_SpringJoint.connectedBody.angularDrag; 68 | m_SpringJoint.connectedBody.drag = k_Drag; 69 | m_SpringJoint.connectedBody.angularDrag = k_AngularDrag; 70 | var mainCamera = FindCamera(); 71 | while (Input.GetMouseButton(0)) 72 | { 73 | var ray = mainCamera.ScreenPointToRay(Input.mousePosition); 74 | m_SpringJoint.transform.position = ray.GetPoint(distance); 75 | yield return null; 76 | } 77 | if (m_SpringJoint.connectedBody) 78 | { 79 | m_SpringJoint.connectedBody.drag = oldDrag; 80 | m_SpringJoint.connectedBody.angularDrag = oldAngularDrag; 81 | m_SpringJoint.connectedBody = null; 82 | } 83 | } 84 | 85 | 86 | private Camera FindCamera() 87 | { 88 | if (GetComponent()) 89 | { 90 | return GetComponent(); 91 | } 92 | 93 | return Camera.main; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/DragRigidbody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58650e15a2607e44daa0f150e0061d89 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/DynamicShadowSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class DynamicShadowSettings : MonoBehaviour 7 | { 8 | public Light sunLight; 9 | public float minHeight = 10; 10 | public float minShadowDistance = 80; 11 | public float minShadowBias = 1; 12 | public float maxHeight = 1000; 13 | public float maxShadowDistance = 10000; 14 | public float maxShadowBias = 0.1f; 15 | public float adaptTime = 1; 16 | 17 | private float m_SmoothHeight; 18 | private float m_ChangeSpeed; 19 | private float m_OriginalStrength = 1; 20 | 21 | 22 | private void Start() 23 | { 24 | m_OriginalStrength = sunLight.shadowStrength; 25 | } 26 | 27 | 28 | // Update is called once per frame 29 | private void Update() 30 | { 31 | Ray ray = new Ray(Camera.main.transform.position, -Vector3.up); 32 | RaycastHit hit; 33 | float height = transform.position.y; 34 | if (Physics.Raycast(ray, out hit)) 35 | { 36 | height = hit.distance; 37 | } 38 | 39 | if (Mathf.Abs(height - m_SmoothHeight) > 1) 40 | { 41 | m_SmoothHeight = Mathf.SmoothDamp(m_SmoothHeight, height, ref m_ChangeSpeed, adaptTime); 42 | } 43 | 44 | float i = Mathf.InverseLerp(minHeight, maxHeight, m_SmoothHeight); 45 | 46 | QualitySettings.shadowDistance = Mathf.Lerp(minShadowDistance, maxShadowDistance, i); 47 | sunLight.shadowBias = Mathf.Lerp(minShadowBias, maxShadowBias, 1 - ((1 - i)*(1 - i))); 48 | sunLight.shadowStrength = Mathf.Lerp(m_OriginalStrength, 0, i); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/DynamicShadowSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8566902b50d5bfb4fb7f8b89f9cdbe8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FOVKick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class FOVKick 9 | { 10 | public Camera Camera; // optional camera setup, if null the main camera will be used 11 | [HideInInspector] public float originalFov; // the original fov 12 | public float FOVIncrease = 3f; // the amount the field of view increases when going into a run 13 | public float TimeToIncrease = 1f; // the amount of time the field of view will increase over 14 | public float TimeToDecrease = 1f; // the amount of time the field of view will take to return to its original size 15 | public AnimationCurve IncreaseCurve; 16 | 17 | 18 | public void Setup(Camera camera) 19 | { 20 | CheckStatus(camera); 21 | 22 | Camera = camera; 23 | originalFov = camera.fieldOfView; 24 | } 25 | 26 | 27 | private void CheckStatus(Camera camera) 28 | { 29 | if (camera == null) 30 | { 31 | throw new Exception("FOVKick camera is null, please supply the camera to the constructor"); 32 | } 33 | 34 | if (IncreaseCurve == null) 35 | { 36 | throw new Exception( 37 | "FOVKick Increase curve is null, please define the curve for the field of view kicks"); 38 | } 39 | } 40 | 41 | 42 | public void ChangeCamera(Camera camera) 43 | { 44 | Camera = camera; 45 | } 46 | 47 | 48 | public IEnumerator FOVKickUp() 49 | { 50 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 51 | while (t < TimeToIncrease) 52 | { 53 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToIncrease)*FOVIncrease); 54 | t += Time.deltaTime; 55 | yield return new WaitForEndOfFrame(); 56 | } 57 | } 58 | 59 | 60 | public IEnumerator FOVKickDown() 61 | { 62 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 63 | while (t > 0) 64 | { 65 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToDecrease)*FOVIncrease); 66 | t -= Time.deltaTime; 67 | yield return new WaitForEndOfFrame(); 68 | } 69 | //make sure that fov returns to the original size 70 | Camera.fieldOfView = originalFov; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FOVKick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6045a93fb05b9c74884821030da2c46c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FPSCounter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | [RequireComponent(typeof (GUIText))] 7 | public class FPSCounter : MonoBehaviour 8 | { 9 | const float fpsMeasurePeriod = 0.5f; 10 | private int m_FpsAccumulator = 0; 11 | private float m_FpsNextPeriod = 0; 12 | private int m_CurrentFps; 13 | const string display = "{0} FPS"; 14 | private GUIText m_GuiText; 15 | 16 | 17 | private void Start() 18 | { 19 | m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; 20 | m_GuiText = GetComponent(); 21 | } 22 | 23 | 24 | private void Update() 25 | { 26 | // measure average frames per second 27 | m_FpsAccumulator++; 28 | if (Time.realtimeSinceStartup > m_FpsNextPeriod) 29 | { 30 | m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod); 31 | m_FpsAccumulator = 0; 32 | m_FpsNextPeriod += fpsMeasurePeriod; 33 | m_GuiText.text = string.Format(display, m_CurrentFps); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FPSCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22bbf57ec543cee42a5aa0ec2dd9e457 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FollowTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class FollowTarget : MonoBehaviour 8 | { 9 | public Transform target; 10 | public Vector3 offset = new Vector3(0f, 7.5f, 0f); 11 | 12 | 13 | private void LateUpdate() 14 | { 15 | transform.position = target.position + offset; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/FollowTarget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 246cc59c7a84ea44f87f6b70acfe30c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ForcedReset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | [RequireComponent(typeof (GUITexture))] 6 | public class ForcedReset : MonoBehaviour 7 | { 8 | private void Update() 9 | { 10 | // if we have forced a reset ... 11 | if (CrossPlatformInputManager.GetButtonDown("ResetObject")) 12 | { 13 | //... reload the scene 14 | Application.LoadLevelAsync(Application.loadedLevelName); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ForcedReset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b886447cba80f74e820adb3c9e70c76 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/LerpControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class LerpControlledBob 9 | { 10 | public float BobDuration; 11 | public float BobAmount; 12 | 13 | private float m_Offset = 0f; 14 | 15 | 16 | // provides the offset that can be used 17 | public float Offset() 18 | { 19 | return m_Offset; 20 | } 21 | 22 | 23 | public IEnumerator DoBobCycle() 24 | { 25 | // make the camera move down slightly 26 | float t = 0f; 27 | while (t < BobDuration) 28 | { 29 | m_Offset = Mathf.Lerp(0f, BobAmount, t/BobDuration); 30 | t += Time.deltaTime; 31 | yield return new WaitForFixedUpdate(); 32 | } 33 | 34 | // make it move back to neutral 35 | t = 0f; 36 | while (t < BobDuration) 37 | { 38 | m_Offset = Mathf.Lerp(BobAmount, 0f, t/BobDuration); 39 | t += Time.deltaTime; 40 | yield return new WaitForFixedUpdate(); 41 | } 42 | m_Offset = 0f; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/LerpControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1bbfafbde15c854681023b9e01e12dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ObjectResetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ObjectResetter : MonoBehaviour 9 | { 10 | private Vector3 originalPosition; 11 | private Quaternion originalRotation; 12 | private List originalStructure; 13 | 14 | private Rigidbody Rigidbody; 15 | 16 | // Use this for initialization 17 | private void Start() 18 | { 19 | originalStructure = new List(GetComponentsInChildren()); 20 | originalPosition = transform.position; 21 | originalRotation = transform.rotation; 22 | 23 | Rigidbody = GetComponent(); 24 | } 25 | 26 | 27 | public void DelayedReset(float delay) 28 | { 29 | StartCoroutine(ResetCoroutine(delay)); 30 | } 31 | 32 | 33 | public IEnumerator ResetCoroutine(float delay) 34 | { 35 | yield return new WaitForSeconds(delay); 36 | 37 | // remove any gameobjects added (fire, skid trails, etc) 38 | foreach (var t in GetComponentsInChildren()) 39 | { 40 | if (!originalStructure.Contains(t)) 41 | { 42 | t.parent = null; 43 | } 44 | } 45 | 46 | transform.position = originalPosition; 47 | transform.rotation = originalRotation; 48 | if (Rigidbody) 49 | { 50 | Rigidbody.velocity = Vector3.zero; 51 | Rigidbody.angularVelocity = Vector3.zero; 52 | } 53 | 54 | SendMessage("Reset"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ObjectResetter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 643c971818f68d3439e84b5d8bdafe07 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ParticleSystemDestroyer : MonoBehaviour 9 | { 10 | // allows a particle system to exist for a specified duration, 11 | // then shuts off emission, and waits for all particles to expire 12 | // before destroying the gameObject 13 | 14 | public float minDuration = 8; 15 | public float maxDuration = 10; 16 | 17 | private float m_MaxLifetime; 18 | private bool m_EarlyStop; 19 | 20 | 21 | private IEnumerator Start() 22 | { 23 | var systems = GetComponentsInChildren(); 24 | 25 | // find out the maximum lifetime of any particles in this effect 26 | foreach (var system in systems) 27 | { 28 | m_MaxLifetime = Mathf.Max(system.startLifetime, m_MaxLifetime); 29 | } 30 | 31 | // wait for random duration 32 | 33 | float stopTime = Time.time + Random.Range(minDuration, maxDuration); 34 | 35 | while (Time.time < stopTime || m_EarlyStop) 36 | { 37 | yield return null; 38 | } 39 | Debug.Log("stopping " + name); 40 | 41 | // turn off emission 42 | foreach (var system in systems) 43 | { 44 | system.enableEmission = false; 45 | } 46 | BroadcastMessage("Extinguish", SendMessageOptions.DontRequireReceiver); 47 | 48 | // wait for any remaining particles to expire 49 | yield return new WaitForSeconds(m_MaxLifetime); 50 | 51 | Destroy(gameObject); 52 | } 53 | 54 | 55 | public void Stop() 56 | { 57 | // stops the particle system early 58 | m_EarlyStop = true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29014cd42b6d273408e0ceefd336c0b3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/PlatformSpecificContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.Utility 8 | { 9 | #if UNITY_EDITOR 10 | 11 | [ExecuteInEditMode] 12 | #endif 13 | public class PlatformSpecificContent : MonoBehaviour 14 | { 15 | private enum BuildTargetGroup 16 | { 17 | Standalone, 18 | Mobile 19 | } 20 | 21 | [SerializeField] private BuildTargetGroup m_BuildTargetGroup; 22 | [SerializeField] private GameObject[] m_Content = new GameObject[0]; 23 | [SerializeField] private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; 24 | [SerializeField] private bool m_ChildrenOfThisObject; 25 | 26 | #if !UNITY_EDITOR 27 | void OnEnable() 28 | { 29 | CheckEnableContent(); 30 | } 31 | #endif 32 | 33 | #if UNITY_EDITOR 34 | 35 | private void OnEnable() 36 | { 37 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 38 | EditorApplication.update += Update; 39 | } 40 | 41 | 42 | private void OnDisable() 43 | { 44 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 45 | EditorApplication.update -= Update; 46 | } 47 | 48 | 49 | private void Update() 50 | { 51 | CheckEnableContent(); 52 | } 53 | #endif 54 | 55 | 56 | private void CheckEnableContent() 57 | { 58 | #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 59 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 60 | { 61 | EnableContent(true); 62 | } else { 63 | EnableContent(false); 64 | } 65 | #endif 66 | 67 | #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 68 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 69 | { 70 | EnableContent(false); 71 | } 72 | else 73 | { 74 | EnableContent(true); 75 | } 76 | #endif 77 | } 78 | 79 | 80 | private void EnableContent(bool enabled) 81 | { 82 | if (m_Content.Length > 0) 83 | { 84 | foreach (var g in m_Content) 85 | { 86 | if (g != null) 87 | { 88 | g.SetActive(enabled); 89 | } 90 | } 91 | } 92 | if (m_ChildrenOfThisObject) 93 | { 94 | foreach (Transform t in transform) 95 | { 96 | t.gameObject.SetActive(enabled); 97 | } 98 | } 99 | if (m_MonoBehaviours.Length > 0) 100 | { 101 | foreach (var monoBehaviour in m_MonoBehaviours) 102 | { 103 | monoBehaviour.enabled = enabled; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/PlatformSpecificContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b27507c5d0efbbd47ac8c1de9a1a0a35 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b43a4ef15621158419a2b639f7a98245 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 132: {fileID: 13200000} 12 | - 114: {fileID: 11400000} 13 | m_Layer: 0 14 | m_Name: FramerateCounter 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &400000 21 | Transform: 22 | m_ObjectHideFlags: 1 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | m_GameObject: {fileID: 100000} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: .5, y: 1, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | --- !u!114 &11400000 33 | MonoBehaviour: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 100000} 38 | m_Enabled: 1 39 | m_EditorHideFlags: 0 40 | m_Script: {fileID: 11500000, guid: 22bbf57ec543cee42a5aa0ec2dd9e457, type: 3} 41 | m_Name: 42 | m_EditorClassIdentifier: 43 | --- !u!132 &13200000 44 | GUIText: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 100000} 49 | m_Enabled: 1 50 | serializedVersion: 3 51 | m_Text: FPS 52 | m_Anchor: 1 53 | m_Alignment: 1 54 | m_PixelOffset: {x: 0, y: 0} 55 | m_LineSpacing: 1 56 | m_TabSize: 4 57 | m_Font: {fileID: 12800000, guid: b51a3e520f9164da198dc59c8acfccd6, type: 3} 58 | m_Material: {fileID: 0} 59 | m_FontSize: 0 60 | m_FontStyle: 0 61 | m_Color: 62 | serializedVersion: 2 63 | rgba: 4294967295 64 | m_PixelCorrect: 1 65 | m_RichText: 1 66 | --- !u!1001 &100100000 67 | Prefab: 68 | m_ObjectHideFlags: 1 69 | serializedVersion: 2 70 | m_Modification: 71 | m_TransformParent: {fileID: 0} 72 | m_Modifications: [] 73 | m_RemovedComponents: [] 74 | m_ParentPrefab: {fileID: 0} 75 | m_RootGameObject: {fileID: 100000} 76 | m_IsPrefabParent: 1 77 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81154777d5417884981849c5243f6c01 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SimpleActivatorMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class SimpleActivatorMenu : MonoBehaviour 7 | { 8 | // An incredibly simple menu which, when given references 9 | // to gameobjects in the scene 10 | public GUIText camSwitchButton; 11 | public GameObject[] objects; 12 | 13 | 14 | private int m_CurrentActiveObject; 15 | 16 | 17 | private void OnEnable() 18 | { 19 | // active object starts from first in array 20 | m_CurrentActiveObject = 0; 21 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 22 | } 23 | 24 | 25 | public void NextCamera() 26 | { 27 | int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1; 28 | 29 | for (int i = 0; i < objects.Length; i++) 30 | { 31 | objects[i].SetActive(i == nextactiveobject); 32 | } 33 | 34 | m_CurrentActiveObject = nextactiveobject; 35 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SimpleActivatorMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b69a5b0e0a85b4aa97a7edc40c37d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SimpleMouseRotator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class SimpleMouseRotator : MonoBehaviour 8 | { 9 | // A mouselook behaviour with constraints which operate relative to 10 | // this gameobject's initial rotation. 11 | // Only rotates around local X and Y. 12 | // Works in local coordinates, so if this object is parented 13 | // to another moving gameobject, its local constraints will 14 | // operate correctly 15 | // (Think: looking out the side window of a car, or a gun turret 16 | // on a moving spaceship with a limited angular range) 17 | // to have no constraints on an axis, set the rotationRange to 360 or greater. 18 | public Vector2 rotationRange = new Vector3(70, 70); 19 | public float rotationSpeed = 10; 20 | public float dampingTime = 0.2f; 21 | public bool autoZeroVerticalOnMobile = true; 22 | public bool autoZeroHorizontalOnMobile = false; 23 | public bool relative = true; 24 | 25 | 26 | private Vector3 m_TargetAngles; 27 | private Vector3 m_FollowAngles; 28 | private Vector3 m_FollowVelocity; 29 | private Quaternion m_OriginalRotation; 30 | 31 | 32 | private void Start() 33 | { 34 | m_OriginalRotation = transform.localRotation; 35 | } 36 | 37 | 38 | private void Update() 39 | { 40 | // we make initial calculations from the original local rotation 41 | transform.localRotation = m_OriginalRotation; 42 | 43 | // read input from mouse or mobile controls 44 | float inputH; 45 | float inputV; 46 | if (relative) 47 | { 48 | inputH = CrossPlatformInputManager.GetAxis("Mouse X"); 49 | inputV = CrossPlatformInputManager.GetAxis("Mouse Y"); 50 | 51 | // wrap values to avoid springing quickly the wrong way from positive to negative 52 | if (m_TargetAngles.y > 180) 53 | { 54 | m_TargetAngles.y -= 360; 55 | m_FollowAngles.y -= 360; 56 | } 57 | if (m_TargetAngles.x > 180) 58 | { 59 | m_TargetAngles.x -= 360; 60 | m_FollowAngles.x -= 360; 61 | } 62 | if (m_TargetAngles.y < -180) 63 | { 64 | m_TargetAngles.y += 360; 65 | m_FollowAngles.y += 360; 66 | } 67 | if (m_TargetAngles.x < -180) 68 | { 69 | m_TargetAngles.x += 360; 70 | m_FollowAngles.x += 360; 71 | } 72 | 73 | #if MOBILE_INPUT 74 | // on mobile, sometimes we want input mapped directly to tilt value, 75 | // so it springs back automatically when the look input is released. 76 | if (autoZeroHorizontalOnMobile) { 77 | m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f); 78 | } else { 79 | m_TargetAngles.y += inputH * rotationSpeed; 80 | } 81 | if (autoZeroVerticalOnMobile) { 82 | m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f); 83 | } else { 84 | m_TargetAngles.x += inputV * rotationSpeed; 85 | } 86 | #else 87 | // with mouse input, we have direct control with no springback required. 88 | m_TargetAngles.y += inputH*rotationSpeed; 89 | m_TargetAngles.x += inputV*rotationSpeed; 90 | #endif 91 | 92 | // clamp values to allowed range 93 | m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f); 94 | m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f); 95 | } 96 | else 97 | { 98 | inputH = Input.mousePosition.x; 99 | inputV = Input.mousePosition.y; 100 | 101 | // set values to allowed range 102 | m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width); 103 | m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height); 104 | } 105 | 106 | // smoothly interpolate current values to target angles 107 | m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime); 108 | 109 | // update the actual gameobject's rotation 110 | transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SimpleMouseRotator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cadd54e4832aeef4b9359f44cbe335cd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SmoothFollow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityStandardAssets.Utility 4 | { 5 | public class SmoothFollow : MonoBehaviour 6 | { 7 | 8 | // The target we are following 9 | [SerializeField] 10 | private Transform target; 11 | // The distance in the x-z plane to the target 12 | [SerializeField] 13 | private float distance = 10.0f; 14 | // the height we want the camera to be above the target 15 | [SerializeField] 16 | private float height = 5.0f; 17 | 18 | [SerializeField] 19 | private float rotationDamping; 20 | [SerializeField] 21 | private float heightDamping; 22 | 23 | // Use this for initialization 24 | void Start() { } 25 | 26 | // Update is called once per frame 27 | void LateUpdate() 28 | { 29 | // Early out if we don't have a target 30 | if (!target) 31 | return; 32 | 33 | // Calculate the current rotation angles 34 | var wantedRotationAngle = target.eulerAngles.y; 35 | var wantedHeight = target.position.y + height; 36 | 37 | var currentRotationAngle = transform.eulerAngles.y; 38 | var currentHeight = transform.position.y; 39 | 40 | // Damp the rotation around the y-axis 41 | currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); 42 | 43 | // Damp the height 44 | currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime); 45 | 46 | // Convert the angle into a rotation 47 | var currentRotation = Quaternion.Euler(0, currentRotationAngle, 0); 48 | 49 | // Set the position of the camera on the x-z plane to: 50 | // distance meters behind the target 51 | transform.position = target.position; 52 | transform.position -= currentRotation * Vector3.forward * distance; 53 | 54 | // Set the height of the camera 55 | transform.position = new Vector3(transform.position.x ,currentHeight , transform.position.z); 56 | 57 | // Always look at the target 58 | transform.LookAt(target); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/SmoothFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f76806479d916a64aa03f8e3eba7912f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/TimedObjectActivator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a7cedf246fca744f90cbdc9dbe41166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/TimedObjectDestructor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class TimedObjectDestructor : MonoBehaviour 7 | { 8 | [SerializeField] private float m_TimeOut = 1.0f; 9 | [SerializeField] private bool m_DetachChildren = false; 10 | 11 | 12 | private void Awake() 13 | { 14 | Invoke("DestroyNow", m_TimeOut); 15 | } 16 | 17 | 18 | private void DestroyNow() 19 | { 20 | if (m_DetachChildren) 21 | { 22 | transform.DetachChildren(); 23 | } 24 | DestroyObject(gameObject); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/TimedObjectDestructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37fac21d1f093d344816942d1abce94e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/WaypointCircuit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70852dc981465ea48bb527b9e33a87fd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/WaypointProgressTracker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class WaypointProgressTracker : MonoBehaviour 7 | { 8 | // This script can be used with any object that is supposed to follow a 9 | // route marked out by waypoints. 10 | 11 | // This script manages the amount to look ahead along the route, 12 | // and keeps track of progress and laps. 13 | 14 | [SerializeField] private WaypointCircuit circuit; // A reference to the waypoint-based route we should follow 15 | 16 | [SerializeField] private float lookAheadForTargetOffset = 5; 17 | // The offset ahead along the route that the we will aim for 18 | 19 | [SerializeField] private float lookAheadForTargetFactor = .1f; 20 | // A multiplier adding distance ahead along the route to aim for, based on current speed 21 | 22 | [SerializeField] private float lookAheadForSpeedOffset = 10; 23 | // The offset ahead only the route for speed adjustments (applied as the rotation of the waypoint target transform) 24 | 25 | [SerializeField] private float lookAheadForSpeedFactor = .2f; 26 | // A multiplier adding distance ahead along the route for speed adjustments 27 | 28 | [SerializeField] private ProgressStyle progressStyle = ProgressStyle.SmoothAlongRoute; 29 | // whether to update the position smoothly along the route (good for curved paths) or just when we reach each waypoint. 30 | 31 | [SerializeField] private float pointToPointThreshold = 4; 32 | // proximity to waypoint which must be reached to switch target to next waypoint : only used in PointToPoint mode. 33 | 34 | public enum ProgressStyle 35 | { 36 | SmoothAlongRoute, 37 | PointToPoint, 38 | } 39 | 40 | // these are public, readable by other objects - i.e. for an AI to know where to head! 41 | public WaypointCircuit.RoutePoint targetPoint { get; private set; } 42 | public WaypointCircuit.RoutePoint speedPoint { get; private set; } 43 | public WaypointCircuit.RoutePoint progressPoint { get; private set; } 44 | 45 | public Transform target; 46 | 47 | private float progressDistance; // The progress round the route, used in smooth mode. 48 | private int progressNum; // the current waypoint number, used in point-to-point mode. 49 | private Vector3 lastPosition; // Used to calculate current speed (since we may not have a rigidbody component) 50 | private float speed; // current speed of this object (calculated from delta since last frame) 51 | 52 | // setup script properties 53 | private void Start() 54 | { 55 | // we use a transform to represent the point to aim for, and the point which 56 | // is considered for upcoming changes-of-speed. This allows this component 57 | // to communicate this information to the AI without requiring further dependencies. 58 | 59 | // You can manually create a transform and assign it to this component *and* the AI, 60 | // then this component will update it, and the AI can read it. 61 | if (target == null) 62 | { 63 | target = new GameObject(name + " Waypoint Target").transform; 64 | } 65 | 66 | Reset(); 67 | } 68 | 69 | 70 | // reset the object to sensible values 71 | public void Reset() 72 | { 73 | progressDistance = 0; 74 | progressNum = 0; 75 | if (progressStyle == ProgressStyle.PointToPoint) 76 | { 77 | target.position = circuit.Waypoints[progressNum].position; 78 | target.rotation = circuit.Waypoints[progressNum].rotation; 79 | } 80 | } 81 | 82 | 83 | private void Update() 84 | { 85 | if (progressStyle == ProgressStyle.SmoothAlongRoute) 86 | { 87 | // determine the position we should currently be aiming for 88 | // (this is different to the current progress position, it is a a certain amount ahead along the route) 89 | // we use lerp as a simple way of smoothing out the speed over time. 90 | if (Time.deltaTime > 0) 91 | { 92 | speed = Mathf.Lerp(speed, (lastPosition - transform.position).magnitude/Time.deltaTime, 93 | Time.deltaTime); 94 | } 95 | target.position = 96 | circuit.GetRoutePoint(progressDistance + lookAheadForTargetOffset + lookAheadForTargetFactor*speed) 97 | .position; 98 | target.rotation = 99 | Quaternion.LookRotation( 100 | circuit.GetRoutePoint(progressDistance + lookAheadForSpeedOffset + lookAheadForSpeedFactor*speed) 101 | .direction); 102 | 103 | 104 | // get our current progress along the route 105 | progressPoint = circuit.GetRoutePoint(progressDistance); 106 | Vector3 progressDelta = progressPoint.position - transform.position; 107 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 108 | { 109 | progressDistance += progressDelta.magnitude*0.5f; 110 | } 111 | 112 | lastPosition = transform.position; 113 | } 114 | else 115 | { 116 | // point to point mode. Just increase the waypoint if we're close enough: 117 | 118 | Vector3 targetDelta = target.position - transform.position; 119 | if (targetDelta.magnitude < pointToPointThreshold) 120 | { 121 | progressNum = (progressNum + 1)%circuit.Waypoints.Length; 122 | } 123 | 124 | 125 | target.position = circuit.Waypoints[progressNum].position; 126 | target.rotation = circuit.Waypoints[progressNum].rotation; 127 | 128 | // get our current progress along the route 129 | progressPoint = circuit.GetRoutePoint(progressDistance); 130 | Vector3 progressDelta = progressPoint.position - transform.position; 131 | if (Vector3.Dot(progressDelta, progressPoint.direction) < 0) 132 | { 133 | progressDistance += progressDelta.magnitude; 134 | } 135 | lastPosition = transform.position; 136 | } 137 | } 138 | 139 | 140 | private void OnDrawGizmos() 141 | { 142 | if (Application.isPlaying) 143 | { 144 | Gizmos.color = Color.green; 145 | Gizmos.DrawLine(transform.position, target.position); 146 | Gizmos.DrawWireSphere(circuit.GetRoutePosition(progressDistance), 1); 147 | Gizmos.color = Color.yellow; 148 | Gizmos.DrawLine(target.position, target.position + target.forward); 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/Standard Assets/Utility/WaypointProgressTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cb22d331ef7d64796f917c6a455a32 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/TestShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/TestShader" { 2 | Properties { 3 | _Color ("Color", Color) = (1,1,1,1) 4 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 5 | _OtherTex ("Other (RGB)", 2D) = "white" {} 6 | _Normal ("Normal", 2D) = "bump" {} 7 | _Normal2 ("Normal2", 2D) = "bump" {} 8 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 9 | _Metallic ("Metallic", Range(0,1)) = 0.0 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 200 14 | 15 | CGPROGRAM 16 | // Physically based Standard lighting model, and enable shadows on all light types 17 | #pragma surface surf Standard fullforwardshadows vertex:vert 18 | 19 | // Use shader model 3.0 target, to get nicer looking lighting 20 | #pragma target 3.0 21 | 22 | sampler2D _MainTex; 23 | sampler2D _OtherTex; 24 | sampler2D _Normal; 25 | sampler2D _Normal2; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | float3 position; 30 | float3 norm; 31 | }; 32 | 33 | half _Glossiness; 34 | half _Metallic; 35 | fixed4 _Color; 36 | 37 | void vert (inout appdata_full v, out Input o) 38 | { 39 | UNITY_INITIALIZE_OUTPUT(Input,o); 40 | o.position = v.vertex.xyz; 41 | o.norm = v.normal; 42 | } 43 | 44 | void surf (Input IN, inout SurfaceOutputStandard o) 45 | { 46 | float3 texturePos = IN.position / 4.0f; 47 | 48 | float slope = max(0.0f, 1.0f - IN.norm.y); 49 | 50 | float grass = 0.0f; 51 | float rock = 1.0f; 52 | 53 | if (slope < 0.1f) 54 | { 55 | rock = 0.0f; 56 | grass = 1.0f; 57 | } 58 | 59 | // Albedo comes from a texture tinted by color 60 | float3 color0 = tex2D (_MainTex, texturePos.yz).rgb; 61 | float3 tCol0 = rock * tex2D (_MainTex, texturePos.xz).rgb; 62 | float3 tCol1 = grass * tex2D (_OtherTex, texturePos.xz).rgb; 63 | 64 | float3 color1 = tCol0 + tCol1; 65 | float3 color2 = tex2D(_OtherTex, texturePos.xy); 66 | 67 | 68 | fixed4 c = _Color; 69 | o.Albedo = c.rgb; 70 | o.Albedo *= ((color0 + color1 + color2) / 3.0f); 71 | if (slope >= 0.1f) 72 | { 73 | o.Normal = UnpackNormal(tex2D (_Normal, texturePos.xz)); 74 | } 75 | else 76 | { 77 | o.Normal = UnpackNormal(tex2D (_Normal2, texturePos.xz)); 78 | } 79 | // Metallic and smoothness come from slider variables 80 | o.Metallic = _Metallic; 81 | o.Smoothness = _Glossiness; 82 | o.Alpha = c.a; 83 | } 84 | ENDCG 85 | } 86 | FallBack "Diffuse" 87 | } 88 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/TestShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8313781ff850e37418a420469d14f382 3 | timeCreated: 1433359521 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/grassNormal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/grassNormal.jpg -------------------------------------------------------------------------------- /DualContouringGPU/Assets/grassNormal.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6832f97ef6abb3943833eca28cfedf12 3 | timeCreated: 1433365693 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 1 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /DualContouringGPU/Assets/testScene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/Assets/testScene.unity -------------------------------------------------------------------------------- /DualContouringGPU/Assets/testScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0af4a19ddd1c7504382495c645303973 3 | timeCreated: 1432316467 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.0.2f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /DualContouringGPU/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Colt-Zero/DualContouringGPU/7e093fc9eb8e4378fc4037e9a2627b0fc1ba14b4/DualContouringGPU/ProjectSettings/TimeManager.asset --------------------------------------------------------------------------------