   Geoclipmapping with mipmaps
  Hi,I'm playing around with my own little idea for geoclipmapping on the gpu. My idea was to use mipmaps and linear filtering for the blending between levels of detail. At the end of each geometrical lod ("clip", "rectangle" or whatever they are called) I blend from mipmap level k to k+1, so that it fully uses k+1 before entering geometrical region k+1. This means that the last few vertices have "to little" heightdata and the odd ones have to linearly interpolate between texels, which is exactly what I want because that is my smooth transition.The texture is offset so that vertices either end up in the center of the texel, or in the edge in which case the linear filtering should make it exactly between the two adjacent vertices (when we are at the edge between to levels of detail that is).It all works pretty good, except for _some_ of these odd vertices in between (see picture). I've played around with it all day and I've found out that linear interpolation isn't really supported in vertex shader texture lookup (in this nvidia paper), which is a real bummer (I kinda liked my idea :p). However, the paper is four years old now, and it seems to work in some places for me so I'm thinking maybe something else is at play here. I've been considering if the interpolation is done in 8bit and thus isn't high res enough but I've been told that it's done in 32bit on modern gpus.So I'm pretty much out of ideas how to fix this, I'm posting here as a last resort to see if maybe it might be something else or if somebody has got an idea how to fix it, before I just scrap my idea and go for the one in the original paper instead.The texture in the background is point sampled to clarify, but the one used in the vertex shader is linearly sampled for min,mag and mip. I'm using DirectX 9 (SlimDX), my graphics card is an ATI Radeon HD 3470.Cheers!chot   
Quote:Original post by chotIt all works pretty good, except for _some_ of these odd vertices in between (see picture). I've played around with it all day and I've found out that linear interpolation isn't really supported in vertex shader texture lookup (in this nvidia paper), which is a real bummer (I kinda liked my idea :p). However, the paper is four years old now, and it seems to work in some places for me so I'm thinking maybe something else is at play here. I've been considering if the interpolation is done in 8bit and thus isn't high res enough but I've been told that it's done in 32bit on modern gpus.chotTri/Bilinear filtering depends on GPU & texture format.As far as i know, Dx10 GPUs only do "true" filtering with FP32bits texture formats. with FP16 texture formats (and any other format except FP32) you will end up with inacuracies on some odd vertices.Since your are using Dx9 with a Dx10 AMD GPU and that you can only bind FP32 textures to the vertex sampler, i "guess" you card can't do "true" trilinear filtering on FP32 texture formats or your texture offset is incorrect. You may do manual interpolation in the shader instead of letting the hardware do it or convert the outer degenerate triangle strip into some kind of skirt.edit : AMD doc on ATI Radeon HD 3470 says that your card support "true" FP32 filtering.Dx9 Doc says that you can't use Bi/Trilinear filtering on FP32 texture formats, but it also says "Texture filtering is allowed with vertex texturing but the available filter types depend on hardware (or reference rasterizer) support".NB : your filter should be MIN LINEAR, MAG POINT, MIP LINEAR.[Edited by - filousnt on May 1, 2009 11:24:35 AM];  Knowing that it should be possible (thanks filousnt!) I did some small scale testing and it does in deed seem to work, so I guess my idea should hold, just needs a bit more work (debugging..).I also noticed there is a group of VertexTextureFilterCaps in Caps viewer, which confirms I can do linear mag filtering in the vertex shader. Though, I am a bit concerned about the support on other cards..Mag filter should be linear though, since it's the mag that does the interpolation for me.Cheers   