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

Author Topic: Rendering sprites at floating point positions  (Read 1158 times)

0 Members and 1 Guest are viewing this topic.

uint9

  • Newbie
  • *
  • Posts: 3
    • View Profile
Rendering sprites at floating point positions
« on: March 31, 2013, 03:43:23 pm »
Hello, I am using SFML 2.0.
If I try to draw a sprite between two pixels, it looks like the texture is clamped to integer coordinates before being drawn.

I'm looking for a way to get results similiar to the screenshow below (drawing the same sprite in Love2D), where the texture edges are smoothed between the pixels.

I have tried using texture.setSmooth(true), but it appeared to only affect resizing.

[attachment deleted by admin]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Rendering sprites at floating point positions
« Reply #1 on: March 31, 2013, 07:20:14 pm »
Can you write a very simple application that reproduces the problem, so that we can test it?
Laurent Gomila - SFML developer

uint9

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Rendering sprites at floating point positions
« Reply #2 on: March 31, 2013, 07:59:26 pm »
Thank you for the response!
I wrote a small piece of code and used a different image. Turns out I was using a bad texture the first time, so now it works.

For the record what is this process called?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Rendering sprites at floating point positions
« Reply #3 on: March 31, 2013, 08:13:04 pm »
Quote
For the record what is this process called?
Which process?
Laurent Gomila - SFML developer

uint9

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Rendering sprites at floating point positions
« Reply #4 on: March 31, 2013, 08:53:04 pm »
Smoothing the texture when rasterized at decimal coordinates. After some googling I found another post of yours which explained how it works though, so thanks ;)