Hello, I’ve been following this http://forum.unity3d.com/threads/tutorial-procedural-meshes-and-voxel-terrain-c.198651/ tutorial, but I’ve noticed the chunk loading is rather slow (at least on my system). I deep profiled it and found that the perlin noise is what is taking so long to load due to the many calls to it. So my question is rather than making every call to the noise to determine how the chunk is loading, is there some possible way I can run a call for it at the beginning in order to predetermine how it will load throughout the loading. Is there already tutorial for doing this out there? Is there just an all out more efficient way of voxel terrain generation? I a decent understand of scripting and coding, but I am new to terrain generation so any help would be great. This is just a learning experience so it’s not commercial by any means.
One path would be to simply replace Perlin noise with Simplex noise. One of the goals of Simplex was to reduce the amount of processing power required.
I have done that one actually, but I will check it out anyways.
I suggest using threading if not already, but if you want it much faster you should use the GPU for noise generation. I think there is a free asset called Turbulence.
Using the GPU for noise computing sounds like a good idea. And I didn’t know they had threading capability in unity, I am going to have to look further into that.
@Brainswitch How would I go about threading my chunks, assuming that’s what you meant? Or thread the Noise.Generate(x, y, z) function yet still receive it’s return value?
Mono has threading, which means Unity has it. Although almost everything related to Unity classes (MonoBehaviour, Mesh, MeshCollider etc) needs to be done on the Unity main thread.
I meant threading the noise generation (but GPU noise generation will be much faster anyway), but you should thread the mesh creation - or all parts related to creating the vertices and the normals. Setting them to a Mesh needs to be done on the Unity main thread. You are probably creating a List or an array of Vector3s and then setting chunkMesh.vertices. It’s only the mesh.vertices = array of Vector3s line that needs to be done on the Unity main thread.
Oh yeah, threading the mesh generation is definitely a smart idea, didn’t even think of that, too busy with the noise haha and do you know of any good docs based around GPU noise generation, or GPU processing in general?