Eldemarkki / Marching-Cubes-Terrain

Marching Cubes terrain implementation in Unity using the Job System and the Burst compiler
MIT License
562 stars 80 forks source link

No vertices nor triangles #6

Closed Nocktion closed 4 years ago

Nocktion commented 4 years ago

I tried out the system the other day and it simply didn't work. Basically, there are no vertices and therefore no triangles generated in the example scene.

After I saw, that the terrain generation didn't work I modified the code slightly to generate completely flat chunks. Surprisingly, chunks have been created on top of each other.

So that's it. The system simply doesn't work as expected. Ohh and I tried out the Terrain Editor on a flat chunk and I simply got a KeyNotFoundException.

EDIT #1: Position has to be multiplied by chunkSize in order to avoid overlapping chunks and as of the chunks placed on top of each other, it was my mistake as I didn't notice that the system generates cubical chunks, but the terrain noise still doesn't work.

Eldemarkki commented 4 years ago

Hey! Could you tell me what branch are you on so I can figure out what's going on. I'll try to fix it as soon as possible.

Eldemarkki commented 4 years ago

I just checked all the branches using their latest commit and all of them were working. Did you make any changes to the project?

Nocktion commented 4 years ago

Hey! The problem appeared on the master branch and I didn't make any changes to the code. I just simply opened the example seen and hit play.

Since then, I rewrote the whole system. So I transformed it into a high-performance ECS terrain engine. Therefore I can't verify if the problem still exists though.

Eldemarkki commented 4 years ago

That is very strange, because it works for me.

Are you sure you opened the correct scene (did it have a "World" game object in it?). Sometimes Unity just opens an empty scene, and obviously it doesn't work in that.

Nocktion commented 4 years ago

I'm absolutely sure. I tried the base setup in the SampleScene. Chunks were generated just perfectly, but their meshes were empty. Then I replaced the TerrainNoise with FlatPlane in the Chunk initialization and a flat plane was generated just perfectly. The same is true for the Sphere.

Everything else works fine, but the TerrainNoise just doesn't work as expected.

Eldemarkki commented 4 years ago

Could you describe what do you mean by "doesn't work as expected"? For now, it should only generate a terrain with perlin noise as the height.

Nocktion commented 4 years ago

Well, this does not happen. By doesn't work as expected I mean it doesn't work at all. All the meshes are empty, no triangles nor vertices.