Sign in to follow this  

Texture atlas and mipmap problem.

Recommended Posts

Hi all, I'm doing some tests on texture splatting for terrains using a Texture atlas, which stores the different ground types. The rendering goes fine, but the mipmapping gives me a headache. Let me explain my situation: each ground type is tiled across the terrain (wrap address mode, scaled and biased in the pixelshader to sample the atlas correctly and support texture filtering), though seams are visible between the tiles (only when mipmapping is enabled though). I think I understand why this happens: at the border of each "wrap" the texture coordinates go from 0.99999f to 0.00001f, which is a huge jump and the lowest mipmap is thus sampled for that texel. When I give the lowest mipmap in my texture an explicit color (like, red), then you can clearly see that it is the lowest mipmap that peaks through the tiles. I read the article in Shader X3 on using texture atlasses, and there the author calculates the ddx and ddy of the texture coordinates and uses these in the HLSL "tex2D"-instruction to aid in sampling the correct mipmap. This indeed solves the mipmap problem, but it really hurts the framerate (almost 1/3 less on a nVidia 7800 GT card). Is there any reason why this goes so slow? Perhaps someone here has experience using texture atlasses and knows another way of solving the mipmap problem? Thanks a lot in advance!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this