Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a 3D scene that I've tried rendering in Direct3D 10 and using WPF's 3D framework. Obviously, going directly to Direct3D is producing far better performance but I am getting banding which doesn't appear using the same scene in WPF.

Does anyone have any tips on removing this type of artifact? It's obviously possible because WPF doesn't have it... If you have any questions about my Direct3D setup I will be please to add that information.

WPF:

enter image description here

Direct3D:

enter image description here

share|improve this question
    
That is called Aliasing, and quite a beautiful and pure example of the effect I must say. A little anti-aliasing is called for, I think. Either that or different sampling options for the source texture, if you're using point. I'm still trying to figure out why the WPF version doesn't display the artifact. –  Patrick Hughes Mar 16 '12 at 2:40
    
Weird. It looks like somehow in the D3D version the mipmaps for the texture are screwed up, with the banding appearing in the first mip level past the base one. Are you generating your own mipmaps or relying on D3D and/or WPF to do it for you? If the latter, perhaps WPF is using a better-quality downsampling filter than D3D. Since your base texture looks like it has a lot of bright and dark lines I could see a poor filter giving odd results. Does the same effect happen with other textures, or just this one? –  Nathan Reed Mar 16 '12 at 2:47
    
@NathanReed good idea, it could very well be the MIPs. –  Patrick Hughes Mar 16 '12 at 3:28
    
I'm relying on both D3D and WPF to generate the mipmaps for me. I will take a look at the filters, thanks for giving me something to go on - I am quite new at all this! –  Groky Mar 16 '12 at 7:29
    
@NathanReed: Indeed, that was my problem - I added D3DX10_FILTER_TRIANGLE to the mip filter flags and all is now un-bandy! If you'd like to turn your comment into an answer I'd love to mark it as the answer to the question. Thank you also Patrick Hughes! –  Groky Mar 16 '12 at 8:03
add comment

1 Answer

It looks like in the D3D version the mipmaps for the texture are screwed up, with the banding appearing in the first mip level past the base one.

If you're using D3D/WPF's built-in mip generation, perhaps WPF is using a better-quality downsampling filter than D3D. Since your base texture looks like it has a lot of bright and dark lines, I could see a poor filter giving odd results.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.