Original Post
I have problem generating terrain in marching cubes. My marching cube implementation is in OpenCL. I have 16 * 16 * 16 voxels per block. It works fine when generating a sphere, the only problem is that you can see some small holes between some parts of the sphere. My theory is floating precision, but i dont know.
http://imageshack.us/photo/my-images/833/failsphere.png/
Another problem occur when i tries to generate terrain, with noise:
http://imageshack.us...failterrain.png
As you can see, it does not look well. This was rendered with isolevel 0.9f.
I create the terrain like:
[source lang="cpp"]sampler_t randomVolumeSampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_LINEAR;
density.x = wPos.y;
density.x += read_imagef(randomVolume, randomVolumeSampler, realGridPos).x * 0.25f;[/source]
So i was wondering, if i have implemented marching cube wrong, or if it behaves right,
http://imageshack.us/photo/my-images/833/failsphere.png/
Another problem occur when i tries to generate terrain, with noise:
http://imageshack.us...failterrain.png
As you can see, it does not look well. This was rendered with isolevel 0.9f.
I create the terrain like:
[source lang="cpp"]sampler_t randomVolumeSampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_LINEAR;
density.x = wPos.y;
density.x += read_imagef(randomVolume, randomVolumeSampler, realGridPos).x * 0.25f;[/source]
So i was wondering, if i have implemented marching cube wrong, or if it behaves right,