   [MDX] Ridding Blur
  How does one double a Sprite without blurring it?What I've done is this...(Never mind the transform being inside the loop, I put it there to avoid having to show two methods. :P)MyDevice.Clear(ClearFlags.Target, Color.Navy, 0.0f, 0);MyDevice.BeginScene();MySprite.Begin(SpriteFlags.None);MySprite.Transform = Matrix.RotationZ(0) *    Matrix.Scaling(2, 2, 1) *    Matrix.Translation(vec);MySprite.Draw(MyLogo, Rectangle.Empty,vec, pos, Color.White);MySprite.End();MyDevice.EndScene();MyDevice.Present();... and what comes out is this...(Those colored lines are suppose to be solid colors, not a gradient)I've even tried disabling random things on my Device...MyDevice.RenderState.AlphaBlendEnable = false;MyDevice.RenderState.DitherEnable = false;
  There could be a number of problems with regards to your sprite texture not rendering correctly. Not using a power of 2 texture might result in quality loss as DirectX will then scale the texture and then I see you are also scaling the texture which will amplify this blurring. Make sure you are using a power of 2 texture with dimensions such as 256x256, 128x128, 64x64, 32x32, and 16x16. You could take a look at Texture filtering here.This is the problem you are having. I have created 2 textures and loaded them up to show you what the difference between 256x256 (power of 2 texture) and a non-power of 2 texture 255x255 looks like when Direct3D loads it.So you see you might want to try to keep to power of 2 textures. This way you don't need to rely on filtering etc...I hope this helps.Take care.   ;  The texture used above is 64x64...   ;  You could try to disable the mip/map filter, maybe that'll solve the problem. It shouldn't be causing any problem when I think about it, but it's worth a shot.Edit: another random guess, try how it turns out without the scaling matrix. Maybe that's causing some minify/magnify filters to be used, causing the blur... If this is the case, you could turn off the texture filters for the sprite rendering to sovle the problem.   ;Quote:Original post by remigiusEdit: another random guess, try how it turns out without the scaling matrix. Maybe that's causing some minify/magnify filters to be used, causing the blur... If this is the case, you could turn off the texture filters for the sprite rendering to sovle the problem.It works fine if I don't scale it, the scaling is causing the blurring. I don't know how to turn off texture filters.. =(;  What you need to do is manually set renderstates for the sprite rendering. I'm sure PIX is going to be able to help you with this. Basically, what happens when you do Sprite.Begin(SpriteFlags.None), is that the renderstates are setup for sprite rendering. If you tell it to leave your render states alone (despite initally not rendering) then you can use point filtering, which has no interpolation.Hth - I will try and provide a code sample soon, if no one else does (or you figure it out yourself).   ;Quote:Original post by acid2What you need to do is manually set renderstates for the sprite rendering. I'm sure PIX is going to be able to help you with this. Basically, what happens when you do Sprite.Begin(SpriteFlags.None), is that the renderstates are setup for sprite rendering. If you tell it to leave your render states alone (despite initally not rendering) then you can use point filtering, which has no interpolation.Hth - I will try and provide a code sample soon, if no one else does (or you figure it out yourself).Please do, as I have not even the slightest clue how to go about fixing this problem.   ;  Heres a code sample:device.SamplerState[0].MagFilter = TextureFilter.Point;I'm not sure if the Sprite interface modifies this value. For completeness, try placing it before Sprite.Begin(), but if that doesn't work, try it after Sprite.Begin().What you're doing is telling DirectX how to filter your texture when it makes it bigger. Normally, it uses linear blending to make stuff smoother, but you don't want that. :)   ;Quote:Original post by sirobHeres a code sample:*** Source Snippet Removed ***I'm not sure if the Sprite interface modifies this value. For completeness, try placing it before Sprite.Begin(), but if that doesn't work, try it after Sprite.Begin().What you're doing is telling DirectX how to filter your texture when it makes it bigger. Normally, it uses linear blending to make stuff smoother, but you don't want that. :)I tried that code snippet before the SpriteFlags, than afterwards, than before the device, than before the preset, than all of them at onces, and than in random places.It didn't fix it. =/;  I got it working with these lines of code..   MySprite.Begin(SpriteFlags.None);   MyDevice.SamplerState[0].MagFilter = TextureFilter.Point;   MyDevice.SamplerState[0].MinFilter = TextureFilter.Point;   MyDevice.SamplerState[0].MipFilter = TextureFilter.Point;... thanks to all who helped. =)