Hello Guest

Author Topic: 2D Toolkit and point filter sprite  (Read 7915 times)

Noodle

  • Newbie
  • *
  • Posts: 3
    • View Profile
2D Toolkit and point filter sprite
« on: June 29, 2013, 11:47:34 pm »
Hi

I am currently evaluating 2DTK in order to use it in a 2d hd game.

I am quite happy with the product so far. But I have been struggling a bit to get pixel perfect with point point filetered texture.
I don't use bilinear because it makes things look blurry, which is not great for 2d game.

I use a tk2d camera and animated sprite, I'm getting a result that is nearly perfect but has a small artefact ( please take a look at the example )


It will be very nice to you if you could check and tell me if you manage to get this sprite pixel perfect without those artefact ( here is the link : http://mogpandora.free.fr/avatar.png )

Thanks !

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #1 on: June 30, 2013, 11:38:52 am »
Hi, What artefact are you looking at here? I think I'm failing to see the error.

evs

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #2 on: June 30, 2013, 12:11:07 pm »
Hello,

Too small to see without magnification, but the 'chin' on the opposite side to the tongue, the circle is not round, it has a dent in it.

I'm assuming this is what's wrong?

I don't know how to fix it tho'  :-[


cheers

evs

Noodle

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #3 on: June 30, 2013, 12:45:12 pm »
Hello thanks for your answer.

Yes the problem is hard to see, but if you look closely at the chin like evs says, you will notice it.

I think it's pffseted by one pixel on the right and one on the top.

Thanks !

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #4 on: June 30, 2013, 01:47:55 pm »
Is this when running the game, or in the editor viewport?
Is the sprite at a round number position?

Noodle

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #5 on: June 30, 2013, 02:12:00 pm »
It happens both in editor and in game.

yes the sprite is at a round number position, I try to move it a little bit, but couldn't see any difference.

I also manage to get ride of the artefact by destroying/recreating the camera, and playing with reset scale and pixel perfect several times, but after resizing the windows the artefact came back.

Did you try to render the asset I put in my first post using point filter ? Cause if you have the same issue it might help you to figure out whats really happening.

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit and point filter sprite
« Reply #6 on: June 30, 2013, 04:57:51 pm »
Yup I can get this working pixel perfect fine, using a point filter.
Your sprite looks to be one pixel too small, is your camera configured properly?

What I did
1. Create new sprite collection, set to use tk2dCamera, and add this sprite, set point filter & commit.
2. Create a tk2dCamera with no overrides. (default settings)
3. Add sprite to scene, move to 100, 100, 0 - its correct in game view.
* Might need to press play once and stop just to make sure its detected resolution correctly.

No scaling or clicking pixel perfect or anything there. Just the steps above.