Jump to content
  • Advertisement
Sign in to follow this  
juergen1969

Antialiasing

This topic is 3746 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
Advertisement
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
For your first image all I see is a box composed of red lines, with a white background. Is this what I'm supposed to be seeing?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!