diff --git a/Assets/AssetStoreDownloads/OBJImport/OBJLoader.cs b/Assets/AssetStoreDownloads/OBJImport/OBJLoader.cs index c4862c0..2cb3c71 100644 --- a/Assets/AssetStoreDownloads/OBJImport/OBJLoader.cs +++ b/Assets/AssetStoreDownloads/OBJImport/OBJLoader.cs @@ -459,7 +459,7 @@ public static GameObject LoadOBJFile(string fn) m.RecalculateNormals(); } m.RecalculateBounds(); - m.Optimize(); + ; MeshFilter mf = subObject.AddComponent(); MeshRenderer mr = subObject.AddComponent(); diff --git a/Assets/TangoPrefabs/Shaders/ARPostProcess.shader b/Assets/TangoPrefabs/Shaders/ARPostProcess.shader index a75a07c..54e70fe 100644 --- a/Assets/TangoPrefabs/Shaders/ARPostProcess.shader +++ b/Assets/TangoPrefabs/Shaders/ARPostProcess.shader @@ -1,4 +1,6 @@ -Shader "Tango/ARPostProcess" { +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Tango/ARPostProcess" { Properties { _MainTex ("Texture", 2D) = "white" {} @@ -40,7 +42,7 @@ { v2f o; o.uv = v.uv; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/TangoPrefabs/Shaders/PointCloud.shader b/Assets/TangoPrefabs/Shaders/PointCloud.shader index d484400..6ee1fd6 100644 --- a/Assets/TangoPrefabs/Shaders/PointCloud.shader +++ b/Assets/TangoPrefabs/Shaders/PointCloud.shader @@ -1,4 +1,6 @@ -Shader "Tango/PointCloud" { +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Tango/PointCloud" { Properties{ point_size("Point Size", Float) = 5.0 } @@ -28,7 +30,7 @@ Properties{ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.size = point_size; // Color should be based on pose relative info diff --git a/Assets/TangoPrefabs/Shaders/PointCloud_Occlusion.shader b/Assets/TangoPrefabs/Shaders/PointCloud_Occlusion.shader index 9a0435e..2630eb4 100644 --- a/Assets/TangoPrefabs/Shaders/PointCloud_Occlusion.shader +++ b/Assets/TangoPrefabs/Shaders/PointCloud_Occlusion.shader @@ -1,4 +1,6 @@ -Shader "Tango/PointCloud (Occlusion)" { +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Tango/PointCloud (Occlusion)" { SubShader { Tags { "Queue" = "Background-1" } Pass { @@ -24,7 +26,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.size = 30; return o; } diff --git a/Assets/TangoResearch/Common/Behaviours/FreezeRotation.cs b/Assets/TangoResearch/Common/Behaviours/FreezeRotation.cs index ff0a6ef..f2960ad 100644 --- a/Assets/TangoResearch/Common/Behaviours/FreezeRotation.cs +++ b/Assets/TangoResearch/Common/Behaviours/FreezeRotation.cs @@ -5,6 +5,10 @@ public class FreezeRotation : MonoBehaviour { private Quaternion _rotation; + public bool _FreezeX = false; + public bool _FreezeY = false; + public bool _FreezeZ = false; + void Start() { _rotation = transform.rotation; @@ -13,5 +17,11 @@ void Start() void Update() { transform.rotation = _rotation; + if (_FreezeX) + transform.eulerAngles = new Vector3(0, transform.rotation.y, transform.rotation.z); + if (_FreezeY) + transform.eulerAngles = new Vector3(transform.rotation.x, 0, transform.rotation.z); + if (_FreezeZ) + transform.eulerAngles = new Vector3(transform.rotation.x, transform.rotation.y, 0); } } diff --git a/Assets/Tree_Textures.meta b/Assets/TangoResearch/Common/Materials.meta similarity index 67% rename from Assets/Tree_Textures.meta rename to Assets/TangoResearch/Common/Materials.meta index a4ef4d1..71c7dcf 100644 --- a/Assets/Tree_Textures.meta +++ b/Assets/TangoResearch/Common/Materials.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0591fe7beaec64b45b1dd0424af01e7f +guid: 56bb30e23d2c547489fcd147bf80a388 folderAsset: yes -timeCreated: 1479674901 +timeCreated: 1479691989 licenseType: Free DefaultImporter: userData: diff --git a/Assets/TangoResearch/Common/SourceAssets.meta b/Assets/TangoResearch/Common/SourceAssets.meta new file mode 100644 index 0000000..7957eaf --- /dev/null +++ b/Assets/TangoResearch/Common/SourceAssets.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f01851ee82ae9ee4e8c6ce962a64c5d4 +folderAsset: yes +timeCreated: 1479694114 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Common/SourceAssets/Textures.meta b/Assets/TangoResearch/Common/SourceAssets/Textures.meta new file mode 100644 index 0000000..d5518d8 --- /dev/null +++ b/Assets/TangoResearch/Common/SourceAssets/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 56a022a836a0ffa43a0e690c79691807 +folderAsset: yes +timeCreated: 1479694129 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Common/Utils/ImageProcessing.cs b/Assets/TangoResearch/Common/Utils/ImageProcessing.cs index 8e6f1ce..48a5ffa 100644 --- a/Assets/TangoResearch/Common/Utils/ImageProcessing.cs +++ b/Assets/TangoResearch/Common/Utils/ImageProcessing.cs @@ -49,6 +49,128 @@ public static Texture2D RenderTextureToTexture2D(RenderTexture rTex) return c; } + public static Vector3[,] CubemapFaceToRGBArray(Cubemap cubeMap, CubemapFace face) + { + Vector3[,] c = new Vector3[cubeMap.width, cubeMap.height]; + + for (int i = 0; i < cubeMap.width; i++) + { + for (int j = 0; j < cubeMap.height; j++) + { + c[i, j] = ColorToVector3(cubeMap.GetPixel(face, i, j)) * 255; + } + } + + return c; + } + + public static Color[] CubemapFaceToColorArray(Cubemap cubeMap, CubemapFace face) + { + Color[] c = cubeMap.GetPixels(face); + return c; + } + + public static Color[,] CubemapFaceTo2DColorArray(Cubemap cubeMap, CubemapFace face) + { + Color[] c = cubeMap.GetPixels(face); + + Color[,] c2 = new Color[cubeMap.width, cubeMap.height]; + for (int i = 0; i < cubeMap.width; i++) + { + for (int j = 0; j < cubeMap.height; j++) + { + c2[i, j] = c[j * cubeMap.width + i]; + } + } + + return c2; + } + + public static Vector3[,] CubemapFaceTo2DVector3Array(Cubemap cubeMap, CubemapFace face) + { + Color[] c = cubeMap.GetPixels(face); + + Vector3[,] c2 = new Vector3[cubeMap.width, cubeMap.height]; + for (int i = 0; i < cubeMap.width; i++) + { + for (int j = 0; j < cubeMap.height; j++) + { + c2[i, cubeMap.height - j - 1] = ColorToVector3( c[j * cubeMap.width + i] ); + } + } + + return c2; + } + + public static Vector2 BrightestPoint(Color[,] c) + { + Vector2 p = Vector3.zero; + + float max = 0; + for (int i = 0; i < c.GetLength(0); i++) + { + for (int j = 0; j < c.GetLength(1); j++) + { + float cur = Grayscale(c[i,j]); + if(cur > max) + { + max = cur; + p = new Vector2(i, j); + } + } + } + + return p; + } + + public static Vector2 BrightestPoint(Vector3[,] c, out float average) + { + Vector2 p = Vector3.zero; + average = 0f; + + float max = 0; + for (int i = 0; i < c.GetLength(0); i++) + { + for (int j = 0; j < c.GetLength(1); j++) + { + float cur = Grayscale(c[i, j]); + average += cur; + if (cur > max) + { + max = cur; + p = new Vector2(i, j); + } + } + } + average /= c.GetLength(0) * c.GetLength(1); + + return p; + } + + public static Vector2 BrightestPoint(float[,] c, out float average) + { + Vector2 p = Vector3.zero; + average = 0f; + + float max = 0; + for (int i = 0; i < c.GetLength(0); i++) + { + for (int j = 0; j < c.GetLength(1); j++) + { + float cur = c[i, j]; + average += cur; + if (cur > max) + { + max = cur; + p = new Vector2(i, j); + } + } + } + average /= c.GetLength(0) * c.GetLength(1); + + return p; + } + #endregion #region Converters @@ -244,6 +366,12 @@ public static float Grayscale(Vector3 rgb) return luma; } + public static float Grayscale(Color rgb) + { + float luma = 0.2126f * rgb.r + 0.7152f * rgb.g + 0.0722f * rgb.b; + return luma; + } + #endregion #region Rendering diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvanced.cs b/Assets/TangoResearch/FindLights/Scripts/FindLightAdvanced.cs deleted file mode 100644 index 0afc38b..0000000 --- a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvanced.cs +++ /dev/null @@ -1,193 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.Collections.Generic; - -public class FindLightAdvanced : MonoBehaviour { - - public Vector3 _EstimatedLightPos = Vector3.zero; - public float[,,] _LightErrorGrid; - - public void SetupLightErrorGrid(int size = 5) - { - _LightErrorGrid = new float[size, size, size]; - } - - public Vector3 LightEstimation(ref List superpixels, int textureWidth, int textureHeight) - { - VectorInt3 minError = new VectorInt3(0, 0, 0); - float[] Io = new float[superpixels.Count]; - - for (int i = 0; i < superpixels.Count; i++) - { - Io[i] = superpixels[i].Intensity / 255f; - } - - for (int x = 0; x < _LightErrorGrid.GetLength(0); x++) - { - for (int y = 0; y < _LightErrorGrid.GetLength(1); y++) - { - for (int z = 0; z < _LightErrorGrid.GetLength(2); z++) - { - - Vector3 lightPos = Camera.main.transform.TransformPoint( - x - _LightErrorGrid.GetLength(0) / 2f, - y - _LightErrorGrid.GetLength(1) / 2f, - -z); - - float error = IoIrL2Norm(ref superpixels, Io, lightPos, textureWidth, textureHeight); - _LightErrorGrid[x, y, z] = error; - - if (error < _LightErrorGrid[minError.X, minError.Y, minError.Z]) - { - minError = new VectorInt3(x, y, z); - } - - - } - } - } - - Vector3 estimatedLightPos = Camera.main.transform.TransformPoint( - minError.X - _LightErrorGrid.GetLength(0) / 2f, - minError.Y - _LightErrorGrid.GetLength(1) / 2f, - -minError.Z); - - Debug.Log("LightPos: " + estimatedLightPos + " error: " + _LightErrorGrid[minError.X, minError.Y, minError.Z]); - return estimatedLightPos; - } - - public Vector3 LightEstimation(ref List pixels, int textureWidth, int textureHeight) - { - VectorInt3 minError = new VectorInt3(0, 0, 0); - float[] Io = new float[pixels.Count]; - - for (int i = 0; i < pixels.Count; i++) - { - Io[i] = pixels[i].Intensity / 255f; - } - - for (int x = 0; x < _LightErrorGrid.GetLength(0); x++) - { - for (int y = 0; y < _LightErrorGrid.GetLength(1); y++) - { - for (int z = 0; z < _LightErrorGrid.GetLength(2); z++) - { - - Vector3 lightPos = Camera.main.transform.TransformPoint( - x - _LightErrorGrid.GetLength(0) / 2f, - y - _LightErrorGrid.GetLength(1) / 2f, - -z); - - float error = IoIrL2Norm(ref pixels, Io, lightPos, textureWidth, textureHeight); - _LightErrorGrid[x, y, z] = error; - - if (error < _LightErrorGrid[minError.X, minError.Y, minError.Z]) - { - minError = new VectorInt3(x, y, z); - } - - - } - } - } - - Vector3 estimatedLightPos = Camera.main.transform.TransformPoint( - minError.X - _LightErrorGrid.GetLength(0) / 2f, - minError.Y - _LightErrorGrid.GetLength(1) / 2f, - -minError.Z); - - - Debug.Log("LightPos: " + estimatedLightPos + " error: " + _LightErrorGrid[minError.X, minError.Y, minError.Z]); - return estimatedLightPos; - } - - - public static float IoIrL2Norm(ref List superpixels, float[] Io, Vector3 lightPos, int textureWidth, int textureHeight) - { - float[] Ir = new float[superpixels.Count]; - - float dist = 0; - for (int i = 0; i < superpixels.Count; i++) - { - if (superpixels[i].Normal.magnitude <= 0) - { - continue; - } - - float ns = 0; - float albedo = 0; - float ir = 0; - Vector3 lightDir = ImageProcessing.LightDirection(lightPos, superpixels[i].WorldPoint); - ImageProcessing.ComputeAlbedo(Io[i], superpixels[i].Normal, lightDir, out ns, out albedo); - if (ns > 0) - { - ImageProcessing.ComputeImageIntensity(albedo, superpixels[i].Normal, lightDir, out ir); - } - else - { - if (!superpixels[i].GetMedianSynthesizedIr(textureWidth, textureHeight, lightPos, out albedo, out ir)) - { - ir = 0; - } - } - - - Ir[i] = ir; - dist += Mathf.Pow(Io[i] - Ir[i], 2); - } - dist = Mathf.Pow(dist, 0.5f); - - //if (_debuggingLightPos) - //{ - // Debug.Log("IoIr: " + dist); - //} - - return dist; - } - - public static float IoIrL2Norm(ref List pixels, float[] Io, Vector3 lightPos, int textureWidth, int textureHeight) - { - float[] Ir = new float[pixels.Count]; - - float dist = 0; - for (int i = 0; i < pixels.Count; i++) - { - if (pixels[i].Normal.magnitude <= 0) - { - continue; - } - - float ns = 0; - float albedo = 0; - float ir = 0; - Vector3 lightDir = ImageProcessing.LightDirection(lightPos, pixels[i].WorldPoint); - ImageProcessing.ComputeAlbedo(Io[i], pixels[i].Normal, lightDir, out ns, out albedo); - - if (ns > 0) - { - if (albedo > 2.5) - { - continue; - } - ImageProcessing.ComputeImageIntensity(albedo, pixels[i].Normal, lightDir, out ir); - } - else - { - ir = Io[i]; - } - - Ir[i] = ir; - dist += Mathf.Pow(Io[i] - Ir[i], 2); - } - dist = Mathf.Pow(dist, 0.5f); - - //if (_debuggingLightPos) - //{ - // Debug.Log("IoIr: " + dist); - //} - - return dist; - } - - -} diff --git a/Assets/TangoResearch/FindLights.meta b/Assets/TangoResearch/LightEstimation.meta similarity index 100% rename from Assets/TangoResearch/FindLights.meta rename to Assets/TangoResearch/LightEstimation.meta diff --git a/Assets/TangoResearch/FindLights/Materials.meta b/Assets/TangoResearch/LightEstimation/Materials.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Materials.meta rename to Assets/TangoResearch/LightEstimation/Materials.meta diff --git a/Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat b/Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat new file mode 100644 index 0000000..80d2fae Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat differ diff --git a/Assets/Tree.prefab.meta b/Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat.meta similarity index 65% rename from Assets/Tree.prefab.meta rename to Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat.meta index a0e5ea7..200093c 100644 --- a/Assets/Tree.prefab.meta +++ b/Assets/TangoResearch/LightEstimation/Materials/LightEstimated.mat.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 5107f6f8e6522d4499d6d8149819072a -timeCreated: 1479674900 +guid: e05931ba68ed45040b4304adbc008b10 +timeCreated: 1480291355 licenseType: Free NativeFormatImporter: userData: diff --git a/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat b/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat new file mode 100644 index 0000000..e283d31 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat.meta b/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat.meta new file mode 100644 index 0000000..17d1e4b --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/LightOriginal.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07e604e6925613d4cbbbdd33d289c660 +timeCreated: 1480291355 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures.meta new file mode 100644 index 0000000..95b2fed --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 143c40fc2e7e207439b210d17e20fdba +folderAsset: yes +timeCreated: 1480291189 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture new file mode 100644 index 0000000..30e620e Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture.meta new file mode 100644 index 0000000..4ae5286 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraBack.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 835020a427ab3fc44a359bf66e5aa0de +timeCreated: 1480291207 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture new file mode 100644 index 0000000..9649032 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture.meta new file mode 100644 index 0000000..e926e50 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraFront.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1710ab8b8e626b440b601049f6dbd7fb +timeCreated: 1480291207 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture new file mode 100644 index 0000000..fd676fe Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture.meta new file mode 100644 index 0000000..4fd32fa --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraSimulation.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d194e19cab5bfc48a034a40c270bdb9 +timeCreated: 1483402334 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture new file mode 100644 index 0000000..c156da2 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture.meta new file mode 100644 index 0000000..7c827f9 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/CameraTop.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94d90938fd0a21741b0f6b9437443d4b +timeCreated: 1480291207 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap new file mode 100644 index 0000000..6787f6a Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap.meta b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap.meta new file mode 100644 index 0000000..a77a617 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/RenderTextures/RenderCube.cubemap.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b73b4688fbb30604fad1528a067a1ca0 +timeCreated: 1480872063 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat b/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat new file mode 100644 index 0000000..c5042d6 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat differ diff --git a/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat.meta b/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat.meta new file mode 100644 index 0000000..b7c93cd --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Materials/Skybox.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67dffe6900f0b6544903daa6dd78226f +timeCreated: 1482636871 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/FindLights/Materials/TangoRGBDebug.mat b/Assets/TangoResearch/LightEstimation/Materials/TangoRGBDebug.mat similarity index 100% rename from Assets/TangoResearch/FindLights/Materials/TangoRGBDebug.mat rename to Assets/TangoResearch/LightEstimation/Materials/TangoRGBDebug.mat diff --git a/Assets/TangoResearch/FindLights/Materials/TangoRGBDebug.mat.meta b/Assets/TangoResearch/LightEstimation/Materials/TangoRGBDebug.mat.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Materials/TangoRGBDebug.mat.meta rename to Assets/TangoResearch/LightEstimation/Materials/TangoRGBDebug.mat.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs.meta b/Assets/TangoResearch/LightEstimation/Prefabs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs.meta rename to Assets/TangoResearch/LightEstimation/Prefabs.meta diff --git a/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab new file mode 100644 index 0000000..8bba5ef Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab differ diff --git a/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab.meta new file mode 100644 index 0000000..d948841 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Prefabs/InvertedSphere.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9a984d6b2b8a164c85534694dc582c1 +timeCreated: 1483307472 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/FindLights/Prefabs/LightSourceDetector.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/LightSourceDetector.prefab similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/LightSourceDetector.prefab rename to Assets/TangoResearch/LightEstimation/Prefabs/LightSourceDetector.prefab diff --git a/Assets/TangoResearch/FindLights/Prefabs/LightSourceDetector.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/LightSourceDetector.prefab.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/LightSourceDetector.prefab.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/LightSourceDetector.prefab.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs/PanelSliderSize.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderSize.prefab similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/PanelSliderSize.prefab rename to Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderSize.prefab diff --git a/Assets/TangoResearch/FindLights/Prefabs/PanelSliderSize.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderSize.prefab.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/PanelSliderSize.prefab.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderSize.prefab.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs/PanelSliderThreshold.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderThreshold.prefab similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/PanelSliderThreshold.prefab rename to Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderThreshold.prefab diff --git a/Assets/TangoResearch/FindLights/Prefabs/PanelSliderThreshold.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderThreshold.prefab.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/PanelSliderThreshold.prefab.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/PanelSliderThreshold.prefab.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs/Sphere.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/Sphere.prefab similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/Sphere.prefab rename to Assets/TangoResearch/LightEstimation/Prefabs/Sphere.prefab diff --git a/Assets/TangoResearch/FindLights/Prefabs/Sphere.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/Sphere.prefab.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/Sphere.prefab.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/Sphere.prefab.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs/TestObject.prefab b/Assets/TangoResearch/LightEstimation/Prefabs/TestObject.prefab similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/TestObject.prefab rename to Assets/TangoResearch/LightEstimation/Prefabs/TestObject.prefab diff --git a/Assets/TangoResearch/FindLights/Prefabs/TestObject.prefab.meta b/Assets/TangoResearch/LightEstimation/Prefabs/TestObject.prefab.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/TestObject.prefab.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/TestObject.prefab.meta diff --git a/Assets/TangoResearch/FindLights/Prefabs/UnlitTexture.mat b/Assets/TangoResearch/LightEstimation/Prefabs/UnlitTexture.mat similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/UnlitTexture.mat rename to Assets/TangoResearch/LightEstimation/Prefabs/UnlitTexture.mat diff --git a/Assets/TangoResearch/FindLights/Prefabs/UnlitTexture.mat.meta b/Assets/TangoResearch/LightEstimation/Prefabs/UnlitTexture.mat.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Prefabs/UnlitTexture.mat.meta rename to Assets/TangoResearch/LightEstimation/Prefabs/UnlitTexture.mat.meta diff --git a/Assets/TangoResearch/FindLights/Scripts.meta b/Assets/TangoResearch/LightEstimation/Scripts.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts.meta rename to Assets/TangoResearch/LightEstimation/Scripts.meta diff --git a/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs b/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs new file mode 100644 index 0000000..4eb9efc --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs @@ -0,0 +1,164 @@ +using UnityEngine; +using System.Collections; +using Tango; +using System.Collections.Generic; +using System.Linq; +using UnityEngine.UI; +using System; +using UnityEngine.Events; + +public class CubeLightManager : MonoBehaviour, ITangoVideoOverlay, ITangoLifecycle +{ + private TangoApplication _tangoApplication; + + public float _clusterAngle = 45f; + public int _ResDiv = 16; + public bool _SampleNeighbor = false; + + public RenderTexture _InTexture; + + public Light _LightA; + public Light _LightB; + public Light _LightC; + + public Transform _LightDirGizmoA; + public Transform _LightDirGizmoB; + public Transform _LightDirGizmoC; + + public Transform _ModelSphere; + public Transform _ModelLion; + + public TangoCubemap _TangoCube; + + public Slider _SliderClusterAngle; + + public Toggle _ToggleSphere; + public Toggle _ToggleLion; + + void Start () { + _tangoApplication = FindObjectOfType(); + if (_tangoApplication != null) + { + _tangoApplication.Register(this); + } + + _SliderClusterAngle.onValueChanged.AddListener(onValueChangedClusterAngle); + _ToggleSphere.onValueChanged.AddListener(delegate { onValueChangedModel("sphere"); }); + _ToggleLion.onValueChanged.AddListener(delegate { onValueChangedModel("lion"); }); + } + + private void onValueChangedClusterAngle(float val) + { + _clusterAngle = val; + } + + private void onValueChangedModel(string s) + { + if (_ToggleSphere.isOn) + { + _ModelSphere.gameObject.SetActive(true); + _ModelLion.gameObject.SetActive(false); + } + else + { + _ModelSphere.gameObject.SetActive(false); + _ModelLion.gameObject.SetActive(true); + } + } + + void Update () { + + } + + void LateUpdate() + { + _LightDirGizmoA.position = Camera.main.transform.position + Camera.main.transform.forward; + _LightDirGizmoB.position = Camera.main.transform.position + Camera.main.transform.forward; + _LightDirGizmoC.position = Camera.main.transform.position + Camera.main.transform.forward; + } + + private void doLightEstimation(TangoUnityImageData imageBuffer) + { + Vector3[,] pixels; +#if UNITY_ANDROID && !UNITY_EDITOR + pixels = TangoHelpers.ImageBufferToArray(imageBuffer, (uint)_ResDiv, true); +#else + pixels = ImageProcessing.RenderTextureToRGBArray(_InTexture); +#endif + + _TangoCube.UpdateCubeArrays(pixels); + _TangoCube.WriteToTexture(); + + if (_SampleNeighbor) + { + List lightDir = LightEstimationCube.EstimateLightDir_SampleNeighbor( + _TangoCube._posX, _TangoCube._negX, + _TangoCube._posY, _TangoCube._negY, + _TangoCube._posZ, _TangoCube._negZ, + transform.position, _clusterAngle); + + _LightA.transform.position = lightDir[lightDir.Count - 1]._Direction.normalized * 100; + _LightA.transform.LookAt(transform.position); + _LightA.color = ImageProcessing.Vector3ToColor( lightDir[lightDir.Count - 1]._Color); + + if (lightDir.Count >= 2 && lightDir[lightDir.Count - 2]._Magnitude > float.Epsilon) + { + _LightB.transform.position = lightDir[lightDir.Count - 2]._Direction.normalized * 100; + _LightB.transform.LookAt(transform.position); + _LightB.gameObject.SetActive(true); + _LightDirGizmoB.rotation = _LightB.transform.rotation; + _LightB.color = ImageProcessing.Vector3ToColor(lightDir[lightDir.Count - 2]._Color); + _LightDirGizmoB.gameObject.SetActive(true); + } + else + { + _LightB.gameObject.SetActive(false); + _LightDirGizmoB.gameObject.SetActive(false); + } + + if (lightDir.Count >= 3 && lightDir[lightDir.Count - 3]._Magnitude > float.Epsilon) + { + _LightC.transform.position = lightDir[lightDir.Count - 3]._Direction.normalized * 100; + _LightC.transform.LookAt(transform.position); + _LightC.gameObject.SetActive(true); + _LightDirGizmoC.rotation = _LightC.transform.rotation; + _LightC.color = ImageProcessing.Vector3ToColor(lightDir[lightDir.Count - 3]._Color); + _LightDirGizmoC.gameObject.SetActive(true); + } + else + { + _LightC.gameObject.SetActive(false); + _LightDirGizmoC.gameObject.SetActive(false); + } + + _LightDirGizmoA.rotation = _LightA.transform.rotation; + + return; + } + + } + + #region Tango Events + + public void OnTangoImageAvailableEventHandler(TangoEnums.TangoCameraId cameraId, TangoUnityImageData imageBuffer) + { + doLightEstimation(imageBuffer); + } + + public void OnTangoPermissions(bool permissionsGranted) + { + } + + public void OnTangoServiceConnected() + { + _tangoApplication.SetDepthCameraRate(TangoEnums.TangoDepthCameraRate.DISABLED); + } + + public void OnTangoServiceDisconnected() + { + } + + #endregion + + +} diff --git a/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs.meta new file mode 100644 index 0000000..1d7ca2a --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/CubeLightManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 940eb35284ada4a469db802b499ed15f +timeCreated: 1488064241 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/FindLights/Scripts/DisplayResult.cs b/Assets/TangoResearch/LightEstimation/Scripts/DisplayResult.cs similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/DisplayResult.cs rename to Assets/TangoResearch/LightEstimation/Scripts/DisplayResult.cs diff --git a/Assets/TangoResearch/FindLights/Scripts/DisplayResult.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/DisplayResult.cs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/DisplayResult.cs.meta rename to Assets/TangoResearch/LightEstimation/Scripts/DisplayResult.cs.meta diff --git a/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs b/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs new file mode 100644 index 0000000..fa47e8f --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs @@ -0,0 +1,84 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using System; + +public class FaceNode { + + public Vector3 _Direction; + + public bool _Visited = false; + + public Dictionary _NeiborAngles; + + public FaceNode(Vector3 direction) + { + _Direction = direction; + _NeiborAngles = new Dictionary(4); + } + + public void AddNeighbors(params FaceNode[] nodes) + { + if (this._Direction.magnitude <= float.Epsilon) + return; + + for (int i = 0; i < nodes.Length; i++) + { + float angle = Vector3.Angle(_Direction, nodes[i]._Direction); + _NeiborAngles.Add(nodes[i], angle); + nodes[i]._NeiborAngles.Add(this, angle); + } + } + + public void AddNeighbors(float degreeThreshold, params FaceNode[] nodes) + { + if (this._Direction.magnitude <= float.Epsilon) + return; + + for (int i = 0; i < nodes.Length; i++) + { + float angle = Vector3.Angle(_Direction, nodes[i]._Direction); + if (angle < degreeThreshold) + { + _NeiborAngles.Add(nodes[i], angle); + nodes[i]._NeiborAngles.Add(this, angle); + } + } + } + + public float GetNeighborSize(float degreeThreshold = 360) + { + float sum = 0; + int count = 0; + foreach (var item in _NeiborAngles) + { + if (item.Value < degreeThreshold) { + sum += item.Value; + count++; + } + } + + //Debug.Log("sum x count: " + sum + "x" + count); + + return sum/count; + } + + public static FaceNode[] CreateFaceNodes(float degreeThreshold, Vector3 negX, Vector3 posX, Vector3 negY, Vector3 posY, Vector3 negZ, Vector3 posZ) + { + FaceNode nX = new FaceNode(negX); + FaceNode pX = new FaceNode(posX); + FaceNode nY = new FaceNode(negY); + FaceNode pY = new FaceNode(posY); + FaceNode nZ = new FaceNode(negZ); + FaceNode pZ = new FaceNode(posZ); + + nX.AddNeighbors(degreeThreshold, nY, pY, nZ, pZ); + pX.AddNeighbors(degreeThreshold, nY, pY, nZ, pZ); + nY.AddNeighbors(degreeThreshold, nZ, pZ); + pY.AddNeighbors(degreeThreshold, nZ, pZ); + + return new FaceNode[] { nX, pX, nY, pY, nZ, pZ }; + } + + +} diff --git a/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs.meta new file mode 100644 index 0000000..9342076 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/FaceNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 20f73063ccc86c244a6967ed67046305 +timeCreated: 1488136803 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLight.cs b/Assets/TangoResearch/LightEstimation/Scripts/FindLight.cs similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/FindLight.cs rename to Assets/TangoResearch/LightEstimation/Scripts/FindLight.cs diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLight.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/FindLight.cs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/FindLight.cs.meta rename to Assets/TangoResearch/LightEstimation/Scripts/FindLight.cs.meta diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvManager.cs b/Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs similarity index 62% rename from Assets/TangoResearch/FindLights/Scripts/FindLightAdvManager.cs rename to Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs index 90cc106..3781a5c 100644 --- a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvManager.cs +++ b/Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs @@ -6,11 +6,13 @@ using System.Threading; using System; -public class FindLightAdvManager : MonoBehaviour, ITangoVideoOverlay, ITangoLifecycle +public class FindLightsCubemapManager : MonoBehaviour, ITangoVideoOverlay, ITangoLifecycle { public enum SuperpixelMethod { SLIC, CWATERSHED, NONE }; + public enum ScreenMode { MESH3D, ALBEDO, ERROR, RESULT }; public SuperpixelMethod _CurSuperpixelMethod = SuperpixelMethod.SLIC; + public ScreenMode _CurScreenMode = ScreenMode.RESULT; public Transform _PanelOptionsSLIC; public Transform _PanelOptionsWatershed; @@ -20,6 +22,11 @@ public enum SuperpixelMethod { SLIC, CWATERSHED, NONE }; public Toggle _ToggleCWatershed; public Toggle _ToggleDebugLights; + public Toggle _ToggleScreenMesh3D; + public Toggle _ToggleScreenAlbedo; + public Toggle _ToggleScreenError; + public Toggle _ToggleScreenResult; + public Slider _SliderClusterCount; public Slider _SliderResDiv; public Slider _SliderMaxIterations; @@ -35,15 +42,16 @@ public enum SuperpixelMethod { SLIC, CWATERSHED, NONE }; private TangoApplication _tangoApplication; public RenderTexture _InTexture; - public Texture2D _IoTexture; // Original intensity map. Used for visually comparing Io and Ir (reconstructed intensity) map. - public Texture2D _OutTexture; - private Texture2D tempTex; + public RenderTexture _Mesh3DTexture; + public Texture2D _AlbedoTexture; + public Texture2D _ErrorTexture; + private TangoUnityImageData _lastImageBuffer = null; public WatershedSegmentation _Watershed; public SLICSegmentation _SLIC; - private FindLightAdvanced _FLA; + private LightEstimation _FLA; public int _ClusterCount = 32; private int _maxIterations = 1; @@ -61,13 +69,12 @@ public enum SuperpixelMethod { SLIC, CWATERSHED, NONE }; private bool _debuggingLightPos = false; private bool _realtime = false; - private Dictionary _regionColors = new Dictionary(); - - public Material _ResultMat; - public Material _IoMat; + public Camera _Cam3DMesh; + //public Material _ResultMat; + //public Material _IoMat; public Transform _DebugLightOriginal; public Transform _DebugPointLight; - public Transform _DebugLightReceiver; + public RawImage _RawImageScreen; public void Start() { @@ -76,6 +83,11 @@ public void Start() _ToggleCWatershed.onValueChanged.AddListener(value => onValueChangedSuperpixelMethod(value, SuperpixelMethod.CWATERSHED)); _ToggleDebugLights.onValueChanged.AddListener(value => onValueChangedDebugLights(value)); + _ToggleScreenAlbedo.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.ALBEDO)); + _ToggleScreenError.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.ERROR)); + _ToggleScreenMesh3D.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.MESH3D)); + _ToggleScreenResult.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.RESULT)); + _SliderResDiv.onValueChanged.AddListener(onValueChangedResDiv); _SliderClusterCount.onValueChanged.AddListener(onValueChangedClusterCount); _SliderMaxIterations.onValueChanged.AddListener(onValueChangedMaxIterations); @@ -94,18 +106,13 @@ public void Start() _tangoApplication.Register(this); } - for (int i = 0; i < _ClusterCount; i++) - { - _regionColors.Add(i, ImageProcessing.RandomColor()); - } - - tempTex = new Texture2D(1280 / _ResDiv, 720 / _ResDiv); - tempTex.filterMode = FilterMode.Point; - tempTex.mipMapBias = 0; + _AlbedoTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv); + _AlbedoTexture.filterMode = FilterMode.Point; + _AlbedoTexture.mipMapBias = 0; - _IoTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv); - _IoTexture.filterMode = FilterMode.Point; - _IoTexture.mipMapBias = 0; + _Cam3DMesh.targetTexture = new RenderTexture((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv), 16, RenderTextureFormat.ARGB32); + _Cam3DMesh.targetTexture.filterMode = FilterMode.Bilinear; + _Cam3DMesh.targetTexture.mipMapBias = 0; _Watershed = new WatershedSegmentation(); _Watershed._ClusterCount = _ClusterCount; @@ -116,7 +123,7 @@ public void Start() _SLIC.ResidualErrorThreshold = _ErrorThreshold; _SLIC.Compactness = _Compactness; - _FLA = GetComponent(); + _FLA = GetComponent(); _FLA.SetupLightErrorGrid(); _SliderResDiv.maxValue = _sliderResLevelMax; @@ -125,26 +132,23 @@ public void Start() private void onValueChangedDebugLightXo(float value) { - //float x = _DebugLightOriginal.position.x; - float y = _DebugLightOriginal.position.y; - float z = _DebugLightOriginal.position.z; - _DebugLightOriginal.position = new Vector3(value - _FLA._LightErrorGrid.GetLength(0)/2f,y,z); + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(value - _FLA._LightErrorGrid.GetLength(0) / 2f, lPos.y, lPos.z); + _DebugLightOriginal.position = pos; } private void onValueChangedDebugLightYo(float value) { - float x = _DebugLightOriginal.position.x; - //float y = _DebugLightOriginal.position.y; - float z = _DebugLightOriginal.position.z; - _DebugLightOriginal.position = new Vector3(x, value - _FLA._LightErrorGrid.GetLength(1) / 2f, z); + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(lPos.x, value - _FLA._LightErrorGrid.GetLength(1) / 2f, lPos.z); + _DebugLightOriginal.position = pos; } private void onValueChangedDebugLightZo(float value) { - float x = _DebugLightOriginal.position.x; - float y = _DebugLightOriginal.position.y; - //float z = _DebugLightOriginal.position.z; - _DebugLightOriginal.position = new Vector3(x,y,value - _FLA._LightErrorGrid.GetLength(1) / 2f); + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(lPos.x, lPos.y, value - _FLA._LightErrorGrid.GetLength(2) / 2f); + _DebugLightOriginal.position = pos; } @@ -239,23 +243,42 @@ private void onValueChangedSuperpixelMethod(bool value, SuperpixelMethod superpi } } + private void onValueChangedScreenMode(ScreenMode screenMode) + { + _CurScreenMode = screenMode; + + switch (screenMode) + { + case ScreenMode.MESH3D: + break; + case ScreenMode.ALBEDO: + break; + case ScreenMode.ERROR: + break; + case ScreenMode.RESULT: + break; + default: + break; + } + } + private void onValueChangedResDiv(float value) { _ResDiv = (int)(8 - value) + 8; TangoCameraIntrinsics intrinsics = new TangoCameraIntrinsics(); VideoOverlayProvider.GetIntrinsics(TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, intrinsics); - _OutTexture = new Texture2D((int)(intrinsics.width / (float)_ResDiv), (int)(intrinsics.height / (float)_ResDiv), TextureFormat.RGBA32, false); - _OutTexture.filterMode = FilterMode.Point; - _OutTexture.anisoLevel = 0; + _ErrorTexture = new Texture2D((int)(intrinsics.width / (float)_ResDiv), (int)(intrinsics.height / (float)_ResDiv), TextureFormat.RGBA32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; - tempTex = new Texture2D((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv)); - tempTex.filterMode = FilterMode.Point; - tempTex.mipMapBias = 0; + _AlbedoTexture = new Texture2D((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv)); + _AlbedoTexture.filterMode = FilterMode.Point; + _AlbedoTexture.mipMapBias = 0; - _IoTexture = new Texture2D((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv)); - _IoTexture.filterMode = FilterMode.Point; - _IoTexture.mipMapBias = 0; + _Cam3DMesh.targetTexture = new RenderTexture((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv), 16, RenderTextureFormat.ARGB32); + _Cam3DMesh.targetTexture.filterMode = FilterMode.Bilinear; + _Cam3DMesh.targetTexture.mipMapBias = 0; } private void onValueChangedClusterCount(float value) @@ -289,42 +312,54 @@ private void drawSuperPixels(ref List superpixels) { foreach (Superpixel s in superpixels) { - - if (!_regionColors.ContainsKey(s.Label)) - { - _regionColors.Add(s.Label, ImageProcessing.RandomColor()); - } - + Color oC = new Color(); + Color iC = new Color(); float ns = 0; float albedo = 0; float Ir = 0; + float Io = s.Intensity / 255f; Vector3 lightDir = ImageProcessing.LightDirection(_FLA._EstimatedLightPos, s.WorldPoint); - ImageProcessing.ComputeAlbedo(s.Intensity / 255f, s.Normal, lightDir, out ns, out albedo); + ImageProcessing.ComputeAlbedo(Io, s.Normal, lightDir, out ns, out albedo); if (ns > 0) { - ImageProcessing.ComputeImageIntensity(albedo, s.Normal, lightDir, out Ir); + if (albedo > 2.5) + { + oC = Color.red; + iC = Color.red; + } + else + { + ImageProcessing.ComputeImageIntensity(albedo, s.Normal, lightDir, out Ir); + oC = new Color(Ir, Ir, Ir); + iC = new Color(albedo, albedo, albedo); + } } else { - if (!s.GetMedianSynthesizedIr(_OutTexture.width, _OutTexture.height, _FLA._EstimatedLightPos, out albedo, out Ir)) - { - Ir = 0; - } + oC = new Color(Ir, Ir, Ir); + iC = Color.cyan; } foreach (RegionPixel p in s.Pixels) { - //_OutTexture.SetPixel(p.X, _OutTexture.height - p.Y, _regionColors[s.Label]); - _OutTexture.SetPixel(p.X, _OutTexture.height - p.Y, new Color(Ir, Ir, Ir)); + if (Io - Ir == 0) + { + oC = Color.black; + } + else + { + oC = new Color(1, 1, 1); + } - _IoTexture.SetPixel(p.X, _OutTexture.height - p.Y, new Color(s.Intensity / 255f, s.Intensity / 255f, s.Intensity / 255f)); + _AlbedoTexture.SetPixel(p.X, _ErrorTexture.height - p.Y, iC); + _ErrorTexture.SetPixel(p.X, _ErrorTexture.height - p.Y, oC); } } - _OutTexture.Apply(); - _IoTexture.Apply(); + _ErrorTexture.Apply(); + _AlbedoTexture.Apply(); } private void drawRegionPixels(ref List rpixels) @@ -337,9 +372,10 @@ private void drawRegionPixels(ref List rpixels) float ns = 0; float albedo = 0; float Ir = 0; + float Io = r.Intensity / 255f; Vector3 lightDir = ImageProcessing.LightDirection(_FLA._EstimatedLightPos, r.WorldPoint); - ImageProcessing.ComputeAlbedo(r.Intensity / 255f, r.Normal, lightDir, out ns, out albedo); + ImageProcessing.ComputeAlbedo(Io, r.Normal, lightDir, out ns, out albedo); if (ns > 0) { if (albedo > 2.5) @@ -360,19 +396,27 @@ private void drawRegionPixels(ref List rpixels) iC = Color.cyan; } - _IoTexture.SetPixel(r.X, _OutTexture.height - r.Y, iC); - _OutTexture.SetPixel(r.X, _OutTexture.height - r.Y, oC); - } + if (Io - Ir == 0) + { + oC = Color.black; + } + else + { + oC = new Color(1, 1, 1); + } - _OutTexture.Apply(); - _IoTexture.Apply(); + //oC = ImageProcessing.Vector3ToColor(r.Normal); + + _AlbedoTexture.SetPixel(r.X, _ErrorTexture.height - r.Y, iC); + _ErrorTexture.SetPixel(r.X, _ErrorTexture.height - r.Y, oC); + } } private void doCompactWatershed() { //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); - Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_InTexture); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); //pixels = ImageProcessing.MedianFilter3x3(ref pixels); List superpixels; @@ -381,7 +425,7 @@ private void doCompactWatershed() foreach (Superpixel s in superpixels) { s.ComputeImageIntensity(); - s.ComputeSurfaceNormal(_OutTexture.width, _OutTexture.height); + s.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); } if (_debuggingLightPos) @@ -389,7 +433,7 @@ private void doCompactWatershed() Vector3 lightPos = Camera.main.transform.TransformPoint( _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, - -_debugLightPos.Z); + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); _FLA._EstimatedLightPos = lightPos; float[] Io = new float[superpixels.Count]; @@ -398,37 +442,37 @@ private void doCompactWatershed() Io[i] = superpixels[i].Intensity; } - float error = FindLightAdvanced.IoIrL2Norm(ref superpixels, Io, lightPos, _OutTexture.width, _OutTexture.height); + float error = LightEstimation.IoIrL2Norm(ref superpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); Debug.Log("LightPos: " + lightPos + " error: " + error); } else { - _FLA._EstimatedLightPos = _FLA.LightEstimation(ref superpixels, _OutTexture.width, _OutTexture.height); + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref superpixels, _ErrorTexture.width, _ErrorTexture.height); } //Debug.DrawRay(_estimatedLightPos, Camera.main.transform.position - _estimatedLightPos, Color.magenta); _DebugPointLight.transform.position = _FLA._EstimatedLightPos; - _DebugPointLight.transform.LookAt(_DebugLightReceiver); + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); drawSuperPixels(ref superpixels); - _ResultMat.mainTexture = _OutTexture; - _IoMat.mainTexture = _IoTexture; + //_ResultMat.mainTexture = _ErrorTexture; + //_IoMat.mainTexture = _AlbedoTexture; } private void doSLIC() { //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); - Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_InTexture); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); - pixels = ImageProcessing.MedianFilter3x3(ref pixels); + //pixels = ImageProcessing.MedianFilter3x3(ref pixels); List superpixels; List clusterCenters = _SLIC.RunSLICSegmentation(pixels, out superpixels); foreach (Superpixel s in superpixels) { s.ComputeImageIntensity(); - s.ComputeSurfaceNormal(_OutTexture.width, _OutTexture.height); + s.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); } if (_debuggingLightPos) @@ -436,7 +480,7 @@ private void doSLIC() Vector3 lightPos = Camera.main.transform.TransformPoint( _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, - -_debugLightPos.Z); + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); _FLA._EstimatedLightPos = lightPos; float[] Io = new float[superpixels.Count]; @@ -445,26 +489,37 @@ private void doSLIC() Io[i] = superpixels[i].Intensity / 255f; } - float error = FindLightAdvanced.IoIrL2Norm(ref superpixels, Io, lightPos, _OutTexture.width, _OutTexture.height); + float error = LightEstimation.IoIrL2Norm(ref superpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); Debug.Log("LightPos: " + lightPos + " error: " + error); } else { - _FLA._EstimatedLightPos = _FLA.LightEstimation(ref superpixels, _OutTexture.width, _OutTexture.height); + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref superpixels, _ErrorTexture.width, _ErrorTexture.height); } - //Debug.DrawRay(_estimatedLightPos, Camera.main.transform.position - _estimatedLightPos, Color.magenta); _DebugPointLight.transform.position = _FLA._EstimatedLightPos; - _DebugPointLight.transform.LookAt(_DebugLightReceiver); + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); drawSuperPixels(ref superpixels); - _ResultMat.mainTexture = _OutTexture; - _IoMat.mainTexture = _IoTexture; + //_ResultMat.mainTexture = _ErrorTexture; + //_IoMat.mainTexture = _AlbedoTexture; + } + + private Cubemap _cubeMap; + private void doLightEstimationCubemap() + { + Camera.main.RenderToCubemap(_cubeMap); + Vector3[,] negX = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.NegativeX); + Vector3[,] posX = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.PositiveX); + Vector3[,] negZ = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.NegativeZ); + Vector3[,] posZ = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.PositiveZ); + Vector3[,] negY = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.NegativeY); + Vector3[,] posY = ImageProcessing.CubemapFaceToRGBArray(_cubeMap, CubemapFace.PositiveY); } private void doLightEstimation() { //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); - Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_InTexture); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); //pixels = ImageProcessing.MedianFilter3x3(ref pixels); //float[,] edges = ImageProcessing.SobelFilter3x3(ref pixels, true); @@ -473,7 +528,7 @@ private void doLightEstimation() foreach (RegionPixel r in rpixels) { r.ComputeImageIntensity(); - r.ComputeSurfaceNormal(_OutTexture.width, _OutTexture.height); + r.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); } if (_debuggingLightPos) @@ -482,7 +537,7 @@ private void doLightEstimation() Vector3 lightPos = Camera.main.transform.TransformPoint( _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, - -_debugLightPos.Z); + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); _FLA._EstimatedLightPos = lightPos; @@ -492,20 +547,36 @@ private void doLightEstimation() Io[i] = rpixels[i].Intensity / 255f; } - float error = FindLightAdvanced.IoIrL2Norm(ref rpixels, Io, lightPos, _OutTexture.width, _OutTexture.height); + float error = LightEstimation.IoIrL2Norm(ref rpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); Debug.Log("LightPos: " + lightPos + " error: " + error); } else { - _FLA._EstimatedLightPos = _FLA.LightEstimation(ref rpixels, _OutTexture.width, _OutTexture.height); + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref rpixels, _ErrorTexture.width, _ErrorTexture.height); } - //Debug.DrawRay(_estimatedLightPos, Camera.main.transform.position - _estimatedLightPos, Color.magenta); _DebugPointLight.transform.position = _FLA._EstimatedLightPos; - _DebugPointLight.transform.LookAt(_DebugLightReceiver); + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); drawRegionPixels(ref rpixels); - _ResultMat.mainTexture = _OutTexture; - _IoMat.mainTexture = _IoTexture; + switch (_CurScreenMode) + { + case ScreenMode.MESH3D: + _RawImageScreen.texture = _Mesh3DTexture; + break; + case ScreenMode.ALBEDO: + _RawImageScreen.texture = _AlbedoTexture; + _AlbedoTexture.Apply(); + break; + case ScreenMode.ERROR: + _RawImageScreen.texture = _ErrorTexture; + _ErrorTexture.Apply(); + break; + case ScreenMode.RESULT: + _RawImageScreen.texture = _InTexture; + break; + default: + break; + } } private void superpixelSegmentation() @@ -550,18 +621,18 @@ public void OnTangoImageAvailableEventHandler(TangoEnums.TangoCameraId cameraId, public void OnTangoPermissions(bool permissionsGranted) { #if UNITY_EDITOR - _OutTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv, TextureFormat.ARGB32, false); - _OutTexture.filterMode = FilterMode.Point; - _OutTexture.anisoLevel = 0; + _ErrorTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv, TextureFormat.ARGB32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; #else TangoCameraIntrinsics intrinsics = new TangoCameraIntrinsics(); VideoOverlayProvider.GetIntrinsics(TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, intrinsics); - _OutTexture = new Texture2D((int)(intrinsics.width / _ResDiv), (int)(intrinsics.height / _ResDiv), TextureFormat.RGBA32, false); - _OutTexture.filterMode = FilterMode.Point; - _OutTexture.anisoLevel = 0; + _ErrorTexture = new Texture2D((int)(intrinsics.width / _ResDiv), (int)(intrinsics.height / _ResDiv), TextureFormat.RGBA32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; #endif - Debug.Log(_OutTexture.width + "x" + _OutTexture.height); + Debug.Log(_ErrorTexture.width + "x" + _ErrorTexture.height); } public void OnTangoServiceConnected() diff --git a/Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs.meta new file mode 100644 index 0000000..b430d5f --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/FindLightsCubemapManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 64ed914479abebd439aac15248ac4c16 +timeCreated: 1480870797 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/FindLights/Scripts/LightDetectorTestUI.cs b/Assets/TangoResearch/LightEstimation/Scripts/LightDetectorTestUI.cs similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/LightDetectorTestUI.cs rename to Assets/TangoResearch/LightEstimation/Scripts/LightDetectorTestUI.cs diff --git a/Assets/TangoResearch/FindLights/Scripts/LightDetectorTestUI.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/LightDetectorTestUI.cs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/LightDetectorTestUI.cs.meta rename to Assets/TangoResearch/LightEstimation/Scripts/LightDetectorTestUI.cs.meta diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightEstimation.cs b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimation.cs new file mode 100644 index 0000000..47583b4 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimation.cs @@ -0,0 +1,393 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +public class LightEstimation : MonoBehaviour { + + public Vector3 _EstimatedLightPos = Vector3.zero; + public float[,,] _LightErrorGrid; + + public void SetupLightErrorGrid(int size = 5) + { + _LightErrorGrid = new float[size, size, size]; + } + + public Vector3 GridBasedLightEstimation(ref List superpixels, int textureWidth, int textureHeight) + { + VectorInt3 minError = new VectorInt3(0, 0, 0); + Vector3 minLightPos = Vector3.zero; + float[] Io = new float[superpixels.Count]; + + for (int i = 0; i < superpixels.Count; i++) + { + Io[i] = superpixels[i].Intensity / 255f; + } + + for (int x = 0; x < _LightErrorGrid.GetLength(0); x++) + { + for (int y = 0; y < _LightErrorGrid.GetLength(1); y++) + { + for (int z = 0; z < _LightErrorGrid.GetLength(2); z++) + { + + Vector3 lightPos = Camera.main.transform.TransformPoint( + x - _LightErrorGrid.GetLength(0) / 2f, + y - _LightErrorGrid.GetLength(1) / 2f, + z - _LightErrorGrid.GetLength(2) / 2f); + + float error = IoIrL2Norm(ref superpixels, Io, lightPos, textureWidth, textureHeight); + _LightErrorGrid[x, y, z] = error; + + if (error < _LightErrorGrid[minError.X, minError.Y, minError.Z]) + { + minError = new VectorInt3(x, y, z); + minLightPos = lightPos; + } + + + } + } + } + + Debug.Log("LightPos: " + minLightPos + " error: " + _LightErrorGrid[minError.X, minError.Y, minError.Z]); + return minLightPos; + } + + public Vector3 GridBasedLightEstimation(ref List pixels, int textureWidth, int textureHeight) + { + VectorInt3 minError = new VectorInt3(0, 0, 0); + Vector3 minLightPos = Vector3.zero; + float[] Io = new float[pixels.Count]; + + for (int i = 0; i < pixels.Count; i++) + { + Io[i] = pixels[i].Intensity / 255f; + } + + for (int x = 0; x < _LightErrorGrid.GetLength(0); x++) + { + for (int y = 0; y < _LightErrorGrid.GetLength(1); y++) + { + for (int z = 0; z < _LightErrorGrid.GetLength(2); z++) + { + + Vector3 lightPos = Camera.main.transform.TransformPoint( + x - _LightErrorGrid.GetLength(0) / 2f, + y - _LightErrorGrid.GetLength(1) / 2f, + z - _LightErrorGrid.GetLength(2) / 2f); + + float error = IoIrL2Norm(ref pixels, Io, lightPos, textureWidth, textureHeight); + _LightErrorGrid[x, y, z] = error; + + if (error < _LightErrorGrid[minError.X, minError.Y, minError.Z]) + { + minError = new VectorInt3(x, y, z); + minLightPos = lightPos; + } + + + } + } + } + + Debug.Log("LightPos: " + minLightPos + " error: " + _LightErrorGrid[minError.X, minError.Y, minError.Z]); + return minLightPos; + } + + public Vector3 GridBasedLightEstimation(ref List pixels, int textureWidth, int textureHeight, ref List candidateDir) + { + float minError = float.MaxValue; + Vector3 minLightPos = Vector3.zero; + float[] Io = new float[pixels.Count]; + + for (int i = 0; i < pixels.Count; i++) + { + Io[i] = pixels[i].Intensity / 255f; + } + + for (int i = 0; i < candidateDir.Count; i++) + { + Vector3 lightPos = candidateDir[i]; + + float error = IoIrL2Norm(ref pixels, Io, lightPos, textureWidth, textureHeight); + + Debug.Log("LightPos: " + lightPos + " error: " + error); + + if (error < minError) + { + minError = error; + minLightPos = lightPos; + } + } + + Debug.Log("LightPos: " + minLightPos + " error: " + minError); + return minLightPos; + } + + /// + /// Estimates the light depth along a given direction. + /// + /// The pixels of the current frame. + /// Width of the texture. + /// Height of the texture. + /// The origin (Camera position). + /// The normalized light direction. + /// The maximum light depth. + /// + public Vector3 EstimateLightDepth(ref List pixels, int textureWidth, int textureHeight, Vector3 origin, Vector3 direction, float maxDepth = 10f) + { + float minError = float.MaxValue; + Vector3 result = origin; + float[] Io = new float[pixels.Count]; + + for (int i = 0; i < pixels.Count; i++) + { + Io[i] = pixels[i].Intensity / 255f; + } + + int t = 1; + for (int i = 1; i <= maxDepth; i++) + { + Vector3 curDepth = direction * i; + + float error = IoIrL2Norm(ref pixels, Io, curDepth, textureWidth, textureHeight); + + if (error < minError) + { + minError = error; + result = curDepth; + t = i; + } + + } + + return result; + } + + public static float IoIrL2Norm(ref List superpixels, float[] Io, Vector3 lightPos, int textureWidth, int textureHeight) + { + float[] Ir = new float[superpixels.Count]; + + float dist = 0; + for (int i = 0; i < superpixels.Count; i++) + { + if (superpixels[i].Normal.magnitude <= 0) + { + continue; + } + + float ns = 0; + float albedo = 0; + float ir = 0; + Vector3 lightDir = ImageProcessing.LightDirection(lightPos, superpixels[i].WorldPoint); + ImageProcessing.ComputeAlbedo(Io[i], superpixels[i].Normal, lightDir, out ns, out albedo); + if (ns > 0) + { + ImageProcessing.ComputeImageIntensity(albedo, superpixels[i].Normal, lightDir, out ir); + } + else + { + if (!superpixels[i].GetMedianSynthesizedIr(textureWidth, textureHeight, lightPos, out albedo, out ir)) + { + ir = Io[i]; + } + } + + + Ir[i] = ir; + dist += Mathf.Pow(Io[i] - Ir[i], 2); + } + dist = Mathf.Pow(dist, 0.5f); + + //if (_debuggingLightPos) + //{ + // Debug.Log("IoIr: " + dist); + //} + + return dist; + } + + public static float IoIrL2Norm(ref List pixels, float[] Io, Vector3 lightPos, int textureWidth, int textureHeight) + { + float[] Ir = new float[pixels.Count]; + + float dist = 0; + for (int i = 0; i < pixels.Count; i++) + { + if (pixels[i].Normal.magnitude <= 0) + { + continue; + } + + float ns = 0; + float albedo = 0; + float ir = 0; + Vector3 lightDir = ImageProcessing.LightDirection(lightPos, pixels[i].WorldPoint); + ImageProcessing.ComputeAlbedo(Io[i], pixels[i].Normal, lightDir, out ns, out albedo); + + if (ns > 0) + { + if (albedo > 2.5) + { + continue; + } + ImageProcessing.ComputeImageIntensity(albedo, pixels[i].Normal, lightDir, out ir); + } + else + { + //ir = 0; + ir = Io[i]; + } + + Ir[i] = ir; + dist += Mathf.Pow(Io[i] - Ir[i], 2); + } + dist = Mathf.Pow(dist, 0.5f); + + //if (_debuggingLightPos) + //{ + // Debug.Log("IoIr: " + dist); + //} + + return dist; + } + + /// + /// Given each face of a cubemap, returns six candidate light directions. + /// + /// The negative x face. + /// The position x face. + /// The negative y face. + /// The position y face. + /// The negative z face. + /// The position z face. + /// The camera position. + /// Size (width and height) of the cubemap. + /// A list of six candidate light directions. + public static List CandidateLightDirections( + Vector3[,] negX, Vector3[,] posX, + Vector3[,] negY, Vector3[,] posY, + Vector3[,] negZ, Vector3[,] posZ, + Vector3 camPos, + Vector2 cubemapSize) + { + List candidateDirections = new List(6); + float[] faceIntensity = new float[6]; + + Vector2 b = new Vector2(); + Vector3 dir = new Vector3(); + + float faceAve = 0f; + float cubeAve = 0f; + + // Positive directions. + b = ImageProcessing.BrightestPoint(posX, out faceAve); + dir = new Vector3( + 0.5f, + b.y / cubemapSize.y - 0.5f, + (1f - b.x / cubemapSize.x) - 0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(posX[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[0] = faceAve; + + b = ImageProcessing.BrightestPoint(posY, out faceAve); + dir = new Vector3( + b.x / cubemapSize.x - 0.5f, + 0.5f, + (1f - b.y / cubemapSize.y) - 0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(posY[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[1] = faceAve; + + b = ImageProcessing.BrightestPoint(posZ, out faceAve); + dir = new Vector3( + b.x / cubemapSize.x - 0.5f, + b.y / cubemapSize.y - 0.5f, + 0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(posZ[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[2] = faceAve; + + // Negative directions. + b = ImageProcessing.BrightestPoint(negX, out faceAve); + dir = new Vector3( + -0.5f, + b.y / cubemapSize.y - 0.5f, + b.x / cubemapSize.x - 0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(negX[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[3] = faceAve; + + b = ImageProcessing.BrightestPoint(negY, out faceAve); + dir = new Vector3( + b.x / cubemapSize.x - 0.5f, + -0.5f, + b.y / cubemapSize.y - 0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(negY[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[4] = faceAve; + + b = ImageProcessing.BrightestPoint(negZ, out faceAve); + dir = new Vector3( + (1f - b.x / cubemapSize.x) - 0.5f, + b.y / cubemapSize.y - 0.5f, + -0.5f); + dir.Normalize(); + dir *= ImageProcessing.Grayscale(ImageProcessing.Vector3ToColor(negZ[(int)b.x, (int)b.y])) / 1f; + candidateDirections.Add(dir); + cubeAve += faceAve; + faceIntensity[5] = faceAve; + + cubeAve /= 6f; + + for (int i = 0; i < 6; i++) + { + if (faceIntensity[i] < cubeAve && candidateDirections[i].magnitude < 0.75f) + { + candidateDirections[i] = Vector3.zero; + } + + //if (candidateDirections[i].magnitude < 0.75f) + //{ + // candidateDirections[i] = Vector3.zero; + //} + } + + return candidateDirections; + } + + + public static List SampleNeighbors(List dirs, + Vector3[,] negX, Vector3[,] posX, + Vector3[,] negY, Vector3[,] posY, + Vector3[,] negZ, Vector3[,] posZ, + float degree) + { + List result = new List(dirs.Count); + + for (int i = 0; i < dirs.Count; i++) + { + if (dirs[i].magnitude < float.Epsilon) { + continue; + } + + Vector3 c = TangoCubemap.SampleColorRange(dirs[i].normalized, posX.GetLength(0), degree, posX, negX, posY, negY, posZ, negZ); + + LightInfo li = new LightInfo(dirs[i], c); + + result.Add(li); + } + + return result; + } +} diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvanced.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimation.cs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/FindLightAdvanced.cs.meta rename to Assets/TangoResearch/LightEstimation/Scripts/LightEstimation.cs.meta diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs new file mode 100644 index 0000000..ebc3837 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs @@ -0,0 +1,343 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +public class LightEstimationCube : MonoBehaviour { + + + public int _CubeSize = 32; + public Cubemap _cubeMap; + + + public Texture2D _t2DPosX; + public Texture2D _t2DNegX; + public Texture2D _t2DPosY; + public Texture2D _t2DNegY; + public Texture2D _t2DPosZ; + public Texture2D _t2DNegZ; + + private void WriteToTexture(Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ) + { + for (int i = 0; i < _CubeSize; i++) + { + for (int j = 0; j < _CubeSize; j++) + { + _t2DPosX.SetPixel(i, j, ImageProcessing.Vector3ToColor(posX[i, j])); + _t2DNegX.SetPixel(i, j, ImageProcessing.Vector3ToColor(negX[i, j])); + _t2DPosY.SetPixel(i, j, ImageProcessing.Vector3ToColor(posY[i, j])); + _t2DNegY.SetPixel(i, j, ImageProcessing.Vector3ToColor(negY[i, j])); + _t2DPosZ.SetPixel(i, j, ImageProcessing.Vector3ToColor(posZ[i, j])); + _t2DNegZ.SetPixel(i, j, ImageProcessing.Vector3ToColor(negZ[i, j])); + } + } + _t2DPosX.Apply(); + _t2DNegX.Apply(); + _t2DPosY.Apply(); + _t2DNegY.Apply(); + _t2DPosZ.Apply(); + _t2DNegZ.Apply(); + + } + + private static VectorInt2 SmallestAngle(ref List verts, VectorInt2[] edges) + { + VectorInt2 result = new VectorInt2(); + + float minDist = float.MaxValue; + for (int i = 0; i < edges.Length; i++) + { + if (verts[edges[i].X] == Vector3.zero || verts[edges[i].Y] == Vector3.zero) + continue; + + //float cur = Vector3.Distance(verts[edges[i].X], verts[edges[i].Y]); + float cur = Vector3.Angle(verts[edges[i].X], verts[edges[i].Y]); + + if (cur < minDist) + { + minDist = cur; + result = new VectorInt2(edges[i]); + } + //Debug.Log("(" + i + ") " + cur + " result: " + result.ToString()); + } + + return result; + } + + private static List> GetLocalLights(params FaceNode[] faces) + { + List> clusters = new List>(); + + for (int i = 0; i < faces.Length; i++) + { + if (faces[i]._Visited || faces[i]._Direction.magnitude <= float.Epsilon) continue; + faces[i]._Visited = true; + + List c = new List(); + c.Add(faces[i]); + foreach (var item in faces[i]._NeiborAngles) + { + if (item.Key._Visited) continue; + c.Add(item.Key); + item.Key._Visited = true; + } + + clusters.Add(c); + } + + return clusters; + } + + private Vector3 EstimateLightDir(Cubemap cubeMap, Vector3 origin) + { + Vector3[,] negX = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeX); + Vector3[,] posX = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveX); + Vector3[,] negZ = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeZ); + Vector3[,] posZ = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveZ); + Vector3[,] negY = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeY); + Vector3[,] posY = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveY); + + if (Input.GetKeyDown(KeyCode.Alpha0)) + { + WriteToTexture(posX, negX, posY, negY, posZ, negZ); + } + + return EstimateLightDirSimple(posX, negX, posY, negY, posZ, negZ, origin); + + List lightDirs = LightEstimation.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + origin, new Vector2(cubeMap.width, cubeMap.height)); + + Debug.DrawRay(origin, lightDirs[0] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[1] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[2] * 5, Color.blue); + Debug.DrawRay(origin, lightDirs[3] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[4] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[5] * 5, Color.blue); + + VectorInt2[] edges = + { + new VectorInt2(0,1), new VectorInt2(0,2), new VectorInt2(0,4), new VectorInt2(0,5), + new VectorInt2(1,2), new VectorInt2(1,3), new VectorInt2(1,5), + new VectorInt2(2,3), new VectorInt2(2,4), + new VectorInt2(3,4), new VectorInt2(3,5), + new VectorInt2(4,5) + }; + VectorInt2 sEdge = LightEstimationCube.SmallestAngle(ref lightDirs, edges); + + float smallestAngle = Vector3.Angle(lightDirs[sEdge.X], lightDirs[sEdge.Y]); + Debug.Log("Shortest Angle: " + smallestAngle); + + Vector3[] estimatedDirs = new Vector3[2]; + if (smallestAngle > 45f) + { + int first = 0; + int second = 0; + float max = float.MinValue; + for (int i = 0; i < 6; i++) + { + float cur = lightDirs[i].magnitude; + if (cur > max) + { + max = cur; + second = first; + first = i; + } + } + //estimatedDir = lightDirs[first].normalized; + estimatedDirs[0] = lightDirs[first].normalized; + estimatedDirs[1] = lightDirs[second].normalized; + } + else + { + estimatedDirs[0] = ((lightDirs[sEdge.X] + lightDirs[sEdge.Y]) / 2f).normalized; + } + + + Debug.DrawRay(lightDirs[sEdge.X] * 5, + (lightDirs[sEdge.Y] - lightDirs[sEdge.X]).normalized * 5 * Vector3.Distance(lightDirs[sEdge.Y], lightDirs[sEdge.X]), + Color.black); + + //Debug.DrawRay(origin, lightDirs[0] * 5, Color.red); + //Debug.DrawRay(origin, lightDirs[1] * 5, Color.green); + //Debug.DrawRay(origin, lightDirs[2] * 5, Color.blue); + //Debug.DrawRay(origin, lightDirs[3] * 5, Color.red); + //Debug.DrawRay(origin, lightDirs[4] * 5, Color.green); + //Debug.DrawRay(origin, lightDirs[5] * 5, Color.blue); + + return estimatedDirs[0]; + } + + public static Vector3 EstimateLightDirSimple(Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ, + Vector3 origin) + { + List lightDirs = LightEstimation.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + origin, new Vector2(posX.GetLength(0), posX.GetLength(1))); + + Debug.DrawRay(origin, lightDirs[0] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[1] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[2] * 5, Color.blue); + Debug.DrawRay(origin, lightDirs[3] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[4] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[5] * 5, Color.blue); + + VectorInt2[] edges = + { + new VectorInt2(0,1), new VectorInt2(0,2), new VectorInt2(0,4), new VectorInt2(0,5), + new VectorInt2(1,2), new VectorInt2(1,3), new VectorInt2(1,5), + new VectorInt2(2,3), new VectorInt2(2,4), + new VectorInt2(3,4), new VectorInt2(3,5), + new VectorInt2(4,5) + }; + VectorInt2 sEdge = LightEstimationCube.SmallestAngle(ref lightDirs, edges); + + float smallestAngle = Vector3.Angle(lightDirs[sEdge.X], lightDirs[sEdge.Y]); + Debug.Log("Shortest Angle: " + smallestAngle); + + Vector3[] estimatedDirs = new Vector3[2]; + if (smallestAngle > 45f) + { + int first = 0; + int second = 0; + float max = float.MinValue; + for (int i = 0; i < 6; i++) + { + float cur = lightDirs[i].magnitude; + if (cur > max) + { + max = cur; + second = first; + first = i; + } + } + //estimatedDir = lightDirs[first].normalized; + estimatedDirs[0] = lightDirs[first].normalized; + estimatedDirs[1] = lightDirs[second].normalized; + } + else + { + estimatedDirs[0] = ((lightDirs[sEdge.X] + lightDirs[sEdge.Y]) / 2f).normalized; + } + + + Debug.DrawRay(lightDirs[sEdge.X] * 5, + (lightDirs[sEdge.Y] - lightDirs[sEdge.X]).normalized * 5 * Vector3.Distance(lightDirs[sEdge.Y], lightDirs[sEdge.X]), + Color.black); + + return estimatedDirs[0]; + } + + public static List EstimateLightDir(Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ, + Vector3 origin, + float clusterAngle) + { + List lightDirs = LightEstimation.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + origin, new Vector2(posX.GetLength(0), posX.GetLength(1))); + + Debug.DrawRay(origin, lightDirs[0] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[1] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[2] * 5, Color.blue); + Debug.DrawRay(origin, lightDirs[3] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[4] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[5] * 5, Color.blue); + + FaceNode[] faces = FaceNode.CreateFaceNodes(clusterAngle, + lightDirs[0], lightDirs[1], + lightDirs[2], lightDirs[3], + lightDirs[4], lightDirs[5]); + + List> clusters = GetLocalLights(faces); + Debug.Log("Angle " + clusterAngle + " clusters: " + clusters.Count); + + List estimatedDirections = new List(clusters.Count); + foreach (List l in clusters) + { + Vector3 dir = Vector3.zero; + foreach (FaceNode i in l) + { + dir += i._Direction; + } + dir /= l.Count; + estimatedDirections.Add(dir); + } + return estimatedDirections; + + } + + public static List EstimateLightDir_SampleNeighbor( + Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ, + Vector3 origin, + float clusterAngle) + { + List lightDirs = LightEstimation.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + origin, new Vector2(posX.GetLength(0), posX.GetLength(1))); + + List lightDirsN = LightEstimation.SampleNeighbors(lightDirs, negX, posX, negY, posY, negZ, posZ, 5); + + Debug.DrawRay(origin, lightDirs[0] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[1] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[2] * 5, Color.blue); + Debug.DrawRay(origin, lightDirs[3] * 5, Color.red); + Debug.DrawRay(origin, lightDirs[4] * 5, Color.green); + Debug.DrawRay(origin, lightDirs[5] * 5, Color.blue); + + //Debug.DrawRay(origin, lightDirsN[0] * 5, Color.Lerp(Color.red, Color.white, 0.75f)); + //Debug.DrawRay(origin, lightDirsN[1] * 5, Color.Lerp(Color.green, Color.white, 0.75f)); + //Debug.DrawRay(origin, lightDirsN[2] * 5, Color.Lerp(Color.blue, Color.white, 0.75f)); + //Debug.DrawRay(origin, lightDirsN[3] * 5, Color.Lerp(Color.red, Color.white, 0.75f)); + //Debug.DrawRay(origin, lightDirsN[4] * 5, Color.Lerp(Color.green, Color.white, 0.75f)); + //Debug.DrawRay(origin, lightDirsN[5] * 5, Color.Lerp(Color.blue, Color.white, 0.75f)); + for (int i = 0; i < lightDirsN.Count; i++) + { + Debug.DrawRay(origin, lightDirsN[i]._Direction * 5, Color.white); + } + + lightDirsN.Sort((a, b) => a._Magnitude.CompareTo(b._Magnitude)); + + return lightDirsN; + + } + + private void DoLightEstimationCubemap() + { + GameObject go = new GameObject("LightEstimationCube"); + go.AddComponent(); + go.transform.position = transform.position; + go.transform.rotation = transform.rotation; + go.GetComponent().cullingMask = 1 << LayerMask.NameToLayer("Misc"); + + if (!go.GetComponent().RenderToCubemap(_cubeMap)) + { + DestroyImmediate(go); + return; + } + + Vector3 estimatedDir = EstimateLightDir(_cubeMap, transform.position); + + DestroyImmediate(go); + } + + private void Start() + { + _cubeMap = new Cubemap(_CubeSize, TextureFormat.RGB24, false); + + _t2DPosX = new Texture2D(_CubeSize, _CubeSize); + _t2DNegX = new Texture2D(_CubeSize, _CubeSize); + _t2DPosY = new Texture2D(_CubeSize, _CubeSize); + _t2DNegY = new Texture2D(_CubeSize, _CubeSize); + _t2DPosZ = new Texture2D(_CubeSize, _CubeSize); + _t2DNegZ = new Texture2D(_CubeSize, _CubeSize); + } + + private void Update() + { + DoLightEstimationCubemap(); + } + +} diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs.meta new file mode 100644 index 0000000..4a0dd09 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationCube.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a9751ccc8bbf7d445bb4786f5afb705e +timeCreated: 1486257038 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationManager.cs b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationManager.cs new file mode 100644 index 0000000..ca5ba28 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationManager.cs @@ -0,0 +1,900 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using Tango; +using System.Collections.Generic; + +public class LightEstimationManager : MonoBehaviour, ITangoVideoOverlay, ITangoLifecycle +{ + + public enum SuperpixelMethod { SLIC, CWATERSHED, NONE }; + public enum ScreenMode { MESH3D, ALBEDO, ERROR, RESULT }; + public SuperpixelMethod _CurSuperpixelMethod = SuperpixelMethod.SLIC; + public ScreenMode _CurScreenMode = ScreenMode.RESULT; + + public Transform _PanelOptionsSLIC; + public Transform _PanelOptionsWatershed; + + public Button _ButtonCaptureCubemap; + + public Toggle _ToggleRealtime; + public Toggle _ToggleSLIC; + public Toggle _ToggleCWatershed; + public Toggle _ToggleDebugLights; + public Toggle _ToggleLightMode; + + public Toggle _ToggleScreenMesh3D; + public Toggle _ToggleScreenAlbedo; + public Toggle _ToggleScreenError; + public Toggle _ToggleScreenResult; + + + public Slider _SliderClusterCount; + public Slider _SliderResDiv; + public Slider _SliderMaxIterations; + public Slider _SliderBorderThreshold; + public Slider _SliderCompactness; + public Slider _SliderDebugLightX; + public Slider _SliderDebugLightY; + public Slider _SliderDebugLightZ; + public Slider _SliderDebugLightXo; + public Slider _SliderDebugLightYo; + public Slider _SliderDebugLightZo; + + private TangoApplication _tangoApplication; + + public RenderTexture _InTexture; + public RenderTexture _Mesh3DTexture; + public Texture2D _AlbedoTexture; + public Texture2D _ErrorTexture; + + + private TangoUnityImageData _lastImageBuffer = null; + + public WatershedSegmentation _Watershed; + public SLICSegmentation _SLIC; + private LightEstimation _FLA; + + public int _ClusterCount = 32; + private int _maxIterations = 1; + public int _ResDiv = 16; + public float _ErrorThreshold = 0.001f; + public int _BorderThreshold = 6; + public int _Compactness = 10; + + private static int _rSliderClusterCountMax = 128; + private static int _sliderClusterCountMax = 400; + private static int _rSliderResLevelMax = 9; + private static int _sliderResLevelMax = 11; + private VectorInt3 _debugLightPos = new VectorInt3(0, 0, 0); + + private bool _debuggingLightPos = false; + private bool _realtime = false; + private bool _pointLight = true; + + public Camera _Cam3DMesh; + public Camera _CamSim; + //public Material _ResultMat; + //public Material _IoMat; + public Transform _DebugLightOriginal; + public Transform _DebugPointLightA; + public Transform _DebugPointLightB; + public RawImage _RawImageScreen; + + public void Start() + { + _ToggleRealtime.onValueChanged.AddListener(value => onValueChangedRealtime(value)); + _ToggleSLIC.onValueChanged.AddListener(value => onValueChangedSuperpixelMethod(value, SuperpixelMethod.SLIC)); + _ToggleCWatershed.onValueChanged.AddListener(value => onValueChangedSuperpixelMethod(value, SuperpixelMethod.CWATERSHED)); + _ToggleDebugLights.onValueChanged.AddListener(value => onValueChangedDebugLights(value)); + _ToggleLightMode.onValueChanged.AddListener(value => onValueChangedLightMode(value)); + + _ToggleScreenAlbedo.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.ALBEDO)); + _ToggleScreenError.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.ERROR)); + _ToggleScreenMesh3D.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.MESH3D)); + _ToggleScreenResult.onValueChanged.AddListener(value => onValueChangedScreenMode(ScreenMode.RESULT)); + + + _SliderResDiv.onValueChanged.AddListener(onValueChangedResDiv); + _SliderClusterCount.onValueChanged.AddListener(onValueChangedClusterCount); + _SliderMaxIterations.onValueChanged.AddListener(onValueChangedMaxIterations); + _SliderBorderThreshold.onValueChanged.AddListener(onValueChangedBorderThreshold); + _SliderCompactness.onValueChanged.AddListener(onValueChangedCompactness); + _SliderDebugLightX.onValueChanged.AddListener(onValueChangedDebugLightX); + _SliderDebugLightY.onValueChanged.AddListener(onValueChangedDebugLightY); + _SliderDebugLightZ.onValueChanged.AddListener(onValueChangedDebugLightZ); + _SliderDebugLightXo.onValueChanged.AddListener(onValueChangedDebugLightXo); + _SliderDebugLightYo.onValueChanged.AddListener(onValueChangedDebugLightYo); + _SliderDebugLightZo.onValueChanged.AddListener(onValueChangedDebugLightZo); + + _tangoApplication = FindObjectOfType(); + if (_tangoApplication != null) + { + _tangoApplication.Register(this); + } + + _AlbedoTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv); + _AlbedoTexture.filterMode = FilterMode.Point; + _AlbedoTexture.mipMapBias = 0; + + _CamSim.targetTexture = new RenderTexture(1280, 720, 16, RenderTextureFormat.ARGB32); + _CamSim.targetTexture.filterMode = FilterMode.Bilinear; + _CamSim.targetTexture.mipMapBias = 0; + + _Cam3DMesh.targetTexture = new RenderTexture((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv), 16, RenderTextureFormat.ARGB32); + _Cam3DMesh.targetTexture.filterMode = FilterMode.Bilinear; + _Cam3DMesh.targetTexture.mipMapBias = 0; + + _Watershed = new WatershedSegmentation(); + _Watershed._ClusterCount = _ClusterCount; + _Watershed._BorderThreshold = _BorderThreshold; + + _SLIC = new SLICSegmentation(); + _SLIC.MaxIterations = _maxIterations; + _SLIC.ResidualErrorThreshold = _ErrorThreshold; + _SLIC.Compactness = _Compactness; + + _FLA = GetComponent(); + _FLA.SetupLightErrorGrid(); + + _SliderResDiv.maxValue = _sliderResLevelMax; + _SliderClusterCount.maxValue = _sliderClusterCountMax; + + } + + private void onClickCaptureCubemap() + { + + } + + private void onValueChangedLightMode(bool value) + { + _pointLight = value; + + _DebugPointLightA.GetComponent().type = (_pointLight) ? LightType.Point : LightType.Directional; + _DebugPointLightB.GetComponent().type = (_pointLight) ? LightType.Point : LightType.Directional; + } + + private void onValueChangedDebugLightXo(float value) + { + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(value - _FLA._LightErrorGrid.GetLength(0) / 2f, lPos.y, lPos.z); + _DebugLightOriginal.position = pos; + } + + private void onValueChangedDebugLightYo(float value) + { + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(lPos.x, value - _FLA._LightErrorGrid.GetLength(1) / 2f, lPos.z); + _DebugLightOriginal.position = pos; + } + + private void onValueChangedDebugLightZo(float value) + { + Vector3 lPos = Camera.main.transform.InverseTransformPoint(_DebugLightOriginal.position); + Vector3 pos = Camera.main.transform.TransformPoint(lPos.x, lPos.y, value - _FLA._LightErrorGrid.GetLength(2) / 2f); + _DebugLightOriginal.position = pos; + } + + + private void onValueChangedDebugLightX(float value) + { + _debugLightPos.X = (int)value; + } + + private void onValueChangedDebugLightY(float value) + { + _debugLightPos.Y = (int)value; + } + + private void onValueChangedDebugLightZ(float value) + { + _debugLightPos.Z = (int)value; + } + + private void onValueChangedDebugLights(bool value) + { + _debuggingLightPos = value; + } + + private void Update() + { + if (Input.touchCount == 1) + { + Touch t = Input.GetTouch(0); + if (t.phase != TouchPhase.Began || UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject(t.fingerId)) + { + return; + } + if (!_realtime) + { + StartCoroutine(superpixelSegmentationRoutine()); + } + } + else if (Input.GetMouseButtonDown(1)) + { + if (!_realtime) + { + StartCoroutine(superpixelSegmentationRoutine()); + + } + } + + } + + #region UI Events + + private void onValueChangedRealtime(bool value) + { + _realtime = value; + if (!_realtime) + { + MessageManager._MessageManager.PushMessage("Tap screen to render superpixels.", 3); + _SliderResDiv.maxValue = _sliderResLevelMax; + _SliderClusterCount.maxValue = _sliderClusterCountMax; + } + else + { + _maxIterations = 1; + _SliderResDiv.maxValue = _rSliderResLevelMax; + _SliderClusterCount.maxValue = _rSliderClusterCountMax; + } + } + + private void onValueChangedSuperpixelMethod(bool value, SuperpixelMethod superpixelMethod) + { + if (!value) + { + _CurSuperpixelMethod = SuperpixelMethod.NONE; + _PanelOptionsSLIC.gameObject.SetActive(false); + _PanelOptionsWatershed.gameObject.SetActive(false); + return; + } + + _CurSuperpixelMethod = superpixelMethod; + + switch (superpixelMethod) + { + case SuperpixelMethod.SLIC: + _PanelOptionsSLIC.gameObject.SetActive(true); + _PanelOptionsWatershed.gameObject.SetActive(false); + break; + case SuperpixelMethod.CWATERSHED: + _PanelOptionsSLIC.gameObject.SetActive(false); + _PanelOptionsWatershed.gameObject.SetActive(true); + break; + default: + break; + } + } + + private void onValueChangedScreenMode(ScreenMode screenMode) + { + _CurScreenMode = screenMode; + + switch (screenMode) + { + case ScreenMode.MESH3D: + break; + case ScreenMode.ALBEDO: + break; + case ScreenMode.ERROR: + break; + case ScreenMode.RESULT: + break; + default: + break; + } + } + + private void onValueChangedResDiv(float value) + { + _ResDiv = (int)(8 - value) + 8; + + TangoCameraIntrinsics intrinsics = new TangoCameraIntrinsics(); + VideoOverlayProvider.GetIntrinsics(TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, intrinsics); + _ErrorTexture = new Texture2D((int)(intrinsics.width / (float)_ResDiv), (int)(intrinsics.height / (float)_ResDiv), TextureFormat.RGBA32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; + + _AlbedoTexture = new Texture2D((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv)); + _AlbedoTexture.filterMode = FilterMode.Point; + _AlbedoTexture.mipMapBias = 0; + + _CamSim.targetTexture = new RenderTexture((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv), 16, RenderTextureFormat.ARGB32); + _CamSim.targetTexture.filterMode = FilterMode.Bilinear; + _CamSim.targetTexture.mipMapBias = 0; + + _Cam3DMesh.targetTexture = new RenderTexture((int)(1280 / (float)_ResDiv), (int)(720 / (float)_ResDiv), 16, RenderTextureFormat.ARGB32); + _Cam3DMesh.targetTexture.filterMode = FilterMode.Bilinear; + _Cam3DMesh.targetTexture.mipMapBias = 0; + } + + private void onValueChangedClusterCount(float value) + { + _ClusterCount = (int)value; + _SLIC._ClusterCount = _ClusterCount; + _Watershed._ClusterCount = _ClusterCount; + } + + private void onValueChangedMaxIterations(float value) + { + _maxIterations = (int)value; + _SLIC.MaxIterations = _maxIterations; + } + + private void onValueChangedBorderThreshold(float value) + { + _BorderThreshold = (int)value; + _Watershed._BorderThreshold = _BorderThreshold; + } + + private void onValueChangedCompactness(float value) + { + _Compactness = (int)value; + _SLIC.Compactness = _Compactness; + } + + #endregion + + private void exportCubemap(Cubemap cubemap) + { + + } + + private void drawSuperPixels(ref List superpixels) + { + foreach (Superpixel s in superpixels) + { + Color oC = new Color(); + Color iC = new Color(); + float ns = 0; + float albedo = 0; + float Ir = 0; + float Io = s.Intensity / 255f; + Vector3 lightDir = ImageProcessing.LightDirection(_FLA._EstimatedLightPos, s.WorldPoint); + + ImageProcessing.ComputeAlbedo(Io, s.Normal, lightDir, out ns, out albedo); + if (ns > 0) + { + if (albedo > 2.5) + { + oC = Color.red; + iC = Color.red; + } + else + { + ImageProcessing.ComputeImageIntensity(albedo, s.Normal, lightDir, out Ir); + oC = new Color(Ir, Ir, Ir); + iC = new Color(albedo, albedo, albedo); + } + } + else + { + oC = new Color(Ir, Ir, Ir); + iC = Color.cyan; + } + + foreach (RegionPixel p in s.Pixels) + { + if (Io - Ir == 0) + { + oC = Color.black; + } + else + { + oC = new Color(1, 1, 1); + } + + _AlbedoTexture.SetPixel(p.X, _ErrorTexture.height - p.Y, iC); + _ErrorTexture.SetPixel(p.X, _ErrorTexture.height - p.Y, oC); + } + + } + + _ErrorTexture.Apply(); + _AlbedoTexture.Apply(); + } + + private void drawRegionPixels(ref List rpixels) + { + foreach (RegionPixel r in rpixels) + { + Color oC = new Color(); + Color iC = new Color(); + + float ns = 0; + float albedo = 0; + float Ir = 0; + float Io = r.Intensity / 255f; + Vector3 lightDir = ImageProcessing.LightDirection(_FLA._EstimatedLightPos, r.WorldPoint); + + ImageProcessing.ComputeAlbedo(Io, r.Normal, lightDir, out ns, out albedo); + if (ns > 0) + { + if (albedo > 2.5) + { + oC = Color.red; + iC = Color.red; + } + else + { + ImageProcessing.ComputeImageIntensity(albedo, r.Normal, lightDir, out Ir); + oC = new Color(Ir, Ir, Ir); + iC = new Color(albedo, albedo, albedo); + } + } + else + { + oC = new Color(Ir, Ir, Ir); + iC = Color.cyan; + } + + if (Io - Ir == 0) + { + oC = Color.black; + } + else + { + oC = new Color(1, 1, 1); + } + + //oC = ImageProcessing.Vector3ToColor(r.Normal); + + _AlbedoTexture.SetPixel(r.X, _ErrorTexture.height - r.Y, iC); + _ErrorTexture.SetPixel(r.X, _ErrorTexture.height - r.Y, oC); + } + } + + + private void doCompactWatershed() + { + //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); + + //pixels = ImageProcessing.MedianFilter3x3(ref pixels); + List superpixels; + int[,] S = _Watershed.Run(pixels, out superpixels); + + foreach (Superpixel s in superpixels) + { + s.ComputeImageIntensity(); + s.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); + } + + if (_debuggingLightPos) + { + Vector3 lightPos = Camera.main.transform.TransformPoint( + _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, + _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); + _FLA._EstimatedLightPos = lightPos; + + float[] Io = new float[superpixels.Count]; + for (int i = 0; i < superpixels.Count; i++) + { + Io[i] = superpixels[i].Intensity; + } + + float error = LightEstimation.IoIrL2Norm(ref superpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); + Debug.Log("LightPos: " + lightPos + " error: " + error); + } + else + { + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref superpixels, _ErrorTexture.width, _ErrorTexture.height); + } + + + //Debug.DrawRay(_estimatedLightPos, Camera.main.transform.position - _estimatedLightPos, Color.magenta); + _DebugPointLightA.transform.position = _FLA._EstimatedLightPos; + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); + + drawSuperPixels(ref superpixels); + //_ResultMat.mainTexture = _ErrorTexture; + //_IoMat.mainTexture = _AlbedoTexture; + } + + private void doSLIC() + { + //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); + + //pixels = ImageProcessing.MedianFilter3x3(ref pixels); + List superpixels; + List clusterCenters = _SLIC.RunSLICSegmentation(pixels, out superpixels); + + foreach (Superpixel s in superpixels) + { + s.ComputeImageIntensity(); + s.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); + } + + if (_debuggingLightPos) + { + Vector3 lightPos = Camera.main.transform.TransformPoint( + _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, + _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); + _FLA._EstimatedLightPos = lightPos; + + float[] Io = new float[superpixels.Count]; + for (int i = 0; i < superpixels.Count; i++) + { + Io[i] = superpixels[i].Intensity / 255f; + } + + float error = LightEstimation.IoIrL2Norm(ref superpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); + Debug.Log("LightPos: " + lightPos + " error: " + error); + } + else + { + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref superpixels, _ErrorTexture.width, _ErrorTexture.height); + } + _DebugPointLightA.transform.position = _FLA._EstimatedLightPos; + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); + + drawSuperPixels(ref superpixels); + //_ResultMat.mainTexture = _ErrorTexture; + //_IoMat.mainTexture = _AlbedoTexture; + } + + private VectorInt2 SmallestAngle(ref List verts, VectorInt2[] edges) + { + VectorInt2 result = new VectorInt2(); + + float minDist = float.MaxValue; + for (int i = 0; i < edges.Length; i++) + { + if (verts[edges[i].X] == Vector3.zero || verts[edges[i].Y] == Vector3.zero) + continue; + + //float cur = Vector3.Distance(verts[edges[i].X], verts[edges[i].Y]); + float cur = Vector3.Angle(verts[edges[i].X], verts[edges[i].Y]); + cur /= (verts[edges[i].X].magnitude + verts[edges[i].Y].magnitude) / 2f; + + if (cur < minDist) + { + minDist = cur; + result = new VectorInt2(edges[i]); + } + //Debug.Log("(" + i + ") " + cur + " result: " + result.ToString()); + } + + return result; + } + + private Vector3[] estimateLightSourceTwo(Cubemap cubeMap, Vector3 camPos) + { + Vector3[,] negX = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeX); + Vector3[,] posX = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveX); + Vector3[,] negZ = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeZ); + Vector3[,] posZ = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveZ); + Vector3[,] negY = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.NegativeY); + Vector3[,] posY = ImageProcessing.CubemapFaceTo2DVector3Array(cubeMap, CubemapFace.PositiveY); + + List lightDirs = LightEstimation.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + camPos, new Vector2(cubeMap.width, cubeMap.height)); + + VectorInt2[] edges = + { + new VectorInt2(0,1), new VectorInt2(0,2), new VectorInt2(0,4), new VectorInt2(0,5), + new VectorInt2(1,2), new VectorInt2(1,3), new VectorInt2(1,5), + new VectorInt2(2,3), new VectorInt2(2,4), + new VectorInt2(3,4), new VectorInt2(3,5), + new VectorInt2(4,5) + }; + VectorInt2 sEdge = SmallestAngle(ref lightDirs, edges); + + float smallestAngle = Vector3.Angle(lightDirs[sEdge.X], lightDirs[sEdge.Y]); + Debug.Log("Shortest Angle: " + smallestAngle); + //Vector3 estimatedDir = Vector3.zero; + + Vector3[] estimatedDirs = new Vector3[2]; + if (smallestAngle > 22.5f) + { + int first = 0; + int second = 0; + float max = float.MinValue; + for (int i = 0; i < 6; i++) + { + float cur = lightDirs[i].magnitude; + if (cur > max) + { + max = cur; + second = first; + first = i; + } + } + //estimatedDir = lightDirs[first].normalized; + estimatedDirs[0] = lightDirs[first].normalized; + estimatedDirs[1] = lightDirs[second].normalized; + //_DebugPointLightB.gameObject.SetActive(true); + } + else + { + estimatedDirs[0] = ((lightDirs[sEdge.X] + lightDirs[sEdge.Y]) / 2f).normalized; + _DebugPointLightB.gameObject.SetActive(false); + } + + + Debug.DrawRay(lightDirs[sEdge.X] * 5, + (lightDirs[sEdge.Y] - lightDirs[sEdge.X]).normalized * 5 * Vector3.Distance(lightDirs[sEdge.Y], lightDirs[sEdge.X]), + Color.black); + + Debug.DrawRay(camPos, lightDirs[0] * 5, Color.red); + Debug.DrawRay(camPos, lightDirs[1] * 5, Color.green); + Debug.DrawRay(camPos, lightDirs[2] * 5, Color.blue); + Debug.DrawRay(camPos, lightDirs[3] * 5, Color.red); + Debug.DrawRay(camPos, lightDirs[4] * 5, Color.green); + Debug.DrawRay(camPos, lightDirs[5] * 5, Color.blue); + + return estimatedDirs; + } + + public Cubemap _cubeMap; + private void doLightEstimationCubemap() + { + + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); + List rpixels = RegionPixel.ToRegionPixels(pixels); + foreach (RegionPixel r in rpixels) + { + r.ComputeImageIntensity(); + r.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); + } + + GameObject go = new GameObject("CubemapCam"); + go.AddComponent(); + go.transform.position = Camera.main.transform.position; + go.transform.rotation = Camera.main.transform.rotation; + go.transform.Rotate(0, 45, 0); + go.GetComponent().cullingMask = 1 << 10 | 1 << 11; + + if (!go.GetComponent().RenderToCubemap(_cubeMap)) + { + DestroyImmediate(go); + return; + } + + Vector3[] estimatedDirs = estimateLightSourceTwo(_cubeMap, go.transform.position); + + //Vector3[,] negX = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.NegativeX); + //Vector3[,] posX = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.PositiveX); + //Vector3[,] negZ = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.NegativeZ); + //Vector3[,] posZ = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.PositiveZ); + //Vector3[,] negY = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.NegativeY); + //Vector3[,] posY = ImageProcessing.CubemapFaceTo2DVector3Array(_cubeMap, CubemapFace.PositiveY); + + //List lightDirs = _FLA.CandidateLightDirections(negX, posX, negY, posY, negZ, posZ, + // go.transform.position, new Vector2(_cubeMap.width, _cubeMap.height)); + + //VectorInt2[] edges = + //{ + // new VectorInt2(0,1), new VectorInt2(0,2), new VectorInt2(0,4), new VectorInt2(0,5), + // new VectorInt2(1,2), new VectorInt2(1,3), new VectorInt2(1,5), + // new VectorInt2(2,3), new VectorInt2(2,4), + // new VectorInt2(3,4), new VectorInt2(3,5), + // new VectorInt2(4,5) + //}; + //VectorInt2 sEdge = SmallestAngle(ref lightDirs, edges); + + //float smallestAngle = Vector3.Angle(lightDirs[sEdge.X], lightDirs[sEdge.Y]); + //Debug.Log("Shortest Angle: " + smallestAngle); + ////Vector3 estimatedDir = Vector3.zero; + + //Vector3[] estimatedDirs = new Vector3[2]; + //if (smallestAngle > 45f) + //{ + // int first = 0; + // int second = 0; + // float max = float.MinValue; + // for (int i = 0; i < 6; i++) + // { + // float cur = lightDirs[i].magnitude; + // if (cur > max) + // { + // max = cur; + // second = first; + // first = i; + // } + // } + // //estimatedDir = lightDirs[first].normalized; + // estimatedDirs[0] = lightDirs[first].normalized; + // estimatedDirs[1] = lightDirs[second].normalized; + // _DebugPointLightB.gameObject.SetActive(true); + //} + //else + //{ + // estimatedDirs[0] = ((lightDirs[sEdge.X] + lightDirs[sEdge.Y]) / 2f).normalized; + // _DebugPointLightB.gameObject.SetActive(false); + //} + + + //Debug.DrawRay(lightDirs[sEdge.X]*5, + // (lightDirs[sEdge.Y] - lightDirs[sEdge.X]).normalized *5* Vector3.Distance(lightDirs[sEdge.Y], lightDirs[sEdge.X]), + // Color.black); + + //Debug.DrawRay(go.transform.position, lightDirs[0] * 5, Color.red); + //Debug.DrawRay(go.transform.position, lightDirs[1] * 5, Color.green); + //Debug.DrawRay(go.transform.position, lightDirs[2] * 5, Color.blue); + //Debug.DrawRay(go.transform.position, lightDirs[3] * 5, Color.red); + //Debug.DrawRay(go.transform.position, lightDirs[4] * 5, Color.green); + //Debug.DrawRay(go.transform.position, lightDirs[5] * 5, Color.blue); + + if (_pointLight) + { + _FLA._EstimatedLightPos = _FLA.EstimateLightDepth(ref rpixels, _ErrorTexture.width, _ErrorTexture.height, go.transform.position, estimatedDirs[0], 6); + _DebugPointLightA.transform.position = _FLA._EstimatedLightPos; + } + else + { + _DebugPointLightA.position = estimatedDirs[0].normalized * 100; + _DebugPointLightA.LookAt(go.transform.position); + + _DebugPointLightB.position = estimatedDirs[1].normalized * 100; + _DebugPointLightB.LookAt(go.transform.position); + } + + switch (_CurScreenMode) + { + case ScreenMode.MESH3D: + _RawImageScreen.texture = _Cam3DMesh.targetTexture; + break; + case ScreenMode.ALBEDO: + //for (int i = 0; i < _AlbedoTexture.width; i++) + //{ + // for (int j = 0; j < _AlbedoTexture.height; j++) + // { + // int x = (int)(i * (_cubeMap.width / (float)_AlbedoTexture.width)); + // int y = (int)(j * (_cubeMap.height / (float)_AlbedoTexture.height)); + // _AlbedoTexture.SetPixel(i, j, ImageProcessing.Vector3ToColor(posZ[x, y])); + // } + //} + _RawImageScreen.texture = _AlbedoTexture; + _AlbedoTexture.Apply(); + break; + case ScreenMode.ERROR: + _RawImageScreen.texture = _InTexture; + _ErrorTexture.Apply(); + break; + case ScreenMode.RESULT: + _RawImageScreen.texture = _CamSim.targetTexture; + break; + default: + break; + } + DestroyImmediate(go); + } + + private void doLightEstimation() + { + //Vector3[,] pixels = TangoHelpers.ImageBufferToArray(_lastImageBuffer, (uint)_ResDiv, true); + Vector3[,] pixels = ImageProcessing.RenderTextureToRGBArray(_Cam3DMesh.targetTexture); + + //pixels = ImageProcessing.MedianFilter3x3(ref pixels); + //float[,] edges = ImageProcessing.SobelFilter3x3(ref pixels, true); + + List rpixels = RegionPixel.ToRegionPixels(pixels); + foreach (RegionPixel r in rpixels) + { + r.ComputeImageIntensity(); + r.ComputeSurfaceNormal(_ErrorTexture.width, _ErrorTexture.height); + } + + if (_debuggingLightPos) + { + + Vector3 lightPos = Camera.main.transform.TransformPoint( + _debugLightPos.X - _FLA._LightErrorGrid.GetLength(0) / 2f, + _debugLightPos.Y - _FLA._LightErrorGrid.GetLength(1) / 2f, + _debugLightPos.Z - _FLA._LightErrorGrid.GetLength(2) / 2f); + + _FLA._EstimatedLightPos = lightPos; + + float[] Io = new float[rpixels.Count]; + for (int i = 0; i < rpixels.Count; i++) + { + Io[i] = rpixels[i].Intensity / 255f; + } + + float error = LightEstimation.IoIrL2Norm(ref rpixels, Io, lightPos, _ErrorTexture.width, _ErrorTexture.height); + Debug.Log("LightPos: " + lightPos + " error: " + error); + } + else + { + _FLA._EstimatedLightPos = _FLA.GridBasedLightEstimation(ref rpixels, _ErrorTexture.width, _ErrorTexture.height); + } + _DebugPointLightA.transform.position = _FLA._EstimatedLightPos; + //_DebugPointLight.transform.LookAt(_DebugLightReceiver); + + drawRegionPixels(ref rpixels); + switch (_CurScreenMode) + { + case ScreenMode.MESH3D: + _RawImageScreen.texture = _Mesh3DTexture; + break; + case ScreenMode.ALBEDO: + _RawImageScreen.texture = _AlbedoTexture; + _AlbedoTexture.Apply(); + break; + case ScreenMode.ERROR: + _RawImageScreen.texture = _ErrorTexture; + _ErrorTexture.Apply(); + break; + case ScreenMode.RESULT: + _RawImageScreen.texture = _InTexture; + break; + default: + break; + } + } + + private void superpixelSegmentation() + { + doLightEstimationCubemap(); + return; + switch (_CurSuperpixelMethod) + { + case SuperpixelMethod.SLIC: + doSLIC(); + break; + case SuperpixelMethod.CWATERSHED: + doCompactWatershed(); + break; + case SuperpixelMethod.NONE: + doLightEstimation(); + break; + default: + break; + } + } + + private IEnumerator superpixelSegmentationRoutine() + { + MessageManager._MessageManager.PushMessage("Performing Superpixel Segmentation ..."); + yield return null; + superpixelSegmentation(); + } + + #region Tango Events + + public void OnTangoImageAvailableEventHandler(TangoEnums.TangoCameraId cameraId, TangoUnityImageData imageBuffer) + { + _lastImageBuffer = imageBuffer; + + if (_realtime) + { + superpixelSegmentation(); + } + + } + + public void OnTangoPermissions(bool permissionsGranted) + { +#if UNITY_EDITOR + _ErrorTexture = new Texture2D(1280 / _ResDiv, 720 / _ResDiv, TextureFormat.ARGB32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; +#else + TangoCameraIntrinsics intrinsics = new TangoCameraIntrinsics(); + VideoOverlayProvider.GetIntrinsics(TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, intrinsics); + _ErrorTexture = new Texture2D((int)(intrinsics.width / _ResDiv), (int)(intrinsics.height / _ResDiv), TextureFormat.RGBA32, false); + _ErrorTexture.filterMode = FilterMode.Point; + _ErrorTexture.anisoLevel = 0; +#endif + + Debug.Log(_ErrorTexture.width + "x" + _ErrorTexture.height); + } + + public void OnTangoServiceConnected() + { + //_tangoApplication.SetDepthCameraRate(TangoEnums.TangoDepthCameraRate.DISABLED); + } + + public void OnTangoServiceDisconnected() + { + } + + #endregion + +} diff --git a/Assets/TangoResearch/FindLights/Scripts/FindLightAdvManager.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/LightEstimationManager.cs.meta similarity index 100% rename from Assets/TangoResearch/FindLights/Scripts/FindLightAdvManager.cs.meta rename to Assets/TangoResearch/LightEstimation/Scripts/LightEstimationManager.cs.meta diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs b/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs new file mode 100644 index 0000000..88186f2 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs @@ -0,0 +1,23 @@ +using UnityEngine; +using System.Collections; + +public class LightInfo { + + public float _Magnitude; + public Vector3 _Color; + public Vector3 _Direction; + + public LightInfo(Vector3 direction, Vector3 color) { + _Direction = direction; + _Color = color; + _Magnitude = _Direction.magnitude; + } + + public LightInfo(Vector3 direction, Vector3 color, float magnitude) + { + _Direction = direction; + _Color = color; + _Magnitude = magnitude; + } + +} diff --git a/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs.meta b/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs.meta new file mode 100644 index 0000000..82ce512 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/Scripts/LightInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9c27b47f75f3714a926e2efa4c3b6ed +timeCreated: 1489029248 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets.meta b/Assets/TangoResearch/LightEstimation/SourceAssets.meta new file mode 100644 index 0000000..bc8c649 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 14b70ee0e8516e348b0925afc6174a17 +folderAsset: yes +timeCreated: 1483307464 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj b/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj new file mode 100644 index 0000000..5159dd3 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj @@ -0,0 +1,1608 @@ +# This file uses centimeters as units for non-parametric coordinates. + +g default +v 0.148778 -0.987688 -0.048341 +v 0.126558 -0.987688 -0.091950 +v 0.091950 -0.987688 -0.126558 +v 0.048341 -0.987688 -0.148778 +v 0.000000 -0.987688 -0.156435 +v -0.048341 -0.987688 -0.148778 +v -0.091950 -0.987688 -0.126558 +v -0.126558 -0.987688 -0.091950 +v -0.148778 -0.987688 -0.048341 +v -0.156435 -0.987688 0.000000 +v -0.148778 -0.987688 0.048341 +v -0.126558 -0.987688 0.091950 +v -0.091950 -0.987688 0.126558 +v -0.048341 -0.987688 0.148778 +v -0.000000 -0.987688 0.156434 +v 0.048341 -0.987688 0.148778 +v 0.091950 -0.987688 0.126558 +v 0.126558 -0.987688 0.091950 +v 0.148778 -0.987688 0.048341 +v 0.156434 -0.987688 0.000000 +v 0.293893 -0.951057 -0.095492 +v 0.250000 -0.951057 -0.181636 +v 0.181636 -0.951057 -0.250000 +v 0.095492 -0.951057 -0.293893 +v 0.000000 -0.951057 -0.309017 +v -0.095492 -0.951057 -0.293893 +v -0.181636 -0.951057 -0.250000 +v -0.250000 -0.951057 -0.181636 +v -0.293893 -0.951057 -0.095492 +v -0.309017 -0.951057 0.000000 +v -0.293893 -0.951057 0.095492 +v -0.250000 -0.951057 0.181636 +v -0.181636 -0.951057 0.250000 +v -0.095492 -0.951057 0.293893 +v -0.000000 -0.951057 0.309017 +v 0.095491 -0.951057 0.293893 +v 0.181636 -0.951057 0.250000 +v 0.250000 -0.951057 0.181636 +v 0.293893 -0.951057 0.095492 +v 0.309017 -0.951057 0.000000 +v 0.431771 -0.891007 -0.140291 +v 0.367286 -0.891007 -0.266849 +v 0.266849 -0.891007 -0.367286 +v 0.140291 -0.891007 -0.431771 +v 0.000000 -0.891007 -0.453991 +v -0.140291 -0.891007 -0.431771 +v -0.266849 -0.891007 -0.367286 +v -0.367286 -0.891007 -0.266849 +v -0.431771 -0.891007 -0.140291 +v -0.453991 -0.891007 0.000000 +v -0.431771 -0.891007 0.140291 +v -0.367286 -0.891007 0.266849 +v -0.266849 -0.891007 0.367286 +v -0.140291 -0.891007 0.431771 +v -0.000000 -0.891007 0.453991 +v 0.140291 -0.891007 0.431771 +v 0.266849 -0.891007 0.367286 +v 0.367286 -0.891007 0.266849 +v 0.431771 -0.891007 0.140291 +v 0.453991 -0.891007 0.000000 +v 0.559017 -0.809017 -0.181636 +v 0.475529 -0.809017 -0.345492 +v 0.345492 -0.809017 -0.475529 +v 0.181636 -0.809017 -0.559017 +v 0.000000 -0.809017 -0.587786 +v -0.181636 -0.809017 -0.559017 +v -0.345492 -0.809017 -0.475528 +v -0.475528 -0.809017 -0.345492 +v -0.559017 -0.809017 -0.181636 +v -0.587785 -0.809017 0.000000 +v -0.559017 -0.809017 0.181636 +v -0.475528 -0.809017 0.345492 +v -0.345492 -0.809017 0.475528 +v -0.181636 -0.809017 0.559017 +v -0.000000 -0.809017 0.587785 +v 0.181636 -0.809017 0.559017 +v 0.345491 -0.809017 0.475528 +v 0.475528 -0.809017 0.345492 +v 0.559017 -0.809017 0.181636 +v 0.587785 -0.809017 0.000000 +v 0.672499 -0.707107 -0.218508 +v 0.572062 -0.707107 -0.415627 +v 0.415627 -0.707107 -0.572062 +v 0.218508 -0.707107 -0.672499 +v 0.000000 -0.707107 -0.707107 +v -0.218508 -0.707107 -0.672499 +v -0.415627 -0.707107 -0.572062 +v -0.572062 -0.707107 -0.415627 +v -0.672499 -0.707107 -0.218508 +v -0.707107 -0.707107 0.000000 +v -0.672499 -0.707107 0.218508 +v -0.572062 -0.707107 0.415627 +v -0.415627 -0.707107 0.572061 +v -0.218508 -0.707107 0.672499 +v -0.000000 -0.707107 0.707107 +v 0.218508 -0.707107 0.672499 +v 0.415627 -0.707107 0.572061 +v 0.572061 -0.707107 0.415627 +v 0.672499 -0.707107 0.218508 +v 0.707107 -0.707107 0.000000 +v 0.769421 -0.587785 -0.250000 +v 0.654509 -0.587785 -0.475529 +v 0.475529 -0.587785 -0.654509 +v 0.250000 -0.587785 -0.769421 +v 0.000000 -0.587785 -0.809017 +v -0.250000 -0.587785 -0.769421 +v -0.475528 -0.587785 -0.654509 +v -0.654509 -0.587785 -0.475528 +v -0.769421 -0.587785 -0.250000 +v -0.809017 -0.587785 0.000000 +v -0.769421 -0.587785 0.250000 +v -0.654509 -0.587785 0.475528 +v -0.475528 -0.587785 0.654509 +v -0.250000 -0.587785 0.769421 +v -0.000000 -0.587785 0.809017 +v 0.250000 -0.587785 0.769421 +v 0.475528 -0.587785 0.654509 +v 0.654509 -0.587785 0.475528 +v 0.769421 -0.587785 0.250000 +v 0.809017 -0.587785 0.000000 +v 0.847398 -0.453991 -0.275336 +v 0.720840 -0.453991 -0.523721 +v 0.523721 -0.453991 -0.720840 +v 0.275336 -0.453991 -0.847398 +v 0.000000 -0.453991 -0.891007 +v -0.275336 -0.453991 -0.847398 +v -0.523721 -0.453991 -0.720840 +v -0.720840 -0.453991 -0.523721 +v -0.847398 -0.453991 -0.275336 +v -0.891007 -0.453991 0.000000 +v -0.847398 -0.453991 0.275336 +v -0.720840 -0.453991 0.523721 +v -0.523721 -0.453991 0.720840 +v -0.275336 -0.453991 0.847398 +v -0.000000 -0.453991 0.891007 +v 0.275336 -0.453991 0.847398 +v 0.523721 -0.453991 0.720840 +v 0.720839 -0.453991 0.523721 +v 0.847398 -0.453991 0.275336 +v 0.891007 -0.453991 0.000000 +v 0.904509 -0.309017 -0.293893 +v 0.769421 -0.309017 -0.559017 +v 0.559017 -0.309017 -0.769421 +v 0.293893 -0.309017 -0.904509 +v 0.000000 -0.309017 -0.951057 +v -0.293893 -0.309017 -0.904509 +v -0.559017 -0.309017 -0.769421 +v -0.769421 -0.309017 -0.559017 +v -0.904509 -0.309017 -0.293893 +v -0.951057 -0.309017 0.000000 +v -0.904509 -0.309017 0.293893 +v -0.769421 -0.309017 0.559017 +v -0.559017 -0.309017 0.769421 +v -0.293893 -0.309017 0.904509 +v -0.000000 -0.309017 0.951057 +v 0.293893 -0.309017 0.904509 +v 0.559017 -0.309017 0.769421 +v 0.769421 -0.309017 0.559017 +v 0.904509 -0.309017 0.293893 +v 0.951057 -0.309017 0.000000 +v 0.939348 -0.156434 -0.305213 +v 0.799057 -0.156434 -0.580549 +v 0.580549 -0.156434 -0.799057 +v 0.305213 -0.156434 -0.939348 +v 0.000000 -0.156434 -0.987689 +v -0.305213 -0.156434 -0.939348 +v -0.580549 -0.156434 -0.799057 +v -0.799057 -0.156434 -0.580549 +v -0.939348 -0.156434 -0.305213 +v -0.987689 -0.156434 0.000000 +v -0.939348 -0.156434 0.305213 +v -0.799057 -0.156434 0.580549 +v -0.580549 -0.156434 0.799057 +v -0.305213 -0.156434 0.939348 +v -0.000000 -0.156434 0.987688 +v 0.305212 -0.156434 0.939348 +v 0.580549 -0.156434 0.799057 +v 0.799057 -0.156434 0.580549 +v 0.939348 -0.156434 0.305212 +v 0.987688 -0.156434 0.000000 +v 0.951057 0.000000 -0.309017 +v 0.809018 0.000000 -0.587786 +v 0.587786 0.000000 -0.809017 +v 0.309017 0.000000 -0.951057 +v 0.000000 0.000000 -1.000000 +v -0.309017 0.000000 -0.951057 +v -0.587785 0.000000 -0.809017 +v -0.809017 0.000000 -0.587785 +v -0.951057 0.000000 -0.309017 +v -1.000000 0.000000 0.000000 +v -0.951057 0.000000 0.309017 +v -0.809017 0.000000 0.587785 +v -0.587785 0.000000 0.809017 +v -0.309017 0.000000 0.951057 +v -0.000000 0.000000 1.000000 +v 0.309017 0.000000 0.951057 +v 0.587785 0.000000 0.809017 +v 0.809017 0.000000 0.587785 +v 0.951057 0.000000 0.309017 +v 1.000000 0.000000 0.000000 +v 0.939348 0.156434 -0.305213 +v 0.799057 0.156434 -0.580549 +v 0.580549 0.156434 -0.799057 +v 0.305213 0.156434 -0.939348 +v 0.000000 0.156434 -0.987689 +v -0.305213 0.156434 -0.939348 +v -0.580549 0.156434 -0.799057 +v -0.799057 0.156434 -0.580549 +v -0.939348 0.156434 -0.305213 +v -0.987689 0.156434 0.000000 +v -0.939348 0.156434 0.305213 +v -0.799057 0.156434 0.580549 +v -0.580549 0.156434 0.799057 +v -0.305213 0.156434 0.939348 +v -0.000000 0.156434 0.987688 +v 0.305212 0.156434 0.939348 +v 0.580549 0.156434 0.799057 +v 0.799057 0.156434 0.580549 +v 0.939348 0.156434 0.305212 +v 0.987688 0.156434 0.000000 +v 0.904509 0.309017 -0.293893 +v 0.769421 0.309017 -0.559017 +v 0.559017 0.309017 -0.769421 +v 0.293893 0.309017 -0.904509 +v 0.000000 0.309017 -0.951057 +v -0.293893 0.309017 -0.904509 +v -0.559017 0.309017 -0.769421 +v -0.769421 0.309017 -0.559017 +v -0.904509 0.309017 -0.293893 +v -0.951057 0.309017 0.000000 +v -0.904509 0.309017 0.293893 +v -0.769421 0.309017 0.559017 +v -0.559017 0.309017 0.769421 +v -0.293893 0.309017 0.904509 +v -0.000000 0.309017 0.951057 +v 0.293893 0.309017 0.904509 +v 0.559017 0.309017 0.769421 +v 0.769421 0.309017 0.559017 +v 0.904509 0.309017 0.293893 +v 0.951057 0.309017 0.000000 +v 0.847398 0.453991 -0.275336 +v 0.720840 0.453991 -0.523721 +v 0.523721 0.453991 -0.720840 +v 0.275336 0.453991 -0.847398 +v 0.000000 0.453991 -0.891007 +v -0.275336 0.453991 -0.847398 +v -0.523721 0.453991 -0.720840 +v -0.720840 0.453991 -0.523721 +v -0.847398 0.453991 -0.275336 +v -0.891007 0.453991 0.000000 +v -0.847398 0.453991 0.275336 +v -0.720840 0.453991 0.523721 +v -0.523721 0.453991 0.720840 +v -0.275336 0.453991 0.847398 +v -0.000000 0.453991 0.891007 +v 0.275336 0.453991 0.847398 +v 0.523721 0.453991 0.720840 +v 0.720839 0.453991 0.523721 +v 0.847398 0.453991 0.275336 +v 0.891007 0.453991 0.000000 +v 0.769421 0.587785 -0.250000 +v 0.654509 0.587785 -0.475529 +v 0.475529 0.587785 -0.654509 +v 0.250000 0.587785 -0.769421 +v 0.000000 0.587785 -0.809017 +v -0.250000 0.587785 -0.769421 +v -0.475528 0.587785 -0.654509 +v -0.654509 0.587785 -0.475528 +v -0.769421 0.587785 -0.250000 +v -0.809017 0.587785 0.000000 +v -0.769421 0.587785 0.250000 +v -0.654509 0.587785 0.475528 +v -0.475528 0.587785 0.654509 +v -0.250000 0.587785 0.769421 +v -0.000000 0.587785 0.809017 +v 0.250000 0.587785 0.769421 +v 0.475528 0.587785 0.654509 +v 0.654509 0.587785 0.475528 +v 0.769421 0.587785 0.250000 +v 0.809017 0.587785 0.000000 +v 0.672499 0.707107 -0.218508 +v 0.572062 0.707107 -0.415627 +v 0.415627 0.707107 -0.572062 +v 0.218508 0.707107 -0.672499 +v 0.000000 0.707107 -0.707107 +v -0.218508 0.707107 -0.672499 +v -0.415627 0.707107 -0.572062 +v -0.572062 0.707107 -0.415627 +v -0.672499 0.707107 -0.218508 +v -0.707107 0.707107 0.000000 +v -0.672499 0.707107 0.218508 +v -0.572062 0.707107 0.415627 +v -0.415627 0.707107 0.572061 +v -0.218508 0.707107 0.672499 +v -0.000000 0.707107 0.707107 +v 0.218508 0.707107 0.672499 +v 0.415627 0.707107 0.572061 +v 0.572061 0.707107 0.415627 +v 0.672499 0.707107 0.218508 +v 0.707107 0.707107 0.000000 +v 0.559017 0.809017 -0.181636 +v 0.475529 0.809017 -0.345492 +v 0.345492 0.809017 -0.475529 +v 0.181636 0.809017 -0.559017 +v 0.000000 0.809017 -0.587786 +v -0.181636 0.809017 -0.559017 +v -0.345492 0.809017 -0.475528 +v -0.475528 0.809017 -0.345492 +v -0.559017 0.809017 -0.181636 +v -0.587785 0.809017 0.000000 +v -0.559017 0.809017 0.181636 +v -0.475528 0.809017 0.345492 +v -0.345492 0.809017 0.475528 +v -0.181636 0.809017 0.559017 +v -0.000000 0.809017 0.587785 +v 0.181636 0.809017 0.559017 +v 0.345491 0.809017 0.475528 +v 0.475528 0.809017 0.345492 +v 0.559017 0.809017 0.181636 +v 0.587785 0.809017 0.000000 +v 0.431771 0.891007 -0.140291 +v 0.367286 0.891007 -0.266849 +v 0.266849 0.891007 -0.367286 +v 0.140291 0.891007 -0.431771 +v 0.000000 0.891007 -0.453991 +v -0.140291 0.891007 -0.431771 +v -0.266849 0.891007 -0.367286 +v -0.367286 0.891007 -0.266849 +v -0.431771 0.891007 -0.140291 +v -0.453991 0.891007 0.000000 +v -0.431771 0.891007 0.140291 +v -0.367286 0.891007 0.266849 +v -0.266849 0.891007 0.367286 +v -0.140291 0.891007 0.431771 +v -0.000000 0.891007 0.453991 +v 0.140291 0.891007 0.431771 +v 0.266849 0.891007 0.367286 +v 0.367286 0.891007 0.266849 +v 0.431771 0.891007 0.140291 +v 0.453991 0.891007 0.000000 +v 0.293893 0.951057 -0.095492 +v 0.250000 0.951057 -0.181636 +v 0.181636 0.951057 -0.250000 +v 0.095492 0.951057 -0.293893 +v 0.000000 0.951057 -0.309017 +v -0.095492 0.951057 -0.293893 +v -0.181636 0.951057 -0.250000 +v -0.250000 0.951057 -0.181636 +v -0.293893 0.951057 -0.095492 +v -0.309017 0.951057 0.000000 +v -0.293893 0.951057 0.095492 +v -0.250000 0.951057 0.181636 +v -0.181636 0.951057 0.250000 +v -0.095492 0.951057 0.293893 +v -0.000000 0.951057 0.309017 +v 0.095491 0.951057 0.293893 +v 0.181636 0.951057 0.250000 +v 0.250000 0.951057 0.181636 +v 0.293893 0.951057 0.095492 +v 0.309017 0.951057 0.000000 +v 0.148778 0.987688 -0.048341 +v 0.126558 0.987688 -0.091950 +v 0.091950 0.987688 -0.126558 +v 0.048341 0.987688 -0.148778 +v 0.000000 0.987688 -0.156435 +v -0.048341 0.987688 -0.148778 +v -0.091950 0.987688 -0.126558 +v -0.126558 0.987688 -0.091950 +v -0.148778 0.987688 -0.048341 +v -0.156435 0.987688 0.000000 +v -0.148778 0.987688 0.048341 +v -0.126558 0.987688 0.091950 +v -0.091950 0.987688 0.126558 +v -0.048341 0.987688 0.148778 +v -0.000000 0.987688 0.156434 +v 0.048341 0.987688 0.148778 +v 0.091950 0.987688 0.126558 +v 0.126558 0.987688 0.091950 +v 0.148778 0.987688 0.048341 +v 0.156434 0.987688 0.000000 +v 0.000000 -1.000000 0.000000 +v 0.000000 1.000000 0.000000 +vt 0.000000 0.050000 +vt 0.050000 0.050000 +vt 0.100000 0.050000 +vt 0.150000 0.050000 +vt 0.200000 0.050000 +vt 0.250000 0.050000 +vt 0.300000 0.050000 +vt 0.350000 0.050000 +vt 0.400000 0.050000 +vt 0.450000 0.050000 +vt 0.500000 0.050000 +vt 0.550000 0.050000 +vt 0.600000 0.050000 +vt 0.650000 0.050000 +vt 0.700000 0.050000 +vt 0.750000 0.050000 +vt 0.800000 0.050000 +vt 0.850000 0.050000 +vt 0.900000 0.050000 +vt 0.950000 0.050000 +vt 1.000000 0.050000 +vt 0.000000 0.100000 +vt 0.050000 0.100000 +vt 0.100000 0.100000 +vt 0.150000 0.100000 +vt 0.200000 0.100000 +vt 0.250000 0.100000 +vt 0.300000 0.100000 +vt 0.350000 0.100000 +vt 0.400000 0.100000 +vt 0.450000 0.100000 +vt 0.500000 0.100000 +vt 0.550000 0.100000 +vt 0.600000 0.100000 +vt 0.650000 0.100000 +vt 0.700000 0.100000 +vt 0.750000 0.100000 +vt 0.800000 0.100000 +vt 0.850000 0.100000 +vt 0.900000 0.100000 +vt 0.950000 0.100000 +vt 1.000000 0.100000 +vt 0.000000 0.150000 +vt 0.050000 0.150000 +vt 0.100000 0.150000 +vt 0.150000 0.150000 +vt 0.200000 0.150000 +vt 0.250000 0.150000 +vt 0.300000 0.150000 +vt 0.350000 0.150000 +vt 0.400000 0.150000 +vt 0.450000 0.150000 +vt 0.500000 0.150000 +vt 0.550000 0.150000 +vt 0.600000 0.150000 +vt 0.650000 0.150000 +vt 0.700000 0.150000 +vt 0.750000 0.150000 +vt 0.800000 0.150000 +vt 0.850000 0.150000 +vt 0.900000 0.150000 +vt 0.950000 0.150000 +vt 1.000000 0.150000 +vt 0.000000 0.200000 +vt 0.050000 0.200000 +vt 0.100000 0.200000 +vt 0.150000 0.200000 +vt 0.200000 0.200000 +vt 0.250000 0.200000 +vt 0.300000 0.200000 +vt 0.350000 0.200000 +vt 0.400000 0.200000 +vt 0.450000 0.200000 +vt 0.500000 0.200000 +vt 0.550000 0.200000 +vt 0.600000 0.200000 +vt 0.650000 0.200000 +vt 0.700000 0.200000 +vt 0.750000 0.200000 +vt 0.800000 0.200000 +vt 0.850000 0.200000 +vt 0.900000 0.200000 +vt 0.950000 0.200000 +vt 1.000000 0.200000 +vt 0.000000 0.250000 +vt 0.050000 0.250000 +vt 0.100000 0.250000 +vt 0.150000 0.250000 +vt 0.200000 0.250000 +vt 0.250000 0.250000 +vt 0.300000 0.250000 +vt 0.350000 0.250000 +vt 0.400000 0.250000 +vt 0.450000 0.250000 +vt 0.500000 0.250000 +vt 0.550000 0.250000 +vt 0.600000 0.250000 +vt 0.650000 0.250000 +vt 0.700000 0.250000 +vt 0.750000 0.250000 +vt 0.800000 0.250000 +vt 0.850000 0.250000 +vt 0.900000 0.250000 +vt 0.950000 0.250000 +vt 1.000000 0.250000 +vt 0.000000 0.300000 +vt 0.050000 0.300000 +vt 0.100000 0.300000 +vt 0.150000 0.300000 +vt 0.200000 0.300000 +vt 0.250000 0.300000 +vt 0.300000 0.300000 +vt 0.350000 0.300000 +vt 0.400000 0.300000 +vt 0.450000 0.300000 +vt 0.500000 0.300000 +vt 0.550000 0.300000 +vt 0.600000 0.300000 +vt 0.650000 0.300000 +vt 0.700000 0.300000 +vt 0.750000 0.300000 +vt 0.800000 0.300000 +vt 0.850000 0.300000 +vt 0.900000 0.300000 +vt 0.950000 0.300000 +vt 1.000000 0.300000 +vt 0.000000 0.350000 +vt 0.050000 0.350000 +vt 0.100000 0.350000 +vt 0.150000 0.350000 +vt 0.200000 0.350000 +vt 0.250000 0.350000 +vt 0.300000 0.350000 +vt 0.350000 0.350000 +vt 0.400000 0.350000 +vt 0.450000 0.350000 +vt 0.500000 0.350000 +vt 0.550000 0.350000 +vt 0.600000 0.350000 +vt 0.650000 0.350000 +vt 0.700000 0.350000 +vt 0.750000 0.350000 +vt 0.800000 0.350000 +vt 0.850000 0.350000 +vt 0.900000 0.350000 +vt 0.950000 0.350000 +vt 1.000000 0.350000 +vt 0.000000 0.400000 +vt 0.050000 0.400000 +vt 0.100000 0.400000 +vt 0.150000 0.400000 +vt 0.200000 0.400000 +vt 0.250000 0.400000 +vt 0.300000 0.400000 +vt 0.350000 0.400000 +vt 0.400000 0.400000 +vt 0.450000 0.400000 +vt 0.500000 0.400000 +vt 0.550000 0.400000 +vt 0.600000 0.400000 +vt 0.650000 0.400000 +vt 0.700000 0.400000 +vt 0.750000 0.400000 +vt 0.800000 0.400000 +vt 0.850000 0.400000 +vt 0.900000 0.400000 +vt 0.950000 0.400000 +vt 1.000000 0.400000 +vt 0.000000 0.450000 +vt 0.050000 0.450000 +vt 0.100000 0.450000 +vt 0.150000 0.450000 +vt 0.200000 0.450000 +vt 0.250000 0.450000 +vt 0.300000 0.450000 +vt 0.350000 0.450000 +vt 0.400000 0.450000 +vt 0.450000 0.450000 +vt 0.500000 0.450000 +vt 0.550000 0.450000 +vt 0.600000 0.450000 +vt 0.650000 0.450000 +vt 0.700000 0.450000 +vt 0.750000 0.450000 +vt 0.800000 0.450000 +vt 0.850000 0.450000 +vt 0.900000 0.450000 +vt 0.950000 0.450000 +vt 1.000000 0.450000 +vt 0.000000 0.500000 +vt 0.050000 0.500000 +vt 0.100000 0.500000 +vt 0.150000 0.500000 +vt 0.200000 0.500000 +vt 0.250000 0.500000 +vt 0.300000 0.500000 +vt 0.350000 0.500000 +vt 0.400000 0.500000 +vt 0.450000 0.500000 +vt 0.500000 0.500000 +vt 0.550000 0.500000 +vt 0.600000 0.500000 +vt 0.650000 0.500000 +vt 0.700000 0.500000 +vt 0.750000 0.500000 +vt 0.800000 0.500000 +vt 0.850000 0.500000 +vt 0.900000 0.500000 +vt 0.950000 0.500000 +vt 1.000000 0.500000 +vt 0.000000 0.550000 +vt 0.050000 0.550000 +vt 0.100000 0.550000 +vt 0.150000 0.550000 +vt 0.200000 0.550000 +vt 0.250000 0.550000 +vt 0.300000 0.550000 +vt 0.350000 0.550000 +vt 0.400000 0.550000 +vt 0.450000 0.550000 +vt 0.500000 0.550000 +vt 0.550000 0.550000 +vt 0.600000 0.550000 +vt 0.650000 0.550000 +vt 0.700000 0.550000 +vt 0.750000 0.550000 +vt 0.800000 0.550000 +vt 0.850000 0.550000 +vt 0.900000 0.550000 +vt 0.950000 0.550000 +vt 1.000000 0.550000 +vt 0.000000 0.600000 +vt 0.050000 0.600000 +vt 0.100000 0.600000 +vt 0.150000 0.600000 +vt 0.200000 0.600000 +vt 0.250000 0.600000 +vt 0.300000 0.600000 +vt 0.350000 0.600000 +vt 0.400000 0.600000 +vt 0.450000 0.600000 +vt 0.500000 0.600000 +vt 0.550000 0.600000 +vt 0.600000 0.600000 +vt 0.650000 0.600000 +vt 0.700000 0.600000 +vt 0.750000 0.600000 +vt 0.800000 0.600000 +vt 0.850000 0.600000 +vt 0.900000 0.600000 +vt 0.950000 0.600000 +vt 1.000000 0.600000 +vt 0.000000 0.650000 +vt 0.050000 0.650000 +vt 0.100000 0.650000 +vt 0.150000 0.650000 +vt 0.200000 0.650000 +vt 0.250000 0.650000 +vt 0.300000 0.650000 +vt 0.350000 0.650000 +vt 0.400000 0.650000 +vt 0.450000 0.650000 +vt 0.500000 0.650000 +vt 0.550000 0.650000 +vt 0.600000 0.650000 +vt 0.650000 0.650000 +vt 0.700000 0.650000 +vt 0.750000 0.650000 +vt 0.800000 0.650000 +vt 0.850000 0.650000 +vt 0.900000 0.650000 +vt 0.950000 0.650000 +vt 1.000000 0.650000 +vt 0.000000 0.700000 +vt 0.050000 0.700000 +vt 0.100000 0.700000 +vt 0.150000 0.700000 +vt 0.200000 0.700000 +vt 0.250000 0.700000 +vt 0.300000 0.700000 +vt 0.350000 0.700000 +vt 0.400000 0.700000 +vt 0.450000 0.700000 +vt 0.500000 0.700000 +vt 0.550000 0.700000 +vt 0.600000 0.700000 +vt 0.650000 0.700000 +vt 0.700000 0.700000 +vt 0.750000 0.700000 +vt 0.800000 0.700000 +vt 0.850000 0.700000 +vt 0.900000 0.700000 +vt 0.950000 0.700000 +vt 1.000000 0.700000 +vt 0.000000 0.750000 +vt 0.050000 0.750000 +vt 0.100000 0.750000 +vt 0.150000 0.750000 +vt 0.200000 0.750000 +vt 0.250000 0.750000 +vt 0.300000 0.750000 +vt 0.350000 0.750000 +vt 0.400000 0.750000 +vt 0.450000 0.750000 +vt 0.500000 0.750000 +vt 0.550000 0.750000 +vt 0.600000 0.750000 +vt 0.650000 0.750000 +vt 0.700000 0.750000 +vt 0.750000 0.750000 +vt 0.800000 0.750000 +vt 0.850000 0.750000 +vt 0.900000 0.750000 +vt 0.950000 0.750000 +vt 1.000000 0.750000 +vt 0.000000 0.800000 +vt 0.050000 0.800000 +vt 0.100000 0.800000 +vt 0.150000 0.800000 +vt 0.200000 0.800000 +vt 0.250000 0.800000 +vt 0.300000 0.800000 +vt 0.350000 0.800000 +vt 0.400000 0.800000 +vt 0.450000 0.800000 +vt 0.500000 0.800000 +vt 0.550000 0.800000 +vt 0.600000 0.800000 +vt 0.650000 0.800000 +vt 0.700000 0.800000 +vt 0.750000 0.800000 +vt 0.800000 0.800000 +vt 0.850000 0.800000 +vt 0.900000 0.800000 +vt 0.950000 0.800000 +vt 1.000000 0.800000 +vt 0.000000 0.850000 +vt 0.050000 0.850000 +vt 0.100000 0.850000 +vt 0.150000 0.850000 +vt 0.200000 0.850000 +vt 0.250000 0.850000 +vt 0.300000 0.850000 +vt 0.350000 0.850000 +vt 0.400000 0.850000 +vt 0.450000 0.850000 +vt 0.500000 0.850000 +vt 0.550000 0.850000 +vt 0.600000 0.850000 +vt 0.650000 0.850000 +vt 0.700000 0.850000 +vt 0.750000 0.850000 +vt 0.800000 0.850000 +vt 0.850000 0.850000 +vt 0.900000 0.850000 +vt 0.950000 0.850000 +vt 1.000000 0.850000 +vt 0.000000 0.900000 +vt 0.050000 0.900000 +vt 0.100000 0.900000 +vt 0.150000 0.900000 +vt 0.200000 0.900000 +vt 0.250000 0.900000 +vt 0.300000 0.900000 +vt 0.350000 0.900000 +vt 0.400000 0.900000 +vt 0.450000 0.900000 +vt 0.500000 0.900000 +vt 0.550000 0.900000 +vt 0.600000 0.900000 +vt 0.650000 0.900000 +vt 0.700000 0.900000 +vt 0.750000 0.900000 +vt 0.800000 0.900000 +vt 0.850000 0.900000 +vt 0.900000 0.900000 +vt 0.950000 0.900000 +vt 1.000000 0.900000 +vt 0.000000 0.950000 +vt 0.050000 0.950000 +vt 0.100000 0.950000 +vt 0.150000 0.950000 +vt 0.200000 0.950000 +vt 0.250000 0.950000 +vt 0.300000 0.950000 +vt 0.350000 0.950000 +vt 0.400000 0.950000 +vt 0.450000 0.950000 +vt 0.500000 0.950000 +vt 0.550000 0.950000 +vt 0.600000 0.950000 +vt 0.650000 0.950000 +vt 0.700000 0.950000 +vt 0.750000 0.950000 +vt 0.800000 0.950000 +vt 0.850000 0.950000 +vt 0.900000 0.950000 +vt 0.950000 0.950000 +vt 1.000000 0.950000 +vt 0.025000 0.000000 +vt 0.075000 0.000000 +vt 0.125000 0.000000 +vt 0.175000 0.000000 +vt 0.225000 0.000000 +vt 0.275000 0.000000 +vt 0.325000 0.000000 +vt 0.375000 0.000000 +vt 0.425000 0.000000 +vt 0.475000 0.000000 +vt 0.525000 0.000000 +vt 0.575000 0.000000 +vt 0.625000 0.000000 +vt 0.675000 0.000000 +vt 0.725000 0.000000 +vt 0.775000 0.000000 +vt 0.825000 0.000000 +vt 0.875000 0.000000 +vt 0.925000 0.000000 +vt 0.975000 0.000000 +vt 0.025000 1.000000 +vt 0.075000 1.000000 +vt 0.125000 1.000000 +vt 0.175000 1.000000 +vt 0.225000 1.000000 +vt 0.275000 1.000000 +vt 0.325000 1.000000 +vt 0.375000 1.000000 +vt 0.425000 1.000000 +vt 0.475000 1.000000 +vt 0.525000 1.000000 +vt 0.575000 1.000000 +vt 0.625000 1.000000 +vt 0.675000 1.000000 +vt 0.725000 1.000000 +vt 0.775000 1.000000 +vt 0.825000 1.000000 +vt 0.875000 1.000000 +vt 0.925000 1.000000 +vt 0.975000 1.000000 +vn -0.190555 0.979722 0.061915 +vn -0.317252 0.942723 0.103081 +vn -0.269870 0.942723 0.196072 +vn -0.162096 0.979722 0.117769 +vn -0.196072 0.942723 0.269870 +vn -0.117769 0.979722 0.162095 +vn -0.103081 0.942723 0.317251 +vn -0.061915 0.979722 0.190555 +vn 0.000000 0.942723 0.333578 +vn 0.000000 0.979722 0.200361 +vn 0.103081 0.942723 0.317251 +vn 0.061915 0.979722 0.190555 +vn 0.196072 0.942722 0.269870 +vn 0.117769 0.979722 0.162095 +vn 0.269870 0.942723 0.196072 +vn 0.162096 0.979722 0.117769 +vn 0.317252 0.942722 0.103082 +vn 0.190555 0.979722 0.061915 +vn 0.333578 0.942722 0.000000 +vn 0.200361 0.979722 0.000000 +vn 0.317252 0.942722 -0.103081 +vn 0.190555 0.979722 -0.061915 +vn 0.269870 0.942723 -0.196072 +vn 0.162096 0.979722 -0.117769 +vn 0.196072 0.942723 -0.269870 +vn 0.117769 0.979722 -0.162095 +vn 0.103081 0.942723 -0.317252 +vn 0.061915 0.979722 -0.190555 +vn -0.000000 0.942723 -0.333578 +vn -0.000000 0.979722 -0.200361 +vn -0.103081 0.942722 -0.317252 +vn -0.061915 0.979722 -0.190555 +vn -0.196072 0.942722 -0.269871 +vn -0.117769 0.979722 -0.162096 +vn -0.269870 0.942722 -0.196073 +vn -0.162096 0.979722 -0.117769 +vn -0.317252 0.942722 -0.103082 +vn -0.190555 0.979722 -0.061915 +vn -0.333578 0.942722 -0.000000 +vn -0.200361 0.979722 -0.000001 +vn -0.447712 0.882266 0.145470 +vn -0.380846 0.882266 0.276701 +vn -0.276701 0.882266 0.380846 +vn -0.145470 0.882266 0.447711 +vn 0.000000 0.882266 0.470752 +vn 0.145470 0.882266 0.447711 +vn 0.276701 0.882266 0.380846 +vn 0.380846 0.882266 0.276701 +vn 0.447712 0.882266 0.145470 +vn 0.470752 0.882266 0.000000 +vn 0.447712 0.882266 -0.145470 +vn 0.380846 0.882266 -0.276701 +vn 0.276701 0.882266 -0.380846 +vn 0.145470 0.882266 -0.447712 +vn -0.000000 0.882266 -0.470752 +vn -0.145470 0.882266 -0.447712 +vn -0.276701 0.882266 -0.380846 +vn -0.380846 0.882266 -0.276701 +vn -0.447712 0.882266 -0.145470 +vn -0.470752 0.882266 -0.000001 +vn -0.570314 0.800252 0.185306 +vn -0.485138 0.800252 0.352474 +vn -0.352474 0.800252 0.485138 +vn -0.185306 0.800252 0.570314 +vn 0.000000 0.800252 0.599664 +vn 0.185307 0.800252 0.570314 +vn 0.352474 0.800252 0.485138 +vn 0.485138 0.800252 0.352473 +vn 0.570314 0.800252 0.185306 +vn 0.599664 0.800252 0.000000 +vn 0.570314 0.800252 -0.185306 +vn 0.485138 0.800252 -0.352474 +vn 0.352474 0.800252 -0.485138 +vn 0.185306 0.800252 -0.570314 +vn -0.000000 0.800252 -0.599664 +vn -0.185306 0.800252 -0.570315 +vn -0.352474 0.800252 -0.485139 +vn -0.485139 0.800252 -0.352474 +vn -0.570314 0.800252 -0.185306 +vn -0.599664 0.800252 -0.000001 +vn -0.680318 0.698789 0.221048 +vn -0.578712 0.698789 0.420459 +vn -0.420459 0.698789 0.578713 +vn -0.221049 0.698789 0.680318 +vn 0.000000 0.698789 0.715328 +vn 0.221049 0.698789 0.680318 +vn 0.420460 0.698789 0.578713 +vn 0.578713 0.698789 0.420459 +vn 0.680318 0.698789 0.221049 +vn 0.715328 0.698788 0.000000 +vn 0.680318 0.698789 -0.221049 +vn 0.578713 0.698788 -0.420460 +vn 0.420459 0.698788 -0.578713 +vn 0.221049 0.698788 -0.680318 +vn -0.000000 0.698789 -0.715328 +vn -0.221049 0.698789 -0.680318 +vn -0.420460 0.698788 -0.578713 +vn -0.578713 0.698788 -0.420459 +vn -0.680318 0.698788 -0.221049 +vn -0.715328 0.698788 -0.000001 +vn -0.774475 0.580401 0.251641 +vn -0.658808 0.580401 0.478652 +vn -0.478652 0.580401 0.658808 +vn -0.251642 0.580401 0.774475 +vn 0.000000 0.580401 0.814331 +vn 0.251642 0.580401 0.774475 +vn 0.478652 0.580401 0.658808 +vn 0.658808 0.580401 0.478652 +vn 0.774475 0.580401 0.251642 +vn 0.814331 0.580401 0.000000 +vn 0.774475 0.580401 -0.251642 +vn 0.658808 0.580401 -0.478652 +vn 0.478652 0.580401 -0.658808 +vn 0.251642 0.580401 -0.774475 +vn 0.000000 0.580401 -0.814331 +vn -0.251642 0.580401 -0.774475 +vn -0.478652 0.580401 -0.658808 +vn -0.658808 0.580401 -0.478652 +vn -0.774475 0.580401 -0.251642 +vn -0.814331 0.580400 -0.000001 +vn -0.850280 0.447994 0.276272 +vn -0.723291 0.447994 0.525502 +vn -0.525501 0.447994 0.723291 +vn -0.276272 0.447994 0.850279 +vn 0.000000 0.447994 0.894037 +vn 0.276273 0.447994 0.850279 +vn 0.525502 0.447994 0.723291 +vn 0.723291 0.447994 0.525501 +vn 0.850280 0.447994 0.276272 +vn 0.894037 0.447994 -0.000000 +vn 0.850280 0.447994 -0.276273 +vn 0.723291 0.447994 -0.525502 +vn 0.525502 0.447994 -0.723291 +vn 0.276273 0.447994 -0.850280 +vn -0.000000 0.447994 -0.894037 +vn -0.276273 0.447994 -0.850280 +vn -0.525502 0.447994 -0.723291 +vn -0.723291 0.447994 -0.525502 +vn -0.850280 0.447994 -0.276273 +vn -0.894037 0.447994 -0.000001 +vn -0.905806 0.304789 0.294313 +vn -0.770524 0.304789 0.559819 +vn -0.559818 0.304789 0.770524 +vn -0.294314 0.304789 0.905805 +vn 0.000000 0.304789 0.952420 +vn 0.294314 0.304789 0.905805 +vn 0.559819 0.304789 0.770524 +vn 0.770524 0.304789 0.559818 +vn 0.905805 0.304789 0.294314 +vn 0.952420 0.304789 -0.000000 +vn 0.905805 0.304789 -0.294314 +vn 0.770524 0.304788 -0.559819 +vn 0.559818 0.304788 -0.770524 +vn 0.294314 0.304789 -0.905805 +vn -0.000000 0.304789 -0.952420 +vn -0.294314 0.304789 -0.905805 +vn -0.559818 0.304789 -0.770524 +vn -0.770524 0.304789 -0.559818 +vn -0.905805 0.304788 -0.294314 +vn -0.952420 0.304788 -0.000001 +vn -0.939675 0.154249 0.305318 +vn -0.799335 0.154249 0.580751 +vn -0.580750 0.154249 0.799335 +vn -0.305319 0.154249 0.939674 +vn 0.000000 0.154249 0.988032 +vn 0.305319 0.154249 0.939674 +vn 0.580751 0.154249 0.799335 +vn 0.799335 0.154249 0.580751 +vn 0.939674 0.154248 0.305319 +vn 0.988032 0.154248 -0.000000 +vn 0.939674 0.154248 -0.305319 +vn 0.799335 0.154248 -0.580751 +vn 0.580751 0.154249 -0.799335 +vn 0.305319 0.154249 -0.939674 +vn -0.000000 0.154249 -0.988032 +vn -0.305319 0.154249 -0.939674 +vn -0.580751 0.154249 -0.799335 +vn -0.799335 0.154249 -0.580751 +vn -0.939674 0.154249 -0.305319 +vn -0.988032 0.154249 -0.000001 +vn -0.951057 0.000000 0.309016 +vn -0.809017 -0.000000 0.587785 +vn -0.587785 0.000000 0.809017 +vn -0.309017 0.000000 0.951057 +vn 0.000000 0.000000 1.000000 +vn 0.309017 -0.000000 0.951056 +vn 0.587786 -0.000000 0.809017 +vn 0.809017 -0.000000 0.587785 +vn 0.951057 -0.000000 0.309017 +vn 1.000000 0.000000 -0.000000 +vn 0.951057 0.000000 -0.309017 +vn 0.809017 -0.000000 -0.587785 +vn 0.587785 -0.000000 -0.809017 +vn 0.309017 -0.000000 -0.951057 +vn 0.000000 0.000000 -1.000000 +vn -0.309017 0.000000 -0.951057 +vn -0.587785 0.000000 -0.809017 +vn -0.809017 0.000000 -0.587785 +vn -0.951057 0.000000 -0.309017 +vn -1.000000 0.000000 -0.000001 +vn -0.939675 -0.154249 0.305318 +vn -0.799335 -0.154249 0.580751 +vn -0.580751 -0.154249 0.799335 +vn -0.305319 -0.154249 0.939674 +vn 0.000000 -0.154249 0.988032 +vn 0.305319 -0.154249 0.939674 +vn 0.580751 -0.154249 0.799335 +vn 0.799335 -0.154249 0.580751 +vn 0.939674 -0.154248 0.305319 +vn 0.988032 -0.154248 -0.000000 +vn 0.939674 -0.154248 -0.305319 +vn 0.799335 -0.154248 -0.580751 +vn 0.580751 -0.154249 -0.799335 +vn 0.305319 -0.154249 -0.939674 +vn -0.000000 -0.154249 -0.988032 +vn -0.305319 -0.154249 -0.939674 +vn -0.580751 -0.154249 -0.799335 +vn -0.799335 -0.154249 -0.580751 +vn -0.939674 -0.154248 -0.305319 +vn -0.988032 -0.154249 -0.000001 +vn -0.905806 -0.304789 0.294313 +vn -0.770524 -0.304789 0.559819 +vn -0.559818 -0.304789 0.770524 +vn -0.294314 -0.304789 0.905805 +vn 0.000000 -0.304789 0.952420 +vn 0.294314 -0.304789 0.905805 +vn 0.559819 -0.304789 0.770524 +vn 0.770524 -0.304789 0.559818 +vn 0.905805 -0.304789 0.294314 +vn 0.952420 -0.304789 -0.000000 +vn 0.905805 -0.304789 -0.294314 +vn 0.770524 -0.304788 -0.559819 +vn 0.559818 -0.304788 -0.770524 +vn 0.294314 -0.304789 -0.905805 +vn -0.000000 -0.304789 -0.952420 +vn -0.294314 -0.304789 -0.905805 +vn -0.559818 -0.304789 -0.770524 +vn -0.770524 -0.304789 -0.559818 +vn -0.905805 -0.304789 -0.294314 +vn -0.952420 -0.304789 -0.000001 +vn -0.850280 -0.447994 0.276272 +vn -0.723291 -0.447994 0.525502 +vn -0.525501 -0.447994 0.723291 +vn -0.276272 -0.447994 0.850280 +vn 0.000000 -0.447994 0.894037 +vn 0.276273 -0.447994 0.850279 +vn 0.525502 -0.447994 0.723291 +vn 0.723291 -0.447994 0.525501 +vn 0.850279 -0.447994 0.276272 +vn 0.894037 -0.447994 -0.000000 +vn 0.850279 -0.447994 -0.276273 +vn 0.723291 -0.447994 -0.525502 +vn 0.525502 -0.447994 -0.723291 +vn 0.276273 -0.447994 -0.850280 +vn -0.000000 -0.447994 -0.894037 +vn -0.276273 -0.447994 -0.850280 +vn -0.525502 -0.447994 -0.723291 +vn -0.723291 -0.447994 -0.525502 +vn -0.850280 -0.447994 -0.276273 +vn -0.894037 -0.447994 -0.000001 +vn -0.774475 -0.580401 0.251641 +vn -0.658808 -0.580401 0.478652 +vn -0.478652 -0.580401 0.658808 +vn -0.251642 -0.580401 0.774475 +vn 0.000000 -0.580401 0.814331 +vn 0.251642 -0.580401 0.774475 +vn 0.478652 -0.580401 0.658808 +vn 0.658808 -0.580401 0.478652 +vn 0.774475 -0.580401 0.251642 +vn 0.814331 -0.580401 -0.000000 +vn 0.774475 -0.580401 -0.251642 +vn 0.658808 -0.580401 -0.478652 +vn 0.478652 -0.580401 -0.658808 +vn 0.251642 -0.580401 -0.774475 +vn 0.000000 -0.580401 -0.814331 +vn -0.251642 -0.580401 -0.774475 +vn -0.478652 -0.580401 -0.658808 +vn -0.658808 -0.580401 -0.478652 +vn -0.774475 -0.580401 -0.251642 +vn -0.814331 -0.580400 -0.000001 +vn -0.680318 -0.698789 0.221048 +vn -0.578713 -0.698789 0.420460 +vn -0.420459 -0.698789 0.578713 +vn -0.221049 -0.698789 0.680318 +vn 0.000000 -0.698789 0.715328 +vn 0.221049 -0.698788 0.680318 +vn 0.420460 -0.698789 0.578713 +vn 0.578713 -0.698789 0.420459 +vn 0.680318 -0.698789 0.221049 +vn 0.715328 -0.698789 0.000000 +vn 0.680318 -0.698789 -0.221049 +vn 0.578713 -0.698789 -0.420460 +vn 0.420459 -0.698789 -0.578713 +vn 0.221049 -0.698788 -0.680318 +vn -0.000000 -0.698789 -0.715328 +vn -0.221049 -0.698789 -0.680318 +vn -0.420460 -0.698788 -0.578713 +vn -0.578713 -0.698788 -0.420459 +vn -0.680318 -0.698788 -0.221049 +vn -0.715328 -0.698788 -0.000001 +vn -0.570314 -0.800252 0.185306 +vn -0.485138 -0.800252 0.352474 +vn -0.352474 -0.800252 0.485138 +vn -0.185306 -0.800252 0.570314 +vn 0.000000 -0.800252 0.599664 +vn 0.185306 -0.800252 0.570314 +vn 0.352474 -0.800252 0.485138 +vn 0.485138 -0.800252 0.352474 +vn 0.570314 -0.800252 0.185306 +vn 0.599664 -0.800252 0.000000 +vn 0.570314 -0.800252 -0.185306 +vn 0.485138 -0.800252 -0.352474 +vn 0.352474 -0.800252 -0.485138 +vn 0.185306 -0.800252 -0.570314 +vn -0.000000 -0.800252 -0.599664 +vn -0.185306 -0.800252 -0.570315 +vn -0.352474 -0.800252 -0.485139 +vn -0.485139 -0.800252 -0.352474 +vn -0.570314 -0.800252 -0.185306 +vn -0.599664 -0.800252 -0.000001 +vn -0.447712 -0.882266 0.145470 +vn -0.380846 -0.882266 0.276701 +vn -0.276701 -0.882266 0.380846 +vn -0.145470 -0.882266 0.447712 +vn 0.000000 -0.882266 0.470752 +vn 0.145470 -0.882266 0.447711 +vn 0.276701 -0.882266 0.380846 +vn 0.380846 -0.882266 0.276701 +vn 0.447712 -0.882266 0.145470 +vn 0.470752 -0.882266 0.000000 +vn 0.447712 -0.882266 -0.145470 +vn 0.380846 -0.882266 -0.276701 +vn 0.276701 -0.882266 -0.380846 +vn 0.145470 -0.882266 -0.447712 +vn -0.000000 -0.882266 -0.470752 +vn -0.145470 -0.882266 -0.447712 +vn -0.276701 -0.882266 -0.380846 +vn -0.380846 -0.882266 -0.276701 +vn -0.447712 -0.882266 -0.145470 +vn -0.470752 -0.882266 -0.000000 +vn -0.317252 -0.942723 0.103081 +vn -0.269870 -0.942723 0.196072 +vn -0.196072 -0.942722 0.269870 +vn -0.103081 -0.942722 0.317252 +vn 0.000000 -0.942722 0.333578 +vn 0.103081 -0.942722 0.317252 +vn 0.196072 -0.942722 0.269870 +vn 0.269870 -0.942723 0.196072 +vn 0.317252 -0.942723 0.103081 +vn 0.333578 -0.942723 0.000000 +vn 0.317252 -0.942723 -0.103081 +vn 0.269870 -0.942723 -0.196072 +vn 0.196072 -0.942723 -0.269870 +vn 0.103081 -0.942722 -0.317252 +vn -0.000000 -0.942722 -0.333578 +vn -0.103081 -0.942722 -0.317252 +vn -0.196072 -0.942723 -0.269870 +vn -0.269870 -0.942723 -0.196072 +vn -0.317252 -0.942722 -0.103081 +vn -0.333578 -0.942722 -0.000000 +vn -0.190555 -0.979722 0.061915 +vn -0.162096 -0.979722 0.117769 +vn -0.117769 -0.979722 0.162095 +vn -0.061915 -0.979722 0.190555 +vn 0.000000 -0.979722 0.200361 +vn 0.061915 -0.979722 0.190555 +vn 0.117769 -0.979722 0.162095 +vn 0.162096 -0.979722 0.117769 +vn 0.190555 -0.979722 0.061915 +vn 0.200361 -0.979722 0.000000 +vn 0.190555 -0.979722 -0.061915 +vn 0.162096 -0.979722 -0.117770 +vn 0.117769 -0.979722 -0.162095 +vn 0.061915 -0.979722 -0.190554 +vn -0.000000 -0.979722 -0.200361 +vn -0.061915 -0.979722 -0.190555 +vn -0.117769 -0.979722 -0.162096 +vn -0.162096 -0.979722 -0.117769 +vn -0.190555 -0.979722 -0.061915 +vn -0.200361 -0.979722 -0.000000 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +s 1 +g pSphere1 +f 1/1/1 21/22/2 22/23/3 2/2/4 +f 2/2/4 22/23/3 23/24/5 3/3/6 +f 3/3/6 23/24/5 24/25/7 4/4/8 +f 4/4/8 24/25/7 25/26/9 5/5/10 +f 5/5/10 25/26/9 26/27/11 6/6/12 +f 6/6/12 26/27/11 27/28/13 7/7/14 +f 7/7/14 27/28/13 28/29/15 8/8/16 +f 8/8/16 28/29/15 29/30/17 9/9/18 +f 9/9/18 29/30/17 30/31/19 10/10/20 +f 10/10/20 30/31/19 31/32/21 11/11/22 +f 11/11/22 31/32/21 32/33/23 12/12/24 +f 12/12/24 32/33/23 33/34/25 13/13/26 +f 13/13/26 33/34/25 34/35/27 14/14/28 +f 14/14/28 34/35/27 35/36/29 15/15/30 +f 15/15/30 35/36/29 36/37/31 16/16/32 +f 16/16/32 36/37/31 37/38/33 17/17/34 +f 17/17/34 37/38/33 38/39/35 18/18/36 +f 18/18/36 38/39/35 39/40/37 19/19/38 +f 19/19/38 39/40/37 40/41/39 20/20/40 +f 20/20/40 40/41/39 21/42/2 1/21/1 +f 21/22/2 41/43/41 42/44/42 22/23/3 +f 22/23/3 42/44/42 43/45/43 23/24/5 +f 23/24/5 43/45/43 44/46/44 24/25/7 +f 24/25/7 44/46/44 45/47/45 25/26/9 +f 25/26/9 45/47/45 46/48/46 26/27/11 +f 26/27/11 46/48/46 47/49/47 27/28/13 +f 27/28/13 47/49/47 48/50/48 28/29/15 +f 28/29/15 48/50/48 49/51/49 29/30/17 +f 29/30/17 49/51/49 50/52/50 30/31/19 +f 30/31/19 50/52/50 51/53/51 31/32/21 +f 31/32/21 51/53/51 52/54/52 32/33/23 +f 32/33/23 52/54/52 53/55/53 33/34/25 +f 33/34/25 53/55/53 54/56/54 34/35/27 +f 34/35/27 54/56/54 55/57/55 35/36/29 +f 35/36/29 55/57/55 56/58/56 36/37/31 +f 36/37/31 56/58/56 57/59/57 37/38/33 +f 37/38/33 57/59/57 58/60/58 38/39/35 +f 38/39/35 58/60/58 59/61/59 39/40/37 +f 39/40/37 59/61/59 60/62/60 40/41/39 +f 40/41/39 60/62/60 41/63/41 21/42/2 +f 41/43/41 61/64/61 62/65/62 42/44/42 +f 42/44/42 62/65/62 63/66/63 43/45/43 +f 43/45/43 63/66/63 64/67/64 44/46/44 +f 44/46/44 64/67/64 65/68/65 45/47/45 +f 45/47/45 65/68/65 66/69/66 46/48/46 +f 46/48/46 66/69/66 67/70/67 47/49/47 +f 47/49/47 67/70/67 68/71/68 48/50/48 +f 48/50/48 68/71/68 69/72/69 49/51/49 +f 49/51/49 69/72/69 70/73/70 50/52/50 +f 50/52/50 70/73/70 71/74/71 51/53/51 +f 51/53/51 71/74/71 72/75/72 52/54/52 +f 52/54/52 72/75/72 73/76/73 53/55/53 +f 53/55/53 73/76/73 74/77/74 54/56/54 +f 54/56/54 74/77/74 75/78/75 55/57/55 +f 55/57/55 75/78/75 76/79/76 56/58/56 +f 56/58/56 76/79/76 77/80/77 57/59/57 +f 57/59/57 77/80/77 78/81/78 58/60/58 +f 58/60/58 78/81/78 79/82/79 59/61/59 +f 59/61/59 79/82/79 80/83/80 60/62/60 +f 60/62/60 80/83/80 61/84/61 41/63/41 +f 61/64/61 81/85/81 82/86/82 62/65/62 +f 62/65/62 82/86/82 83/87/83 63/66/63 +f 63/66/63 83/87/83 84/88/84 64/67/64 +f 64/67/64 84/88/84 85/89/85 65/68/65 +f 65/68/65 85/89/85 86/90/86 66/69/66 +f 66/69/66 86/90/86 87/91/87 67/70/67 +f 67/70/67 87/91/87 88/92/88 68/71/68 +f 68/71/68 88/92/88 89/93/89 69/72/69 +f 69/72/69 89/93/89 90/94/90 70/73/70 +f 70/73/70 90/94/90 91/95/91 71/74/71 +f 71/74/71 91/95/91 92/96/92 72/75/72 +f 72/75/72 92/96/92 93/97/93 73/76/73 +f 73/76/73 93/97/93 94/98/94 74/77/74 +f 74/77/74 94/98/94 95/99/95 75/78/75 +f 75/78/75 95/99/95 96/100/96 76/79/76 +f 76/79/76 96/100/96 97/101/97 77/80/77 +f 77/80/77 97/101/97 98/102/98 78/81/78 +f 78/81/78 98/102/98 99/103/99 79/82/79 +f 79/82/79 99/103/99 100/104/100 80/83/80 +f 80/83/80 100/104/100 81/105/81 61/84/61 +f 81/85/81 101/106/101 102/107/102 82/86/82 +f 82/86/82 102/107/102 103/108/103 83/87/83 +f 83/87/83 103/108/103 104/109/104 84/88/84 +f 84/88/84 104/109/104 105/110/105 85/89/85 +f 85/89/85 105/110/105 106/111/106 86/90/86 +f 86/90/86 106/111/106 107/112/107 87/91/87 +f 87/91/87 107/112/107 108/113/108 88/92/88 +f 88/92/88 108/113/108 109/114/109 89/93/89 +f 89/93/89 109/114/109 110/115/110 90/94/90 +f 90/94/90 110/115/110 111/116/111 91/95/91 +f 91/95/91 111/116/111 112/117/112 92/96/92 +f 92/96/92 112/117/112 113/118/113 93/97/93 +f 93/97/93 113/118/113 114/119/114 94/98/94 +f 94/98/94 114/119/114 115/120/115 95/99/95 +f 95/99/95 115/120/115 116/121/116 96/100/96 +f 96/100/96 116/121/116 117/122/117 97/101/97 +f 97/101/97 117/122/117 118/123/118 98/102/98 +f 98/102/98 118/123/118 119/124/119 99/103/99 +f 99/103/99 119/124/119 120/125/120 100/104/100 +f 100/104/100 120/125/120 101/126/101 81/105/81 +f 101/106/101 121/127/121 122/128/122 102/107/102 +f 102/107/102 122/128/122 123/129/123 103/108/103 +f 103/108/103 123/129/123 124/130/124 104/109/104 +f 104/109/104 124/130/124 125/131/125 105/110/105 +f 105/110/105 125/131/125 126/132/126 106/111/106 +f 106/111/106 126/132/126 127/133/127 107/112/107 +f 107/112/107 127/133/127 128/134/128 108/113/108 +f 108/113/108 128/134/128 129/135/129 109/114/109 +f 109/114/109 129/135/129 130/136/130 110/115/110 +f 110/115/110 130/136/130 131/137/131 111/116/111 +f 111/116/111 131/137/131 132/138/132 112/117/112 +f 112/117/112 132/138/132 133/139/133 113/118/113 +f 113/118/113 133/139/133 134/140/134 114/119/114 +f 114/119/114 134/140/134 135/141/135 115/120/115 +f 115/120/115 135/141/135 136/142/136 116/121/116 +f 116/121/116 136/142/136 137/143/137 117/122/117 +f 117/122/117 137/143/137 138/144/138 118/123/118 +f 118/123/118 138/144/138 139/145/139 119/124/119 +f 119/124/119 139/145/139 140/146/140 120/125/120 +f 120/125/120 140/146/140 121/147/121 101/126/101 +f 121/127/121 141/148/141 142/149/142 122/128/122 +f 122/128/122 142/149/142 143/150/143 123/129/123 +f 123/129/123 143/150/143 144/151/144 124/130/124 +f 124/130/124 144/151/144 145/152/145 125/131/125 +f 125/131/125 145/152/145 146/153/146 126/132/126 +f 126/132/126 146/153/146 147/154/147 127/133/127 +f 127/133/127 147/154/147 148/155/148 128/134/128 +f 128/134/128 148/155/148 149/156/149 129/135/129 +f 129/135/129 149/156/149 150/157/150 130/136/130 +f 130/136/130 150/157/150 151/158/151 131/137/131 +f 131/137/131 151/158/151 152/159/152 132/138/132 +f 132/138/132 152/159/152 153/160/153 133/139/133 +f 133/139/133 153/160/153 154/161/154 134/140/134 +f 134/140/134 154/161/154 155/162/155 135/141/135 +f 135/141/135 155/162/155 156/163/156 136/142/136 +f 136/142/136 156/163/156 157/164/157 137/143/137 +f 137/143/137 157/164/157 158/165/158 138/144/138 +f 138/144/138 158/165/158 159/166/159 139/145/139 +f 139/145/139 159/166/159 160/167/160 140/146/140 +f 140/146/140 160/167/160 141/168/141 121/147/121 +f 141/148/141 161/169/161 162/170/162 142/149/142 +f 142/149/142 162/170/162 163/171/163 143/150/143 +f 143/150/143 163/171/163 164/172/164 144/151/144 +f 144/151/144 164/172/164 165/173/165 145/152/145 +f 145/152/145 165/173/165 166/174/166 146/153/146 +f 146/153/146 166/174/166 167/175/167 147/154/147 +f 147/154/147 167/175/167 168/176/168 148/155/148 +f 148/155/148 168/176/168 169/177/169 149/156/149 +f 149/156/149 169/177/169 170/178/170 150/157/150 +f 150/157/150 170/178/170 171/179/171 151/158/151 +f 151/158/151 171/179/171 172/180/172 152/159/152 +f 152/159/152 172/180/172 173/181/173 153/160/153 +f 153/160/153 173/181/173 174/182/174 154/161/154 +f 154/161/154 174/182/174 175/183/175 155/162/155 +f 155/162/155 175/183/175 176/184/176 156/163/156 +f 156/163/156 176/184/176 177/185/177 157/164/157 +f 157/164/157 177/185/177 178/186/178 158/165/158 +f 158/165/158 178/186/178 179/187/179 159/166/159 +f 159/166/159 179/187/179 180/188/180 160/167/160 +f 160/167/160 180/188/180 161/189/161 141/168/141 +f 161/169/161 181/190/181 182/191/182 162/170/162 +f 162/170/162 182/191/182 183/192/183 163/171/163 +f 163/171/163 183/192/183 184/193/184 164/172/164 +f 164/172/164 184/193/184 185/194/185 165/173/165 +f 165/173/165 185/194/185 186/195/186 166/174/166 +f 166/174/166 186/195/186 187/196/187 167/175/167 +f 167/175/167 187/196/187 188/197/188 168/176/168 +f 168/176/168 188/197/188 189/198/189 169/177/169 +f 169/177/169 189/198/189 190/199/190 170/178/170 +f 170/178/170 190/199/190 191/200/191 171/179/171 +f 171/179/171 191/200/191 192/201/192 172/180/172 +f 172/180/172 192/201/192 193/202/193 173/181/173 +f 173/181/173 193/202/193 194/203/194 174/182/174 +f 174/182/174 194/203/194 195/204/195 175/183/175 +f 175/183/175 195/204/195 196/205/196 176/184/176 +f 176/184/176 196/205/196 197/206/197 177/185/177 +f 177/185/177 197/206/197 198/207/198 178/186/178 +f 178/186/178 198/207/198 199/208/199 179/187/179 +f 179/187/179 199/208/199 200/209/200 180/188/180 +f 180/188/180 200/209/200 181/210/181 161/189/161 +f 181/190/181 201/211/201 202/212/202 182/191/182 +f 182/191/182 202/212/202 203/213/203 183/192/183 +f 183/192/183 203/213/203 204/214/204 184/193/184 +f 184/193/184 204/214/204 205/215/205 185/194/185 +f 185/194/185 205/215/205 206/216/206 186/195/186 +f 186/195/186 206/216/206 207/217/207 187/196/187 +f 187/196/187 207/217/207 208/218/208 188/197/188 +f 188/197/188 208/218/208 209/219/209 189/198/189 +f 189/198/189 209/219/209 210/220/210 190/199/190 +f 190/199/190 210/220/210 211/221/211 191/200/191 +f 191/200/191 211/221/211 212/222/212 192/201/192 +f 192/201/192 212/222/212 213/223/213 193/202/193 +f 193/202/193 213/223/213 214/224/214 194/203/194 +f 194/203/194 214/224/214 215/225/215 195/204/195 +f 195/204/195 215/225/215 216/226/216 196/205/196 +f 196/205/196 216/226/216 217/227/217 197/206/197 +f 197/206/197 217/227/217 218/228/218 198/207/198 +f 198/207/198 218/228/218 219/229/219 199/208/199 +f 199/208/199 219/229/219 220/230/220 200/209/200 +f 200/209/200 220/230/220 201/231/201 181/210/181 +f 201/211/201 221/232/221 222/233/222 202/212/202 +f 202/212/202 222/233/222 223/234/223 203/213/203 +f 203/213/203 223/234/223 224/235/224 204/214/204 +f 204/214/204 224/235/224 225/236/225 205/215/205 +f 205/215/205 225/236/225 226/237/226 206/216/206 +f 206/216/206 226/237/226 227/238/227 207/217/207 +f 207/217/207 227/238/227 228/239/228 208/218/208 +f 208/218/208 228/239/228 229/240/229 209/219/209 +f 209/219/209 229/240/229 230/241/230 210/220/210 +f 210/220/210 230/241/230 231/242/231 211/221/211 +f 211/221/211 231/242/231 232/243/232 212/222/212 +f 212/222/212 232/243/232 233/244/233 213/223/213 +f 213/223/213 233/244/233 234/245/234 214/224/214 +f 214/224/214 234/245/234 235/246/235 215/225/215 +f 215/225/215 235/246/235 236/247/236 216/226/216 +f 216/226/216 236/247/236 237/248/237 217/227/217 +f 217/227/217 237/248/237 238/249/238 218/228/218 +f 218/228/218 238/249/238 239/250/239 219/229/219 +f 219/229/219 239/250/239 240/251/240 220/230/220 +f 220/230/220 240/251/240 221/252/221 201/231/201 +f 221/232/221 241/253/241 242/254/242 222/233/222 +f 222/233/222 242/254/242 243/255/243 223/234/223 +f 223/234/223 243/255/243 244/256/244 224/235/224 +f 224/235/224 244/256/244 245/257/245 225/236/225 +f 225/236/225 245/257/245 246/258/246 226/237/226 +f 226/237/226 246/258/246 247/259/247 227/238/227 +f 227/238/227 247/259/247 248/260/248 228/239/228 +f 228/239/228 248/260/248 249/261/249 229/240/229 +f 229/240/229 249/261/249 250/262/250 230/241/230 +f 230/241/230 250/262/250 251/263/251 231/242/231 +f 231/242/231 251/263/251 252/264/252 232/243/232 +f 232/243/232 252/264/252 253/265/253 233/244/233 +f 233/244/233 253/265/253 254/266/254 234/245/234 +f 234/245/234 254/266/254 255/267/255 235/246/235 +f 235/246/235 255/267/255 256/268/256 236/247/236 +f 236/247/236 256/268/256 257/269/257 237/248/237 +f 237/248/237 257/269/257 258/270/258 238/249/238 +f 238/249/238 258/270/258 259/271/259 239/250/239 +f 239/250/239 259/271/259 260/272/260 240/251/240 +f 240/251/240 260/272/260 241/273/241 221/252/221 +f 241/253/241 261/274/261 262/275/262 242/254/242 +f 242/254/242 262/275/262 263/276/263 243/255/243 +f 243/255/243 263/276/263 264/277/264 244/256/244 +f 244/256/244 264/277/264 265/278/265 245/257/245 +f 245/257/245 265/278/265 266/279/266 246/258/246 +f 246/258/246 266/279/266 267/280/267 247/259/247 +f 247/259/247 267/280/267 268/281/268 248/260/248 +f 248/260/248 268/281/268 269/282/269 249/261/249 +f 249/261/249 269/282/269 270/283/270 250/262/250 +f 250/262/250 270/283/270 271/284/271 251/263/251 +f 251/263/251 271/284/271 272/285/272 252/264/252 +f 252/264/252 272/285/272 273/286/273 253/265/253 +f 253/265/253 273/286/273 274/287/274 254/266/254 +f 254/266/254 274/287/274 275/288/275 255/267/255 +f 255/267/255 275/288/275 276/289/276 256/268/256 +f 256/268/256 276/289/276 277/290/277 257/269/257 +f 257/269/257 277/290/277 278/291/278 258/270/258 +f 258/270/258 278/291/278 279/292/279 259/271/259 +f 259/271/259 279/292/279 280/293/280 260/272/260 +f 260/272/260 280/293/280 261/294/261 241/273/241 +f 261/274/261 281/295/281 282/296/282 262/275/262 +f 262/275/262 282/296/282 283/297/283 263/276/263 +f 263/276/263 283/297/283 284/298/284 264/277/264 +f 264/277/264 284/298/284 285/299/285 265/278/265 +f 265/278/265 285/299/285 286/300/286 266/279/266 +f 266/279/266 286/300/286 287/301/287 267/280/267 +f 267/280/267 287/301/287 288/302/288 268/281/268 +f 268/281/268 288/302/288 289/303/289 269/282/269 +f 269/282/269 289/303/289 290/304/290 270/283/270 +f 270/283/270 290/304/290 291/305/291 271/284/271 +f 271/284/271 291/305/291 292/306/292 272/285/272 +f 272/285/272 292/306/292 293/307/293 273/286/273 +f 273/286/273 293/307/293 294/308/294 274/287/274 +f 274/287/274 294/308/294 295/309/295 275/288/275 +f 275/288/275 295/309/295 296/310/296 276/289/276 +f 276/289/276 296/310/296 297/311/297 277/290/277 +f 277/290/277 297/311/297 298/312/298 278/291/278 +f 278/291/278 298/312/298 299/313/299 279/292/279 +f 279/292/279 299/313/299 300/314/300 280/293/280 +f 280/293/280 300/314/300 281/315/281 261/294/261 +f 281/295/281 301/316/301 302/317/302 282/296/282 +f 282/296/282 302/317/302 303/318/303 283/297/283 +f 283/297/283 303/318/303 304/319/304 284/298/284 +f 284/298/284 304/319/304 305/320/305 285/299/285 +f 285/299/285 305/320/305 306/321/306 286/300/286 +f 286/300/286 306/321/306 307/322/307 287/301/287 +f 287/301/287 307/322/307 308/323/308 288/302/288 +f 288/302/288 308/323/308 309/324/309 289/303/289 +f 289/303/289 309/324/309 310/325/310 290/304/290 +f 290/304/290 310/325/310 311/326/311 291/305/291 +f 291/305/291 311/326/311 312/327/312 292/306/292 +f 292/306/292 312/327/312 313/328/313 293/307/293 +f 293/307/293 313/328/313 314/329/314 294/308/294 +f 294/308/294 314/329/314 315/330/315 295/309/295 +f 295/309/295 315/330/315 316/331/316 296/310/296 +f 296/310/296 316/331/316 317/332/317 297/311/297 +f 297/311/297 317/332/317 318/333/318 298/312/298 +f 298/312/298 318/333/318 319/334/319 299/313/299 +f 299/313/299 319/334/319 320/335/320 300/314/300 +f 300/314/300 320/335/320 301/336/301 281/315/281 +f 301/316/301 321/337/321 322/338/322 302/317/302 +f 302/317/302 322/338/322 323/339/323 303/318/303 +f 303/318/303 323/339/323 324/340/324 304/319/304 +f 304/319/304 324/340/324 325/341/325 305/320/305 +f 305/320/305 325/341/325 326/342/326 306/321/306 +f 306/321/306 326/342/326 327/343/327 307/322/307 +f 307/322/307 327/343/327 328/344/328 308/323/308 +f 308/323/308 328/344/328 329/345/329 309/324/309 +f 309/324/309 329/345/329 330/346/330 310/325/310 +f 310/325/310 330/346/330 331/347/331 311/326/311 +f 311/326/311 331/347/331 332/348/332 312/327/312 +f 312/327/312 332/348/332 333/349/333 313/328/313 +f 313/328/313 333/349/333 334/350/334 314/329/314 +f 314/329/314 334/350/334 335/351/335 315/330/315 +f 315/330/315 335/351/335 336/352/336 316/331/316 +f 316/331/316 336/352/336 337/353/337 317/332/317 +f 317/332/317 337/353/337 338/354/338 318/333/318 +f 318/333/318 338/354/338 339/355/339 319/334/319 +f 319/334/319 339/355/339 340/356/340 320/335/320 +f 320/335/320 340/356/340 321/357/321 301/336/301 +f 321/337/321 341/358/341 342/359/342 322/338/322 +f 322/338/322 342/359/342 343/360/343 323/339/323 +f 323/339/323 343/360/343 344/361/344 324/340/324 +f 324/340/324 344/361/344 345/362/345 325/341/325 +f 325/341/325 345/362/345 346/363/346 326/342/326 +f 326/342/326 346/363/346 347/364/347 327/343/327 +f 327/343/327 347/364/347 348/365/348 328/344/328 +f 328/344/328 348/365/348 349/366/349 329/345/329 +f 329/345/329 349/366/349 350/367/350 330/346/330 +f 330/346/330 350/367/350 351/368/351 331/347/331 +f 331/347/331 351/368/351 352/369/352 332/348/332 +f 332/348/332 352/369/352 353/370/353 333/349/333 +f 333/349/333 353/370/353 354/371/354 334/350/334 +f 334/350/334 354/371/354 355/372/355 335/351/335 +f 335/351/335 355/372/355 356/373/356 336/352/336 +f 336/352/336 356/373/356 357/374/357 337/353/337 +f 337/353/337 357/374/357 358/375/358 338/354/338 +f 338/354/338 358/375/358 359/376/359 339/355/339 +f 339/355/339 359/376/359 360/377/360 340/356/340 +f 340/356/340 360/377/360 341/378/341 321/357/321 +f 341/358/341 361/379/361 362/380/362 342/359/342 +f 342/359/342 362/380/362 363/381/363 343/360/343 +f 343/360/343 363/381/363 364/382/364 344/361/344 +f 344/361/344 364/382/364 365/383/365 345/362/345 +f 345/362/345 365/383/365 366/384/366 346/363/346 +f 346/363/346 366/384/366 367/385/367 347/364/347 +f 347/364/347 367/385/367 368/386/368 348/365/348 +f 348/365/348 368/386/368 369/387/369 349/366/349 +f 349/366/349 369/387/369 370/388/370 350/367/350 +f 350/367/350 370/388/370 371/389/371 351/368/351 +f 351/368/351 371/389/371 372/390/372 352/369/352 +f 352/369/352 372/390/372 373/391/373 353/370/353 +f 353/370/353 373/391/373 374/392/374 354/371/354 +f 354/371/354 374/392/374 375/393/375 355/372/355 +f 355/372/355 375/393/375 376/394/376 356/373/356 +f 356/373/356 376/394/376 377/395/377 357/374/357 +f 357/374/357 377/395/377 378/396/378 358/375/358 +f 358/375/358 378/396/378 379/397/379 359/376/359 +f 359/376/359 379/397/379 380/398/380 360/377/360 +f 360/377/360 380/398/380 361/399/361 341/378/341 +f 2/2/4 381/400/381 1/1/1 +f 3/3/6 381/401/381 2/2/4 +f 4/4/8 381/402/381 3/3/6 +f 5/5/10 381/403/381 4/4/8 +f 6/6/12 381/404/381 5/5/10 +f 7/7/14 381/405/381 6/6/12 +f 8/8/16 381/406/381 7/7/14 +f 9/9/18 381/407/381 8/8/16 +f 10/10/20 381/408/381 9/9/18 +f 11/11/22 381/409/381 10/10/20 +f 12/12/24 381/410/381 11/11/22 +f 13/13/26 381/411/381 12/12/24 +f 14/14/28 381/412/381 13/13/26 +f 15/15/30 381/413/381 14/14/28 +f 16/16/32 381/414/381 15/15/30 +f 17/17/34 381/415/381 16/16/32 +f 18/18/36 381/416/381 17/17/34 +f 19/19/38 381/417/381 18/18/36 +f 20/20/40 381/418/381 19/19/38 +f 1/21/1 381/419/381 20/20/40 +f 361/379/361 382/420/382 362/380/362 +f 362/380/362 382/421/382 363/381/363 +f 363/381/363 382/422/382 364/382/364 +f 364/382/364 382/423/382 365/383/365 +f 365/383/365 382/424/382 366/384/366 +f 366/384/366 382/425/382 367/385/367 +f 367/385/367 382/426/382 368/386/368 +f 368/386/368 382/427/382 369/387/369 +f 369/387/369 382/428/382 370/388/370 +f 370/388/370 382/429/382 371/389/371 +f 371/389/371 382/430/382 372/390/372 +f 372/390/372 382/431/382 373/391/373 +f 373/391/373 382/432/382 374/392/374 +f 374/392/374 382/433/382 375/393/375 +f 375/393/375 382/434/382 376/394/376 +f 376/394/376 382/435/382 377/395/377 +f 377/395/377 382/436/382 378/396/378 +f 378/396/378 382/437/382 379/397/379 +f 379/397/379 382/438/382 380/398/380 +f 380/398/380 382/439/382 361/399/361 diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj.meta new file mode 100644 index 0000000..913af25 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/InvertedSphere.obj.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 6715148616522154089b81a2ad8cea41 +timeCreated: 1483307384 +licenseType: Free +ModelImporter: + serializedVersion: 19 + fileIDToRecycleName: + 100000: //RootNode + 100002: pSphere1 + 400000: //RootNode + 400002: pSphere1 + 2300000: pSphere1 + 3300000: pSphere1 + 4300000: pSphere1 + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + hasTranslationDoF: 0 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Materials.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials.meta new file mode 100644 index 0000000..e9017c7 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8b5af7041216ead49b6ea0f41b541225 +folderAsset: yes +timeCreated: 1497571639 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat new file mode 100644 index 0000000..c36e7de Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat.meta new file mode 100644 index 0000000..7674338 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Materials/pSphere1Mat.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d8c64976422ba12429c090da6d8861b8 +timeCreated: 1497571639 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures.meta new file mode 100644 index 0000000..323b8e1 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 51794c92639ee5b48bcd4ec6a0eeefa1 +folderAsset: yes +timeCreated: 1480266933 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg new file mode 100644 index 0000000..b8f7ea1 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg differ diff --git a/Assets/Tree_Textures/normal_specular.png.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg.meta similarity index 85% rename from Assets/Tree_Textures/normal_specular.png.meta rename to Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg.meta index 6d56053..f5213d6 100644 --- a/Assets/Tree_Textures/normal_specular.png.meta +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/14-Hamarikyu_Bridge_B_8k.jpg.meta @@ -1,14 +1,15 @@ fileFormatVersion: 2 -guid: 6202447b353801a46b71cf28e6be7244 -timeCreated: 1479674902 +guid: f82602bbc5fcb194798627a1ea0a50c9 +timeCreated: 1486332148 licenseType: Free TextureImporter: - fileIDToRecycleName: {} + fileIDToRecycleName: + 8900000: generatedCubemap serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 - linearTexture: 1 + linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 @@ -21,7 +22,7 @@ TextureImporter: normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 cubemapConvolutionSteps: 7 cubemapConvolutionExponent: 1.5 @@ -32,7 +33,7 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -1 - wrapMode: -1 + wrapMode: 1 nPOTScale: 1 lightmap: 0 rGBM: 0 @@ -47,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 alphaIsTransparency: 0 spriteTessellationDetail: -1 - textureType: -1 + textureType: 3 buildTargetSettings: [] spriteSheet: serializedVersion: 2 diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg new file mode 100644 index 0000000..884073a Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg differ diff --git a/Assets/Tree_Textures/translucency_gloss.png.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg.meta similarity index 85% rename from Assets/Tree_Textures/translucency_gloss.png.meta rename to Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg.meta index 4a558d1..ae2097a 100644 --- a/Assets/Tree_Textures/translucency_gloss.png.meta +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alexs_Apt_8k.jpg.meta @@ -1,14 +1,15 @@ fileFormatVersion: 2 -guid: be4429f1bc50c8d46901a2a1ef4022b7 -timeCreated: 1479674903 +guid: ec0da098fef3b294e93407d2331f4e10 +timeCreated: 1489032334 licenseType: Free TextureImporter: - fileIDToRecycleName: {} + fileIDToRecycleName: + 8900000: generatedCubemap serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 - linearTexture: 1 + linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 @@ -21,7 +22,7 @@ TextureImporter: normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 cubemapConvolutionSteps: 7 cubemapConvolutionExponent: 1.5 @@ -32,7 +33,7 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -1 - wrapMode: -1 + wrapMode: 1 nPOTScale: 1 lightmap: 0 rGBM: 0 @@ -47,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 alphaIsTransparency: 0 spriteTessellationDetail: -1 - textureType: -1 + textureType: 3 buildTargetSettings: [] spriteSheet: serializedVersion: 2 diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg new file mode 100644 index 0000000..2602d94 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg differ diff --git a/Assets/Tree_Textures/diffuse.png.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg.meta similarity index 84% rename from Assets/Tree_Textures/diffuse.png.meta rename to Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg.meta index c87192d..210f7de 100644 --- a/Assets/Tree_Textures/diffuse.png.meta +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Alley8k_Bg.jpg.meta @@ -1,9 +1,10 @@ fileFormatVersion: 2 -guid: 36c947ce4c3a8de4b92519f387d4ccc2 -timeCreated: 1479674902 +guid: a5c348443c8054845b336974008d205f +timeCreated: 1483335528 licenseType: Free TextureImporter: - fileIDToRecycleName: {} + fileIDToRecycleName: + 8900000: generatedCubemap serializedVersion: 2 mipmaps: mipMapMode: 0 @@ -21,7 +22,7 @@ TextureImporter: normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 cubemapConvolutionSteps: 7 cubemapConvolutionExponent: 1.5 @@ -32,7 +33,7 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -1 - wrapMode: -1 + wrapMode: 1 nPOTScale: 1 lightmap: 0 rGBM: 0 @@ -45,9 +46,9 @@ TextureImporter: spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 - alphaIsTransparency: 1 + alphaIsTransparency: 0 spriteTessellationDetail: -1 - textureType: -1 + textureType: 3 buildTargetSettings: [] spriteSheet: serializedVersion: 2 diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg new file mode 100644 index 0000000..f818405 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg differ diff --git a/Assets/Tree_Textures/shadow.png.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg.meta similarity index 83% rename from Assets/Tree_Textures/shadow.png.meta rename to Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg.meta index 70c3e9d..12ca2aa 100644 --- a/Assets/Tree_Textures/shadow.png.meta +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Barce_Rooftop_C_8k.jpg.meta @@ -1,14 +1,15 @@ fileFormatVersion: 2 -guid: e37bb8c688630c64aa5f5a136d6bdfdd -timeCreated: 1479674907 +guid: 17b78d207892e30489ea51f25cd6df40 +timeCreated: 1483331013 licenseType: Free TextureImporter: - fileIDToRecycleName: {} + fileIDToRecycleName: + 8900000: generatedCubemap serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 1 - linearTexture: 1 + linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 @@ -21,18 +22,18 @@ TextureImporter: normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 cubemapConvolutionSteps: 7 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 - maxTextureSize: 8 + maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 - wrapMode: -1 + wrapMode: 1 nPOTScale: 1 lightmap: 0 rGBM: 0 @@ -47,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 alphaIsTransparency: 0 spriteTessellationDetail: -1 - textureType: -1 + textureType: 3 buildTargetSettings: [] spriteSheet: serializedVersion: 2 diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg new file mode 100644 index 0000000..8598019 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg.meta new file mode 100644 index 0000000..7fe18d5 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_110_Tunnel_Bg.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 5d10138f3bc04bd43baa81f7cbd8d422 +timeCreated: 1489347951 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg new file mode 100644 index 0000000..d96f41c Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg.meta new file mode 100644 index 0000000..bdb7bf4 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/HDR_111_Parking_Lot_2_Bg.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 844d72f01b6f71c4a8c69c7a472915d6 +timeCreated: 1483413166 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg new file mode 100644 index 0000000..98ba1ca Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg.meta new file mode 100644 index 0000000..420d4ce --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Lobby-Center_8k_TMap.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 15b65b51ce2f7ba40bdbea96c841aada +timeCreated: 1489348192 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg new file mode 100644 index 0000000..b216a37 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg.meta new file mode 100644 index 0000000..942e6d9 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/MonValley_G_DirtRoad_8k.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 26b6f56ee2b8fd343800d909e22dc42c +timeCreated: 1483500178 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg new file mode 100644 index 0000000..2431275 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg.meta new file mode 100644 index 0000000..804b9e3 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/NatureLabFront_IBL_Bg.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: b0847e641b460b04fa4f5f5d97e34c43 +timeCreated: 1489348134 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr new file mode 100644 index 0000000..79e7991 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr.meta new file mode 100644 index 0000000..924ea83 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/T_Road_to_MonumentValley_Ref_cube_radiance.exr.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 37e15559f8ccdf54dbcbb5d7ebe6d47e +timeCreated: 1482639060 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 0 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg new file mode 100644 index 0000000..16f04b8 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg.meta new file mode 100644 index 0000000..c8cbafe --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tokyo_BigSight_8k.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 765d26c82269cf84e9cc44485d85466f +timeCreated: 1483316982 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg new file mode 100644 index 0000000..3665a61 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg.meta new file mode 100644 index 0000000..aa76acb --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/Tufts-Parking-Lot_Bg.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 3f1f52b42679dec4792d5d8599ef7baf +timeCreated: 1483334883 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr new file mode 100644 index 0000000..2faca9f Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr.meta new file mode 100644 index 0000000..168beac --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_nad_photorealism.exr.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: 5201d3223ffad9b40a76d908c76f67c9 +timeCreated: 1489363022 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr new file mode 100644 index 0000000..acfde36 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr.meta new file mode 100644 index 0000000..b75dd60 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/canada_montreal_thea.exr.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: c1269ed204c76a94c8ea24d4292294da +timeCreated: 1489032527 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg new file mode 100644 index 0000000..5341986 Binary files /dev/null and b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg differ diff --git a/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg.meta b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg.meta new file mode 100644 index 0000000..6da5945 --- /dev/null +++ b/Assets/TangoResearch/LightEstimation/SourceAssets/Textures/hdrvfx_zanla_1_n1_v01_Bg.jpg.meta @@ -0,0 +1,60 @@ +fileFormatVersion: 2 +guid: de8246b2bb24ed14aa6acab568b8c93e +timeCreated: 1483334480 +licenseType: Free +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 3 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Prefabs.meta b/Assets/TangoResearch/Prefabs.meta new file mode 100644 index 0000000..7443a3a --- /dev/null +++ b/Assets/TangoResearch/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 86505415f160c4d49abb2ce8d0b4439a +folderAsset: yes +timeCreated: 1487645888 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Prefabs/LionCylinder.prefab b/Assets/TangoResearch/Prefabs/LionCylinder.prefab new file mode 100644 index 0000000..f725f9d Binary files /dev/null and b/Assets/TangoResearch/Prefabs/LionCylinder.prefab differ diff --git a/Assets/TangoResearch/Prefabs/LionCylinder.prefab.meta b/Assets/TangoResearch/Prefabs/LionCylinder.prefab.meta new file mode 100644 index 0000000..681d6c1 --- /dev/null +++ b/Assets/TangoResearch/Prefabs/LionCylinder.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f45aa6e40937182408681fbe04c384c3 +timeCreated: 1487646573 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Scenes/FindLightsAdvanced.unity b/Assets/TangoResearch/Scenes/FindLightsAdvanced.unity index 16b84b5..375f704 100644 Binary files a/Assets/TangoResearch/Scenes/FindLightsAdvanced.unity and b/Assets/TangoResearch/Scenes/FindLightsAdvanced.unity differ diff --git a/Assets/TangoResearch/Scenes/TangoSphereMap.unity b/Assets/TangoResearch/Scenes/TangoSphereMap.unity new file mode 100644 index 0000000..e846a6b Binary files /dev/null and b/Assets/TangoResearch/Scenes/TangoSphereMap.unity differ diff --git a/Assets/TangoResearch/Scenes/TangoSphereMap.unity.meta b/Assets/TangoResearch/Scenes/TangoSphereMap.unity.meta new file mode 100644 index 0000000..6ced7da --- /dev/null +++ b/Assets/TangoResearch/Scenes/TangoSphereMap.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6d4d38bb8e4be2428fa38f062b52fab +timeCreated: 1486345235 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat b/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat new file mode 100644 index 0000000..26b791c Binary files /dev/null and b/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat differ diff --git a/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat.meta b/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat.meta new file mode 100644 index 0000000..54b6dd0 --- /dev/null +++ b/Assets/TangoResearch/Segmentation/Materials/MainScreen.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f0d5e22f063b9c4d83fe53fb0fc7924 +timeCreated: 1480206266 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/Segmentation/SLIC/TestSLICSegmentation.cs b/Assets/TangoResearch/Segmentation/SLIC/TestSLICSegmentation.cs index f5b22ba..027afcb 100644 --- a/Assets/TangoResearch/Segmentation/SLIC/TestSLICSegmentation.cs +++ b/Assets/TangoResearch/Segmentation/SLIC/TestSLICSegmentation.cs @@ -7,17 +7,27 @@ public class VectorInt2 { public int X; public int Y; + private VectorInt2 vectorInt2; public VectorInt2() { } + public VectorInt2(VectorInt2 vectorInt2) : this(vectorInt2.X, vectorInt2.Y) + { + } + public VectorInt2(int x, int y) { X = x; Y = y; } + public override string ToString() + { + return this.X + ", " + this.Y; + } + public override bool Equals(object obj) { // Check for null values and compare run-time types. diff --git a/Assets/TangoResearch/TangoCubemap.meta b/Assets/TangoResearch/TangoCubemap.meta new file mode 100644 index 0000000..926cdad --- /dev/null +++ b/Assets/TangoResearch/TangoCubemap.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c8e14f91c4cffa146b5f61c732341ab9 +folderAsset: yes +timeCreated: 1486345818 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture b/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture new file mode 100644 index 0000000..0df475d Binary files /dev/null and b/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture differ diff --git a/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture.meta b/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture.meta new file mode 100644 index 0000000..b831538 --- /dev/null +++ b/Assets/TangoResearch/TangoCubemap/InTexture.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6bb8e496f7c318041aa83b0f3db1cc2e +timeCreated: 1486348376 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs b/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs new file mode 100644 index 0000000..e898b21 --- /dev/null +++ b/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs @@ -0,0 +1,480 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using Tango; +using System.Collections.Generic; +using System.Linq; +using System; +using UnityEngine.Events; +using System.IO; + +public class TangoCubemap : MonoBehaviour +{ + + private int _screenWidth = 1280; + private int _screenHeight = 720; + + public int _CubeSize = 32; + + public bool _45DegreeCube = false; + + public Vector3[,] _posX; + public Vector3[,] _negX; + public Vector3[,] _posY; + public Vector3[,] _negY; + public Vector3[,] _posZ; + public Vector3[,] _negZ; + + private int _dirtyPixels = 0; + private float _fillPercentage = 0f; + private bool _paused = false; + + public Text _TextFillPercentage; + public Button _ButtonClear; + public Button _ButtonCapture; + public Button _ButtonExport; + public Toggle _TogglePause; + public RawImage _RPosX; + public RawImage _RNegX; + public RawImage _RPosY; + public RawImage _RNegY; + public RawImage _RPosZ; + public RawImage _RNegZ; + + public Texture2D _t2DPosX; + public Texture2D _t2DNegX; + public Texture2D _t2DPosY; + public Texture2D _t2DNegY; + public Texture2D _t2DPosZ; + public Texture2D _t2DNegZ; + + + void Start () + { + _screenWidth = Camera.main.pixelWidth; + _screenHeight = Camera.main.pixelHeight; + + _t2DPosX = new Texture2D(_CubeSize, _CubeSize); + _t2DNegX = new Texture2D(_CubeSize, _CubeSize); + _t2DPosY = new Texture2D(_CubeSize, _CubeSize); + _t2DNegY = new Texture2D(_CubeSize, _CubeSize); + _t2DPosZ = new Texture2D(_CubeSize, _CubeSize); + _t2DNegZ = new Texture2D(_CubeSize, _CubeSize); + + _posX = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negX = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _posY = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negY = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _posZ = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negZ = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + + + _ButtonClear.onClick.AddListener(OnClickClear); + _ButtonCapture.onClick.AddListener(OnClickCapture); + _ButtonExport.onClick.AddListener(OnClickButtonExport); + _TogglePause.onValueChanged.AddListener(value => OnValueChangedPause(value)); + + } + + private void OnClickButtonExport() + { + ExportFaces(); + } + + private void OnClickCapture() + { + //updateCubemap(); + WriteToTexture(); + } + + private void OnClickClear() + { + _posX = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negX = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _posY = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negY = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _posZ = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + _negZ = GetNew2DArray(_CubeSize, _CubeSize, new Vector3(-1, -1, -1)); + + _dirtyPixels = 0; + } + + private void OnValueChangedPause(bool val) + { + _paused = val; + } + + public static T[,] GetNew2DArray(int x, int y, T initialValue) + { + T[,] nums = new T[x, y]; + for (int i = 0; i < x * y; i++) nums[i % x, i / x] = initialValue; + return nums; + } + + private float Mod(float a, float b) + { + return a - b * Mathf.Floor(a / b); + } + + private CubemapFace IntToCubemapFace(int i) + { + switch (i) + { + case 0: + return CubemapFace.PositiveX; + case 1: + return CubemapFace.NegativeX; + case 2: + return CubemapFace.PositiveY; + case 3: + return CubemapFace.NegativeY; + case 4: + return CubemapFace.PositiveZ; + case 5: + return CubemapFace.NegativeZ; + default: + return CubemapFace.Unknown; + } + } + + private static Vector2 CartesianToPolarCoordinates(Vector3 v) + { + float lat = Mathf.Rad2Deg * Mathf.Acos(v.y / v.magnitude); // North-South + float lon = Mathf.Rad2Deg * Mathf.Atan2( v.x, v.z); // East-West + + return new Vector2(lon, lat); + } + + private void DecrementDirtyArray(int[,] arr) { + for (int i = 0; i < arr.GetLength(0); i++) + { + for (int j = 0; j < arr.GetLength(1); j++) + { + if (arr[i, j] > 0) { + arr[i, j]--; + } + } + } + } + + private void ExportFaces() + { + string dataPath = "/"; +#if UNITY_ANDROID && !UNITY_EDITOR + dataPath = "/../../../../DCIM/"; +#endif + + // Encode texture into PNG + byte[] bytesPosX = _t2DPosX.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "PosX.png", bytesPosX); + + byte[] bytesNegX = _t2DNegX.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "NegX.png", bytesNegX); + + byte[] bytesPosY = _t2DPosY.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "PosY.png", bytesPosY); + + byte[] bytesNegY = _t2DNegY.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "NegY.png", bytesNegY); + + byte[] bytesPosZ = _t2DPosZ.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "PosZ.png", bytesPosZ); + + byte[] bytesNegZ = _t2DNegZ.EncodeToPNG(); + File.WriteAllBytes(Application.persistentDataPath + dataPath + "NegZ.png", bytesNegZ); + + + Debug.Log("Exported: " + Application.persistentDataPath + dataPath + "PosX.png"); + } + + public void WriteToTexture() + { + for (int i = 0; i < _CubeSize; i++) + { + for (int j = 0; j < _CubeSize; j++) + { + _t2DPosX.SetPixel(i, j, ImageProcessing.Vector3ToColor(_posX[i, j])); + _t2DNegX.SetPixel(i, j, ImageProcessing.Vector3ToColor(_negX[i, j])); + _t2DPosY.SetPixel(i, j, ImageProcessing.Vector3ToColor(_posY[i, j])); + _t2DNegY.SetPixel(i, j, ImageProcessing.Vector3ToColor(_negY[i, j])); + _t2DPosZ.SetPixel(i, j, ImageProcessing.Vector3ToColor(_posZ[i, j])); + _t2DNegZ.SetPixel(i, j, ImageProcessing.Vector3ToColor(_negZ[i, j])); + } + } + _t2DPosX.Apply(); + _t2DNegX.Apply(); + _t2DPosY.Apply(); + _t2DNegY.Apply(); + _t2DPosZ.Apply(); + _t2DNegZ.Apply(); + + _RPosX.texture = _t2DPosX; + _RNegX.texture = _t2DNegX; + _RPosY.texture = _t2DPosY; + _RNegY.texture = _t2DNegY; + _RPosZ.texture = _t2DPosZ; + _RNegZ.texture = _t2DNegZ; + } + + private void SetColor(Vector3 v, Vector3 color, + Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ) + { + Vector3 d = new Vector3(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z)); + + int greatestIndex = 0; + for (int i = 1; i < 3; i++) + if (d[i] > d[greatestIndex]) + greatestIndex = i; + + v /= d[greatestIndex]; + + float luma = ImageProcessing.Grayscale(color); + switch (greatestIndex) + { + case 0: + int x = Mathf.Clamp(_CubeSize - 1 - (int)((v.z + 1) / 2f * _CubeSize), 0, _CubeSize - 1); + int y = (int)((v.y + 1) / 2f * _CubeSize); + if (v.x > 0) + { + if (posX[x, y].x < 0) + { + _dirtyPixels++; + } + + + posX[x, y] = color; + } + else + { + if (negX[_CubeSize - 1 - x, y].x < 0) + { + _dirtyPixels++; + + } + + + negX[_CubeSize - 1 - x, y] = color; + } + break; + case 1: + x = (int)((v.x + 1) / 2f * _CubeSize); + y = _CubeSize - 1 - (int)((v.z + 1) / 2f * _CubeSize); + if (v.y > 0) + { + if (posY[x, y].x < 0) + { + _dirtyPixels++; + + } + + posY[x, y] = color; + } + else + { + + if (negY[x, _CubeSize - 1 - y].x < 0) + { + _dirtyPixels++; + + } + + negY[x, _CubeSize - 1 - y] = color; + } + break; + case 2: + x = _CubeSize - 1 - (int)((v.x + 1) / 2f * _CubeSize); + y = (int)((v.y + 1) / 2f * _CubeSize); + if (v.z > 0) + { + + if (posZ[_CubeSize - 1 - x, y].x < 0) + { + _dirtyPixels++; + + } + + + posZ[_CubeSize - 1 - x, y] = color; + } + else + { + if (negZ[x, y].x < 0) + { + _dirtyPixels++; + + } + + + + negZ[x, y] = color; + } + break; + } + + } + + /// + /// Converts polar (spherical) coordinats to cartesian coordinates. + /// + /// + /// The vector3 cartesian coordinate. + public static Vector3 PolarToCartesian(Vector2 polar) + { + float sinLat = Mathf.Sin(polar.y * Mathf.Deg2Rad); + Vector3 cartesian = new Vector3( + sinLat * Mathf.Sin(polar.x * Mathf.Deg2Rad), + Mathf.Cos(polar.y * Mathf.Deg2Rad), + sinLat * Mathf.Cos(polar.x * Mathf.Deg2Rad)); + + return cartesian; + } + + public static Vector3 GetColor(Vector3 v, int cubeSize, + Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ) + { + Vector3 d = new Vector3(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z)); + + int greatestIndex = 0; + for (int i = 1; i < 3; i++) + if (d[i] > d[greatestIndex]) + greatestIndex = i; + + v /= d[greatestIndex]; + + switch (greatestIndex) + { + case 0: + int x = Mathf.Clamp(cubeSize - 1 - (int)((v.z + 1) / 2f * cubeSize), 0, cubeSize - 1); + int y = (int)((v.y + 1) / 2f * (cubeSize-1)); + + if (x >= posX.GetLength(0) || x < 0) + { + Debug.Log("0:: x: " + x + " cubeSize: " + cubeSize); + } + else if (y >= posX.GetLength(1) || y < 0) + { + Debug.Log("0:: y: " + y + " cubeSize: " + cubeSize); + } + + + if (v.x > 0) + { + return posX[x, y]; + } + else + { + return negX[cubeSize - 1 - x, y]; + } + case 1: + x = (int)((v.x + 1) / 2f * cubeSize); + y = cubeSize - 1 - (int)((v.z + 1) / 2f * (cubeSize - 1)); + + if (x >= posX.GetLength(0) || x < 0) + { + Debug.Log("1:: x: " + x + " cubeSize: " + cubeSize); + } + else if (y >= posX.GetLength(1) || y < 0) + { + Debug.Log("1:: y: " + y + " cubeSize: " + cubeSize); + } + + if (v.y > 0) + { + return posY[x, y]; + } + else + { + return negY[x, cubeSize - 1 - y]; + } + case 2: + x = cubeSize - 1 - (int)((v.x + 1) / 2f * cubeSize); + y = (int)((v.y + 1) / 2f * (cubeSize - 1)); + + if (x >= posX.GetLength(0) || x < 0) + { + Debug.Log("2:: x: " + x + " cubeSize: " + cubeSize); + } + else if (y >= posX.GetLength(1) || y < 0) + { + Debug.Log("2:: y: " + y + " cubeSize: " + cubeSize); + } + + if (v.z > 0) + { + return posZ[cubeSize - 1 - x, y]; + } + else + { + return negZ[x, y]; + } + default: + return Vector3.zero; + } + + } + + public static Vector3 SampleColorRange(Vector3 direction, int cubeSize, float angle, + Vector3[,] posX, Vector3[,] negX, + Vector3[,] posY, Vector3[,] negY, + Vector3[,] posZ, Vector3[,] negZ) + { + Vector2 polar = CartesianToPolarCoordinates(direction); + + Vector3 left = PolarToCartesian(new Vector2(polar.x - angle, polar.y)); + Vector3 right = PolarToCartesian(new Vector2(polar.x + angle, polar.y)); + Vector3 down = PolarToCartesian(new Vector2(polar.x, polar.y - angle)); + Vector3 up = PolarToCartesian(new Vector2(polar.x, polar.y + angle)); + + Vector3 c = GetColor(direction, cubeSize, posX, negX, posY, negY, posZ, negZ); + c += GetColor(left, cubeSize, posX, negX, posY, negY, posZ, negZ); + c += GetColor(right, cubeSize, posX, negX, posY, negY, posZ, negZ); + c += GetColor(up, cubeSize, posX, negX, posY, negY, posZ, negZ); + c += GetColor(down, cubeSize, posX, negX, posY, negY, posZ, negZ); + c /= 5f; + + return c; + } + + public void UpdateCubeArrays(Vector3[,] pixels) + { + if (_paused) return; + + //onClickClear(); + + for (int i = 1; i < _CubeSize - 1; i++) + { + for (int j = 1; j < _CubeSize - 1; j++) + { + Vector3 p = new Vector3(i / (float)_CubeSize * _screenWidth, j / (float)_CubeSize * _screenHeight, 0); + + Ray ray = Camera.main.ScreenPointToRay(p); + //ray.direction = Quaternion.Euler(0, -45, 0) * ray.direction; + int x = (int)(i / (float)(_CubeSize - 1) * (pixels.GetLength(0) - 1)); + int y = (pixels.GetLength(1) - 1) - (int)(j / (float)(_CubeSize - 1) * (pixels.GetLength(1) - 1)); + + Vector3 c = pixels[x, y]; + //Debug.DrawRay(Camera.main.transform.position, ray.direction, ImageProcessing.Vector3ToColor(c / 255f)); + + SetColor(ray.direction.normalized, c / 255f, _posX, _negX, _posY, _negY, _posZ, _negZ); + } + } + + //decrementDirtyArray(_posXDirty); + //decrementDirtyArray(_negXDirty); + //decrementDirtyArray(_posYDirty); + //decrementDirtyArray(_negYDirty); + //decrementDirtyArray(_posZDirty); + //decrementDirtyArray(_negZDirty); + + _fillPercentage = _dirtyPixels / (float)(_CubeSize * _CubeSize * 6) * 100; + _TextFillPercentage.text = "Fill: " + _fillPercentage + "%"; + + } + + + +} diff --git a/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs.meta b/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs.meta new file mode 100644 index 0000000..04f24b5 --- /dev/null +++ b/Assets/TangoResearch/TangoCubemap/TangoCubemap.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3aa1c602be83ce9409187e8049436ec8 +timeCreated: 1486345832 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Gaussian.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Gaussian.shader index 125a092..342db88 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Gaussian.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Gaussian.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_Gaussian" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_Gaussian" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_GuidedFilter.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_GuidedFilter.shader index 8ec9dda..dd30bb8 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_GuidedFilter.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_GuidedFilter.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_GuidedFilter" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_GuidedFilter" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Kuwahara.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Kuwahara.shader index b688572..673b49e 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Kuwahara.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Kuwahara.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_Kuwahara" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_Kuwahara" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_MaskedMean.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_MaskedMean.shader index d9ecf76..7277052 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_MaskedMean.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_MaskedMean.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_MaskedMean" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_MaskedMean" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Median.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Median.shader index cb37512..11291ad 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Median.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_Median.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_Median" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_Median" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_NoFilter.shader b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_NoFilter.shader index 31d908e..a372806 100644 --- a/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_NoFilter.shader +++ b/Assets/TangoResearch/TangoDepthMap/Shaders/DepthMap_NoFilter.shader @@ -1,4 +1,6 @@ -Shader "Hidden/DepthMap_NoFilter" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/DepthMap_NoFilter" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoReconstructionAndLighting/Materials/Matte.mat b/Assets/TangoResearch/TangoReconstructionAndLighting/Materials/Matte.mat index ccd0965..7f60c03 100644 Binary files a/Assets/TangoResearch/TangoReconstructionAndLighting/Materials/Matte.mat and b/Assets/TangoResearch/TangoReconstructionAndLighting/Materials/Matte.mat differ diff --git a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/Blend2.shader b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/Blend2.shader index 1d26f85..d67aa53 100644 --- a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/Blend2.shader +++ b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/Blend2.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Blend2" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Blend2" { Properties { @@ -37,7 +39,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } diff --git a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/MultiMap.shader b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/MultiMap.shader index 1956034..5fc2e7b 100644 --- a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/MultiMap.shader +++ b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/MultiMap.shader @@ -1,4 +1,6 @@ -Shader "Unlit/MultiMap" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Unlit/MultiMap" { Properties { @@ -57,7 +59,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = (_UseMap1) ? TRANSFORM_TEX(v.uv, _Map1) : TRANSFORM_TEX(v.uv, _Map2); return o; } diff --git a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/VertexColor.shader b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/VertexColor.shader index 9b96604..9783c54 100644 --- a/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/VertexColor.shader +++ b/Assets/TangoResearch/TangoReconstructionAndLighting/Shaders/VertexColor.shader @@ -1,4 +1,6 @@ -Shader "Unlit/VertexColor" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Unlit/VertexColor" { Properties { @@ -31,7 +33,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; return o; } diff --git a/Assets/TangoResearch/TestingScene/Shaders/InsideFrustum.shader b/Assets/TangoResearch/TestingScene/Shaders/InsideFrustum.shader index 70abe9f..7a22b62 100644 --- a/Assets/TangoResearch/TestingScene/Shaders/InsideFrustum.shader +++ b/Assets/TangoResearch/TestingScene/Shaders/InsideFrustum.shader @@ -1,4 +1,6 @@ -Shader "Unlit/InsideFrustum" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Unlit/InsideFrustum" { Properties { @@ -49,7 +51,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); //bool visible = in_frustum(mul(UNITY_MATRIX_P, _MVTargetCam), v.vertex); bool visible = in_frustum(_MVTargetCam, v.vertex); diff --git a/Assets/TangoSDK/Core/Shaders/ColorCameraEmulation.shader b/Assets/TangoSDK/Core/Shaders/ColorCameraEmulation.shader index 9a0e005..f5dbecc 100644 --- a/Assets/TangoSDK/Core/Shaders/ColorCameraEmulation.shader +++ b/Assets/TangoSDK/Core/Shaders/ColorCameraEmulation.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Tango/ColorCameraEmulation" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Tango/ColorCameraEmulation" { Properties { @@ -42,7 +44,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); o.color = v.color; o.normal = v.normal; diff --git a/Assets/TangoSDK/Core/Shaders/DepthEmulation.shader b/Assets/TangoSDK/Core/Shaders/DepthEmulation.shader index 21aebfd..9700c1e 100644 --- a/Assets/TangoSDK/Core/Shaders/DepthEmulation.shader +++ b/Assets/TangoSDK/Core/Shaders/DepthEmulation.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Tango/DepthEmulation" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Tango/DepthEmulation" { SubShader { @@ -29,7 +31,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.clipSpaceZ = o.vertex.z; return o; } diff --git a/Assets/TangoSDK/Core/Shaders/RGB2YUV_CbCr.shader b/Assets/TangoSDK/Core/Shaders/RGB2YUV_CbCr.shader index d811422..24c879e 100644 --- a/Assets/TangoSDK/Core/Shaders/RGB2YUV_CbCr.shader +++ b/Assets/TangoSDK/Core/Shaders/RGB2YUV_CbCr.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Tango/RGB2YUV_CbCr" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Tango/RGB2YUV_CbCr" { Properties { @@ -33,7 +35,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; o.uv.y = 1 - o.uv.y; return o; diff --git a/Assets/TangoSDK/Core/Shaders/RGB2YUV_Y.shader b/Assets/TangoSDK/Core/Shaders/RGB2YUV_Y.shader index 2d9a8bb..48051b3 100644 --- a/Assets/TangoSDK/Core/Shaders/RGB2YUV_Y.shader +++ b/Assets/TangoSDK/Core/Shaders/RGB2YUV_Y.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Tango/RGB2YUV_Y" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Tango/RGB2YUV_Y" { Properties { @@ -33,7 +35,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; o.uv.y = 1 - o.uv.y; return o; diff --git a/Assets/TangoSDK/Core/Shaders/RGB_ARScreen.shader b/Assets/TangoSDK/Core/Shaders/RGB_ARScreen.shader index ced3391..39664cb 100644 --- a/Assets/TangoSDK/Core/Shaders/RGB_ARScreen.shader +++ b/Assets/TangoSDK/Core/Shaders/RGB_ARScreen.shader @@ -1,4 +1,6 @@ -Shader "Hidden/Tango/RGB_ARScreen" +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +Shader "Hidden/Tango/RGB_ARScreen" { Properties { @@ -42,7 +44,7 @@ v2f vert (appdata v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); if (v.uv.x < 0.5 && v.uv.y < 0.5) { o.uv = _UVBottomLeft; diff --git a/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithColor/Shaders/UnlitVertexColor.shader b/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithColor/Shaders/UnlitVertexColor.shader index bba6adf..7e25785 100644 --- a/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithColor/Shaders/UnlitVertexColor.shader +++ b/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithColor/Shaders/UnlitVertexColor.shader @@ -1,4 +1,6 @@ -/* +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +/* * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,7 +41,7 @@ Shader "Custom/UnlitVertexColor" { v2f vert(IN input) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, input.pos); + o.pos = UnityObjectToClipPos(input.pos); o.color = input.color; return o; } diff --git a/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithPhysics/Shader/UnlitColor.shader b/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithPhysics/Shader/UnlitColor.shader index 802e52e..645e268 100644 --- a/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithPhysics/Shader/UnlitColor.shader +++ b/Assets/TangoSDK/Examples/ExperimentalMeshBuilderWithPhysics/Shader/UnlitColor.shader @@ -1,4 +1,6 @@ -/* +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + +/* * Copyright 2014 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +31,7 @@ Shader "Custom/UnlitColor" { uniform float4 _Color; float4 vert(float4 v:POSITION) : SV_POSITION { - return mul (UNITY_MATRIX_MVP, v); + return UnityObjectToClipPos (v); } fixed4 frag() : COLOR { diff --git a/Assets/TangoSDK/Examples/ExperimentalMeshOcclusion/Shaders/OcclusionMesh.shader b/Assets/TangoSDK/Examples/ExperimentalMeshOcclusion/Shaders/OcclusionMesh.shader index da4255b..f5ef1b3 100644 --- a/Assets/TangoSDK/Examples/ExperimentalMeshOcclusion/Shaders/OcclusionMesh.shader +++ b/Assets/TangoSDK/Examples/ExperimentalMeshOcclusion/Shaders/OcclusionMesh.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + //----------------------------------------------------------------------- // // @@ -37,7 +39,7 @@ Shader "Custom/OcclusionMesh" v2f vert(appdata_base v) { v2f o; - o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + o.pos = UnityObjectToClipPos(v.vertex); o.projPos = ComputeScreenPos(o.pos); return o; diff --git a/Assets/Tree.prefab b/Assets/Tree.prefab deleted file mode 100644 index d36d9fc..0000000 Binary files a/Assets/Tree.prefab and /dev/null differ diff --git a/Assets/Tree_Textures/diffuse.png b/Assets/Tree_Textures/diffuse.png deleted file mode 100644 index 1176261..0000000 Binary files a/Assets/Tree_Textures/diffuse.png and /dev/null differ diff --git a/Assets/Tree_Textures/normal_specular.png b/Assets/Tree_Textures/normal_specular.png deleted file mode 100644 index 349f841..0000000 Binary files a/Assets/Tree_Textures/normal_specular.png and /dev/null differ diff --git a/Assets/Tree_Textures/shadow.png b/Assets/Tree_Textures/shadow.png deleted file mode 100644 index b34d31f..0000000 Binary files a/Assets/Tree_Textures/shadow.png and /dev/null differ diff --git a/Assets/Tree_Textures/translucency_gloss.png b/Assets/Tree_Textures/translucency_gloss.png deleted file mode 100644 index 6b1fbc3..0000000 Binary files a/Assets/Tree_Textures/translucency_gloss.png and /dev/null differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 79bf22f..7990793 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 069bc88..6e4d03d 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.4.0f3 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.1f1 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index a352611..32b8049 100644 Binary files a/ProjectSettings/QualitySettings.asset and b/ProjectSettings/QualitySettings.asset differ