So I had a bit of time this weekend to work on adding multimaterial support to my marching cubes demo. I really wanted to get around to wang tiles (makes textures look more organic when tiled) but things took a lot longer then expected. That being said I got most of the multimaterial support done so I thought I’d post the demo for that.
Lets start with some screen shots:
An image of some nice blending action:
<span style=“text-decoration:underline;”>VERY</span> Primitive editing tool:
Stupid structure I made with it:
Here’s an image of the atlas I’m using:
So notice that only 1/4 of the each texture is being used. This because It seems that need to support all the mipmapping levels.
I know in theory that I should beable to use more of the texture’s resolution and just support less mipmap levels.Specifically I tried what this guy talks about http://mtnphil.wordpress.com/2011/09/26/terrain-texture-atlas-construction/.
But this is the result that I get:
This might be fixed if i manually set the mipmap level upon loading the atlas but I’m not exactly sure there is an API supported by JME to do that.
I also did a technical blog post on how this all works:
You might wana check out the shader code at the end.
Here’s the runnable demo:
Sorry its so big i accidentally packed it wrong…
I’ll have a new one posted next week so you might just wana wait.