Quote:
I see... and did you also use a material of one for the empty voxels?
Anyway, in order to solve your hole maybe you could send me a copy of the volume so I can load it into Thermite? I've never really tried this before but you should be able to use the 'saveAsRaw()' function in Serialization.h. It might be quite large, so zip it up in that case. I'm not sure if this forum supports attachments, use them if you can but otherwise email it to me.
No, all material IDs are zero for empty voxels. When I have time for that I will make a volume file and send it to you. You must know, my Internet connection is pretty slow, so an upload of 20mb could take some hours.

[WuTz]! wrote:
Yes I understood it.

But the smoothing part is not really clear to me. Would be great if you would explain it to me.
The smooth surfaces work something like this. PolyVox looks at two voxels at a time, and if one is empty and the other is solid then PolyVox places a vertex of a triangle between the two voxels. Under the old system this vertex was always placed exactly halfway between the two voxels. Under the new system it does not have to go exactly halfway between, instead the position is calculated from the densities.
The key to achiving a smooth mesh is to avoid having a completly solid (density 15) voxel next to a completly empty (density 0) voxel. Instead, density values should gently fade off towards the edge of the object (as shown in my 2D example image on the previous page).
Quote:
An alternative is to create your terrain using only densities of 0 and 15 and then blur the result. Looking again at my image on the previous page, you can see that the soft circle is just a blurred version of the sharp one. I have added a function in Filters.h called smoothRegion() which will basically blur a part of the volume.
I think that is the easiest and best looking method.

Because you'll get a problem when adding more and more spheres with a falloff to the volume. Inside would be a mess.
But that method has it's problems, too. When I do something like that:
Code:
void WVoxelTerrainComponent::CreateVoxelSphereAt(D3DXVECTOR3* Pos, float Radius,UINT MaterialID)
{
for(UINT x=0;x<Radius;x++)
{
for(UINT y=0;y<Radius;y++)
{
for(UINT z=0;z<Radius;z++)
{
D3DXVECTOR3 cp=D3DXVECTOR3(x-((float)Radius/2),y-((float)Radius/2),z-((float)Radius/2));
if(D3DXVec3Length(&cp)<(float)Radius/2)
{
if( x+Pos->x-(Radius/2) < 0 || x+Pos->x-(Radius/2) >GridSize.x-1 ||
y+Pos->y-(Radius/2) < 0 || y+Pos->y-(Radius/2) >GridSize.y-1||
z+Pos->z-(Radius/2) < 0 || z+Pos->z-(Radius/2) >GridSize.z-1)
{
continue;
}
VoxelVolume->setVoxelAt(x+Pos->x-(Radius/2),y+Pos->y-(Radius/2),z+Pos->z-(Radius/2),MaterialDensityPair44(MaterialID,ncDEFAULT_DENSITY));
}
}
}
}
smoothRegion(*VoxelVolume,Region(Vector3DInt16(Pos->x-Radius,Pos->y-Radius,Pos->z-Radius),Vector3DInt16(Pos->x+Radius,Pos->y+Radius,Pos->z+Radius)));
GenerateMesh();
}
that gives problems because I place a sphere, and that function smoothes a cube. When I place some spheres together, I get holes (Normal holes) in the ground, because it gets oversmoothed at the borders where no voxels of the sphere are.
Is there a possibility to turn the smoothing region into a sphere?
Anyways,
great work! I got it smoother than ever before!

Edit: Another thing you might want to know: The code I posted above seems to produce a better sphere than the function of the OpenGL sample. With that function, every sphere had a spike on its sides, and also I got many many buggy holes with it. So, you may want to try it out?