Hello.
I have an r8g8b8 .dds texture with mipmaps. When i try to sample from it in pixel shader 3.0 using tex2dlod(texturesampler, float4(texcoords,0,miplevel)) it only samples from the top mip level no matter which miplevel I specify.
I'm loading the .dds file with this code:
texture = game.Content.Load<Texture2D>(texturename);
Will this load all of the mipmaps or is there something more that I need to do?
Note: For my purposes I do not want to auto-generate or auto-select mipmaps.
Thanks
tex2dlod only pulls from top mip level of .dds texture
Just a quick check, how is your texture sampler set up? Which filtering options and mipmap options are you using?
Best regards!
Best regards!
uniform const sampler Sampler = sampler_state { texture = <Landcover>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = NONE; AddressU = CLAMP; AddressV = CLAMP;};
Tried changing AddressU and AddressV to Wrap but that doesn't make any difference as I am manually clamping UV's anyway.
Tried setting Mipfilter to Linear but that just a made a big mess and I don't want to automatically select mip levels.
Tried changing AddressU and AddressV to Wrap but that doesn't make any difference as I am manually clamping UV's anyway.
Tried setting Mipfilter to Linear but that just a made a big mess and I don't want to automatically select mip levels.
MipFilter=NONE means don't use mipmaps at all. MipFilter=POINT will select the closest mip level to the one requested. MipFilter=LINEAR means blend between mip levels to get a smooth transition.
The shader controls which mip levels are accessed. tex2d() will automatically calculate them. tex2dlod() will let you specify which one you want to use.
You may find it useful to create a texture where each mip level is a different colour to help debug the shader.
The shader controls which mip levels are accessed. tex2d() will automatically calculate them. tex2dlod() will let you specify which one you want to use.
You may find it useful to create a texture where each mip level is a different colour to help debug the shader.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement