Looks good!
Dynasty wrote:
Does polyvox use a specific coordinate system? There seems to be a lot of differences between different libraries and file formats...
No, PolyVox doesn't define anything here. A volume is just a 3D grid of data, and it's up to you to define which way is 'up' when you load data into it. You also need to match this up with your chosen graphics API.
Dynasty wrote:
How it the performance of the ambient occlusion calculator? I read some old forum posts that said it was inefficient.
I don't know if it's
inefficient but it can certainly be slow. I think there probably is a lot of room for optimisation in there. We were going to use it for Voxeliens but actually it was too slow when editing the terrain.
In the future I would like to try some new approaches to faking ambient occlusion as these should be a lot faster (the calculator does real raycasting to get a physically accurate result... at least to some degree) but I haven't got to that yet.
Dynasty wrote:
I just noticed that the data created by the ambient occlusion calculator gives the result in some sort of texel/3d texture format. I haven't been able to find an Irrlicht function that can directly handle this. Is there a way to convert to a texture that Irrlicht can use? Or should I just switch to Ogre or something.
Indeed, the idea is that you load the resulting data onto the GPU as a 3D texture and then sample it from your pixel shader when rendering. Note that this means you are quite limited for with the maximum size of the ambient occlusion texture, though it would typically be at a lower resolution than the volume data anyway.
If your engine doesn't support 3D textures then in theory you can treat it as a 2D texture atlas instead, though you wouuld need to implement your own texture interpolation between slices. Hmmm, could be complicated.
Overall I would say that we hoped to use the AO but it was too slow for us, and so it hasn't really been used much. We do intend to come back to it in the future.
Dynasty wrote:
Is there a trick to get decent looking lighting? As you can see in the video from 4 seconds to 9 seconds and 17 seconds to 24 seconds, the shading on the blocks is pretty terrible. This is just a single light. It seems like just "dropping in a sun" won't work too well. Especially in caves.
Rather than having an AO calculator which builds a 3D texture you could have one which bakes the lighting directly into the vertex data. This will probably be faster and work on more hardware, and it's something we may look at in the future. However, with this approach it would be harder for voxel geometry to 'cast' occlusion onto non-voxel objects.
In terms of general lighting techniques, well I can't really help here. In theory PolyVox meshes are just regular geometry so you need to find general tutorials about lighting, shadowing, AO, GI, colour bleeding, etc.
That said, I wonder whether the new Voxel Cone Tracing is easier when applied to geometry which came from voxels in the first place...