Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Solved] Unwanted pixels showing up...  (Read 4087 times)

0 Members and 1 Guest are viewing this topic.

Phoenixangel

  • Newbie
  • *
  • Posts: 2
    • View Profile
[Solved] Unwanted pixels showing up...
« on: June 24, 2008, 12:43:34 am »
An image is still worth a thousand words, right? ^_^'


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...

NewbiZ

  • Newbie
  • *
  • Posts: 44
    • View Profile
[Solved] Unwanted pixels showing up...
« Reply #1 on: June 24, 2008, 01:51:19 am »
Right after the loading of your image:
Code: [Select]
image->SetSmooth( false );
~ Passer pour un idiot aux yeux d'un imbécile est une volupté de fin gourmet ~

Phoenixangel

  • Newbie
  • *
  • Posts: 2
    • View Profile
[Solved] Unwanted pixels showing up...
« Reply #2 on: June 24, 2008, 02:02:01 am »
thanks ^^

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
[Solved] Unwanted pixels showing up...
« Reply #3 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.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Re: Unwanted pixels showing up...
« Reply #4 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:



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.

 

anything