Marc wrote:
Is there a way to know the voxel value corresponding to a vertex? Is it the material atribute of a vertex? (And what is the alpha? Is it an auto-computed opacity or something?).
Yes, it is indeed stored in the material attribute. The value should be between 1 and 255, but because it is a float I add 0.1 when it is generated, and then take the floor() in the shader when I use this value to decide which texture to apply. The 0.1 is just to avoid floating point accuracy issues - it probably isn't necessary but I haven't looked into it.
The alpha value is used when I blend together two adjacent materials to give a smooth transition. But actually it shouldn't be generatred in PolyVox because it is always 1.0 (I think...). It actually gets set later when Thermite checks each triangle to determine whether all it's vertices have the same material.
I need to revisit this, and clarify exactly what gets done by PolyVox and what gets none by Thermite, because at the moment the boundary is a bit vague.
Marc wrote:
I have seen that the surface is extracted where there is a frontier between 0 and any other value. This is always done this way or is there a way to specify one or more isovalues to the method?
It's always done that way. I envisaged that zero represents empty space, and any other value represents a solid material. A boundary between two materials would only be visble if the camera were actually inside one of them, and as they should both be solid this should never happen. However, I accept that if one of the materials was water (so you can get inside it) or glass (so it's partly transparent) then my argument doesn't hold. Is this what your looking at, or some other scenario?
Marc wrote:
Also, I have seen that it there is some material with a value different from 0 that reaches de border of the volume, its surface is not computed. See the two below images for example. The object is a kind of pyramid, and in the second image you can see that its "floor" is missing. I don't know if this is intended to be this way or not, but I think that the floor surface should be computed.
That is the intended behaviour, but I can see why you would want it changed. The marching cubes implementation doesn't look outside the volume and doesn't make any assumptions about what's out there. But presumably you would like it to assume it's zeros? In my hypothetical games I've considered that the camera will always be inside the volume, and so you'll never see the missing polygons.
I don't think I'll change the behaviour in the near future, but adding these polygons should probably be done as a seperate step anyway as it's a special case. So if you really need it you could add it by checking the voxels at the edge of the volume and adding triangles where necessary. But it's probably easier to just move your pyramid so it's fully inside the volume

btw, your project looks interesting!