SFML community forums

Help => Graphics => Topic started by: Phoenixangel on June 24, 2008, 12:43:34 am

Title: [Solved] Unwanted pixels showing up...
Post by: Phoenixangel on June 24, 2008, 12:43:34 am
An image is still worth a thousand words, right? ^_^'
(http://91.121.81.211/phoenixangel/web/screen.jpg)

I would like to know why I get those ugly unwanted pixels... and how to get rid of them

I loaded my images from BMP with a fuschia background
CreateMaskFromColor(sf::Color(255,0,255,255), 0)
then, I made my sprites from the modified images

I also tried to use PNG with an already transparent background but it did the same...
Title: [Solved] Unwanted pixels showing up...
Post by: NewbiZ on June 24, 2008, 01:51:19 am
Right after the loading of your image:
Code: [Select]
image->SetSmooth( false );
Title: [Solved] Unwanted pixels showing up...
Post by: Phoenixangel on June 24, 2008, 02:02:01 am
thanks ^^
Title: [Solved] Unwanted pixels showing up...
Post by: quasius on June 24, 2008, 06:13:22 am
Another solution that preserves the pixel smoothing is to use a source image that has a "border" of correct-color pixels around the actual sampled area.  What's happening is OpenGL is trying to apply a linear interpolation filter to your sprite that's grabbing the pixel neighbor of each pixel.  If the border pixel is fuschia, you'll get the artifacts you're seeing.
Title: Re: Unwanted pixels showing up...
Post by: acrin1 on June 27, 2008, 01:51:02 pm
Quote from: "Phoenixangel"
I would like to know why I get those ugly unwanted pixels... and how to get rid of them


Apologies as this is not strictly speaking an SFML query but I have the same problem described above with the OpenGL part of my SFML program and wondered if someone could suggest any obvious changes as there are obviously quite a lot of experienced SFML/OpenGL users here:

(http://www.crpgdev.com/images/view_artifact.png)

The arch in the screenshot is a transparent PNG rendered as a quad but I get a flickering artifact line running along the bottom of the quad depending on the position of the quad. Are there any obvious OGL settings I should investigate? (I'm trying to re-create the original game hence the "flat" arch rather than a real 3D arch model).

Many thanks.