Sign in to follow this  

Antialiasing

This topic is 3554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a problem with antialiasing. (I think so) I have a bitmap(http://www.viart.de/test/test.PNG), which I want to show like in "http://www.viart.de/test/test2.PNG". You can see, what I get. I think it's made from using antialiasing which I not want in this situation. I use SlimDx, which works very good. I use a TriangleList to display the image. device.SetTexture(0, texture); device.DrawPrimitives(PrimitiveType.TriangleList, 0, numOfTriangles); I tried "device.SetRenderState(RenderState.AntialiasedLineEnable, false);" with no effect. What's the way to disable Antialiasing ? Jürgen

Share this post


Link to post
Share on other sites
I tried:

device.SetSamplerState(0, SamplerState.MipFilter, TextureFilter.None);
device.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.None);
device.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.None);

with no result.

Do you have a sample ?

Share this post


Link to post
Share on other sites
That's right. It's only a test image.
The real one is calculated from measurement data.

With this picture I can check if it's shown right.
I only want to see a white image bordered with a red line.
But I get always an antialiased view.
That's very bad for my data.

Share this post


Link to post
Share on other sites
I tested a few things.

1. I made a picture with 4 x4 pixel. I tried it with my old routine.
-> it works without any artefacts
2. picture with 5x5
-> it doesn't work

I tried some other picture formats.
The only ones that are working:

2x2
4x4
8x8
16x16
32x32

That's all I checked.

Any ideas ?

Share this post


Link to post
Share on other sites
When you load the texture, it's automatically resizing the image up to the nearest power of 2. So a 5x5 image on disk will be sized up to 8x8. This is because some older graphics cards do nt support non-power-of-2 textures.

I don't know about SlimDX, but in native DX there's an option to set in D3DXCreateTextureFromFile(). Look for an equivalent option in the API you're using.

Share this post


Link to post
Share on other sites
The image will be resized?
So if I want a better result, I have to create a bitmap to the nearest power of 2 in each direction. After that I copy the original bitmap into the new one leaving the rest blank and use for the uv values in my vertices not 0-1f but 0-0.625.

I think that's the right way.

Share this post


Link to post
Share on other sites

This topic is 3554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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