Shanee wrote:
...when trying to add volumes at the end of the world (below it, at maximum height, at the sides, etc) it will turn areas black even if you are using an actual material (grass/rock, etc), why would that be? could it be related?
I don't think they are going black, I think they are just not being drawn (and the background is black). This is because the algorithm does not know what is outside the volume. It's an old demo, and Volumes now have the concept of a border voxel (like clamp to border in DirectX) which solves this.
Shanee wrote:
Btw, what is the size of that world? How is it smoothed? Just trying to gather tips for my own initial version of the editor. Also, I see you are having 3 textures but they are not blended. Are you using an atlas and choosing the proper texture by the index (material data)? Or are you just sampling 3 textures and choosing which one to display according to the index?
I think it's 512x512x256. The easiest way to generate smooth terrain is to generate the volume in two passes. In the first pass you can set each voxel's density to either 0 or to the maximum value. In the second pass you can make each voxel's density the average of itself and it neighbours. This essentially blurs the density values.
Keeping smooth density values while editing is going to be a lot more tricky. You have to implement the equivelent of a soft-edge brush from a paint program, rather than a hard edged brush (does that make sense?). I have not done this so you will need to do some research and experimentation to find the best way.
In the demo I'm actually cheating, because it predates support for density values in PolyVox. It was a binary value (as though the density was always 0 or max) but then I used conventional mesh smoothing techniques to smooth the surface. However, if I was writing this demo now I would not do that - I would use the real density values as described previously.
For the texturing I don't remember - I think I just passed each texture in as a seperate texture unit. But texture atlases/arrays are a better option for a large number of textures. The material code is part of the terrain editor download, you can find it in 'share\thermite\apps\TechDemo\materials'