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

Author Topic: Two small graphics problems.  (Read 5201 times)

0 Members and 2 Guests are viewing this topic.

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
Two small graphics problems.
« on: July 29, 2009, 05:13:43 am »
I have a video(913kb) showing the two problems I am having.

First is the white lines. The sprite sheet I have has white padding. Is there any way to solve this with out editing the image?

Second, witch is kind of hard to see, is it looks quit shaky when moving. The movement is using a sf::View and setting the center to the sprites position every frame. Is there a better way for the camera to follow the sprite?
Edit Fixed this one. I was drawing before moving the view. Now i move the view and then draw.
But I now have a new problem. Why does turning on vsync use one prosseser? vsync off and frame limit at 60 3-4% cpu usage vsync on no matter what the frame limit is 100% cpu usage.

The code can all be found at my projects Google code page.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Two small graphics problems.
« Reply #1 on: July 29, 2009, 08:01:19 am »
I can't play your video, you should rather post a screenshot.

You shouldn't use both V-sync and framerate limit at the same time.
Laurent Gomila - SFML developer

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
Two small graphics problems.
« Reply #2 on: July 29, 2009, 08:42:53 am »
I am not using them at the same time.
When vsync is on by its self. It uses 100% cpu.
When frame limiting is on by its self at 60 fps it uses 4% cpu.

I have a nvidia gtx 285 with the latest drivers.

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
Two small graphics problems.
« Reply #3 on: July 29, 2009, 05:24:07 pm »
With one of my other problems.
Sometimes there are these white bars.

or


the sprite sheet I am using


Is there a way to fix this without changing the images?

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
Two small graphics problems.
« Reply #4 on: July 29, 2009, 05:42:46 pm »
well, between each of your tiles of the image is a white line. i guess thats your problem xD

to fix that, you need to place the subrect of the sprite not +width but +width+1 or something

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
Two small graphics problems.
« Reply #5 on: July 29, 2009, 05:49:58 pm »
Only problem is the top bar and bottom bars. Some/most sprites are right on the bottom so i cannot cut off a pixel. I know that this has something to do with Anti Aliasing/ smoothing.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Two small graphics problems.
« Reply #6 on: July 29, 2009, 05:57:26 pm »
Which version of SFML are you using? If it's 1.5, you should try the last revision from SVN. There's a fix for this kind of issues.
Laurent Gomila - SFML developer

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
Two small graphics problems.
« Reply #7 on: July 29, 2009, 06:03:54 pm »
I fixed it using Image->CreateMaskFromColor(sf::Color(255,255,255)); to make the padding all transparent.
But I am still wondering about vsync.