Monday, December 7, 2009

Seams Like Years…

It’s been a while since I updated this… a really long while, but I’m going to try to get back into it again. My current problem is something I never really fixed the last time: seams. Here’s an example:

Seams

Weirdly enough if I save the textures I generate for the faces they line up fine with no seam (the darkish hole should line up with the pit above):

NoSeamsOnLeftBackAndRightTextures

So, having changed my texture generator around a bit I’m 100% sure it’s my texture code some sort of floating point error how MDX is texturing the faces. There must be a way to get MDX to just display the bitmap I give it & not mess up the edges…

Update 1: I had some mag & min filtering going on which was causing some (but not all of my seam problems. When I got rid of this code:

//    device.SamplerState[0].MinFilter = Direct3D.TextureFilter.Anisotropic;
// device.SamplerState[0].MagFilter = Direct3D.TextureFilter.Anisotropic;



It looks like this now (still a problem with top and bottom patches but going from front to left to back to right and back is seamless now):



FilterSeamsFixed





Not sure what’s causing it, but you can see from front to top to back to bottom the textures I’m generating seem to be slightly offset – the image on the right offsets them in the correct direction and they seem to match much better.



nooffset offset



Update 2: There were some errors in how I collated the heights from sub-patches, now top to bottom match up perfectly, and I have no seams!



NoSeams



NoSeamsTextures





Next back to the adaptive planet (the one that properly changes its patches depending on LOD) and an attempt at making the textures in hardware.

No comments: