David Williams wrote:
I'm not sure whether you follow our blog, but there have been a few posts recently about doing smooth voxel terrain using PolyVox and the Gameplay3D engine. For example, check out
the most recent post. The reason I'm working on this is (as you say) that there are problems with all the multi-material approaches I know of both in PolyVox and in other voxel engines.
The good news is that I have indeed come up with a new approach which offers a lot of flexibility compared to previous approaches. The bad news is that I don't want to talk about it too much in public as I would like to try and get a research paper out of this. So it will become public information in a few months but for now I won't go into too many details.
Neat.

That looks promising, idd.
I overflew some articles of the blog but i didnt rly shove deep i have to admit... I will totally read that paper when it comes out. ( Hopefully soon.

)
David Williams wrote:
But if you drop me an email I don't mind outlining the basic approach I'm taking and you can see if it is of interest to you. It's quite complex though, and relies on some changes I made locally to PolyVox which are not yet available in Git.
I would be interested in your approach but if i had to make a guess i would say you use something like runtime created texture splatting.
I thought about unwrapping the mesh and using a 2D projection ( UV-Unwrap ) with a splatting attempt, myself. Its even more efficient: No unwrapping needed. "Simply" assigning UV coordiantes to the different cases...
But there are... A LOT of cases per Material. The cases grow exponentially. Its ridiculous. oô
The naive approaches grows with x^x^x where x is the number of materials possible.
There we can use some of the knowledge we got from the marching cubes algorithm: We exploit rotations and mirroring.
I unfortunately didnt get the bitmask thingy there, but it looks pretty much promising. I will totally look into this one... Oh dear lord, why do you keep sending me ideas over my knowledge?

( Well, at least you send me David, bud, so i guess its something like divine justness... XD )
David Williams wrote:
Ok, back to your approach now.
My first question would be to ask what are the benefits of storing the materials IDs in a 3D texture rather than storing them as vertex properties. I don't think it solves the issue of interpolation between materials? But on to your questions:
I thought about it, but i didnt want to recompile the whole engine, since the engine i use doesnt support custom Vertex layouts. Its pretty restricted in that area...
David Williams wrote:
Yes, the texture coordinates are all on the range 0.0 - 1.0 (same as with 2D textures). Mipmapping and interpolation are possible but optional so it's up to you whether you want to use them. You should check the OpenGL docs regarding the offset but you may need to do something here. Googling for 'openGL half texel offset' might throw up some useful results.
Thats what i meant with the offset.

It was a shot into the blue, but it seems to be at least half correct.

David Williams wrote:
Yes, you can optionally perform mipmapping. As with interpolation it doesn't really make sense with material IDs...
Thats quite correct... I dont even know why it was a problem for me... Maybe i was worried about the performance impact of disabling mipmapping.
David Williams wrote:
I guess you can just use the world-space position of the fragment, scaled down by a fator of 64?
Yep, i would do it like that.
David Williams wrote:
You might also investigate how texture splatting work for conventional heightmapped terrain, and consider whether this conept can be extended using 3D textures.
Thats why i think i know what your paper will be about.

I implemented simple texture splatting as a little shader exercise some time ago, when i was about to learn GLSL.
See above for my thoughts about this topic... I guess this may work. I dont know how fast the unwrapping is and wether i can find a satisfying method to create and use a lookuptable, but as said above: I wanted to get the hang of the mechanics of marching cube anyway, so i guess i will find some valuable hints when i dig deeper into this topic.
Thanks a lot so far, David, i really appreciate it.

Initial thoughts of me and a friend on the problem... we narrowed it down quite a bit so far.

Uploaded with
ImageShack.usOn the left is a encoded material table. Every color symbolizes one material. In theory it works. But.. look below...
Edit:
I just noticed that i can dump that idea, too, since it needs the vertices to be NOT shared.
I will recompile the engine with a custom Vertex layout, i guess. Oh gosh, that fucks me off right now...