{"action":"opened","issue":{"url":"https://api.github.com/repos/Scrawk/Marching-Cubes-On-The-GPU/issues/1","repository_url":"https://api.github.com/repos/Scrawk/Marching-Cubes-On-The-GPU","labels_url":"https://api.github.com/repos/Scrawk/Marching-Cubes-On-The-GPU/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Scrawk/Marching-Cubes-On-The-GPU/issues/1/comments","events_url":"https://api.github.com/repos/Scrawk/Marching-Cubes-On-The-GPU/issues/1/events","html_url":"https://github.com/Scrawk/Marching-Cubes-On-The-GPU/issues/1","id":352317391,"node_id":"MDU6SXNzdWUzNTIzMTczOTE=","number":1,"title":"Normals are NaN Vectors","user":{"login":"McThrok","id":17712540,"node_id":"MDQ6VXNlcjE3NzEyNTQw","avatar_url":"https://avatars2.githubusercontent.com/u/17712540?v=4","gravatar_id":"","url":"https://api.github.com/users/McThrok","html_url":"https://github.com/McThrok","followers_url":"https://api.github.com/users/McThrok/followers","following_url":"https://api.github.com/users/McThrok/following{/other_user}","gists_url":"https://api.github.com/users/McThrok/gists{/gist_id}","starred_url":"https://api.github.com/users/McThrok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/McThrok/subscriptions","organizations_url":"https://api.github.com/users/McThrok/orgs","repos_url":"https://api.github.com/users/McThrok/repos","events_url":"https://api.github.com/users/McThrok/events{/privacy}","received_events_url":"https://api.github.com/users/McThrok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-20T22:21:28Z","updated_at":"2018-08-20T22:21:28Z","closed_at":null,"author_association":"NONE","body":"I experiment with your code. Firstly I provisionally removed perlin noise to work with simply plain or cube. I've just overwritten m_perlinNoise shader result.\r\n\r\n```            \r\nfloat[] verts = new float[SIZE];\r\nm_noiseBuffer.GetData(verts);\r\n\r\nfor (int z = 0; z < N; z++)\r\n    for (int y = 0; y < N; y++)\r\n        for (int x = 0; x < N; x++)\r\n        {\r\n            verts[x + y * N + z * N * N] = 1;\r\n\r\n            if (z < 3)\r\n                verts[x + y * N + z * N * N] = -1;\r\n        }\r\n\r\nm_noiseBuffer.SetData(verts);\r\n```\r\n\r\nBut Igot a black plain. I've checked that all generated vertices have NaN vector normals (using your ReadBackMesh func).\r\n\r\nI've also found a clue. This displays a color:\r\n```\r\nfloat[] verts = new float[SIZE];\r\nm_noiseBuffer.GetData(verts);\r\n\r\nfor (int z = 0; z < N; z++)\r\n    for (int y = 0; y < N; y++)\r\n        for (int x = 0; x < N; x++)\r\n        {\r\n            verts[x + y * N + z * N * N] = 1;\r\n\r\n            if (z == 3)\r\n                verts[x + y * N + z * N * N] = 0.9f;\r\n\r\n            if (z < 3)\r\n                verts[x + y * N + z * N * N] = -1;\r\n        }\r\n\r\nm_noiseBuffer.SetData(verts);\r\n```\r\n\r\nNormals depend on deeper vertices and those have to have different values?"}}
{"actor":{"display_login":"McThrok"}}