Author Topic: SlicedSprite border offset and Direct3D  (Read 6543 times)

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
SlicedSprite border offset and Direct3D
« on: November 04, 2014, 06:44:03 AM »
Hi!

I switched back from DFGUI to NGUI and I have a question.

Unity 4.5.5f1, NGUI 3.7.5

I create simple SlicedSprite and looks like the sprite has border offset (attachments). "Use Direct3D 11" settings is disabled.
If I enable "Use Direct3D 11" checkbox in Player Settings, sprite border becomes ok.

If I'm not mistaken a year ago this was not. It is normal behaviour?

The only thing similar that I found to the forum:
http://www.tasharen.com/forum/index.php?topic=9253.msg44510#msg44510

Thanks!

BrightBit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Re: SlicedSprite border offset and Direct3D
« Reply #1 on: November 04, 2014, 08:17:20 AM »
Hi broken,

as far as I know it seems to be normal behaviour. I'm currently creating a pixel perfect retro GUI where I can see and "feel" every pixel. At one point I had to use MeshColliders for some buttons and I positioned them without offsets. It turned out that the Hover animation for my buttons started earlier or later depending on which site of the button the mouse entered first.
I then added the offsets and everything works fine now.

I still would like to know the reasoning behind those offsets.


Cheers
BrightBit
« Last Edit: November 04, 2014, 12:02:13 PM by BrightBit »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: SlicedSprite border offset and Direct3D
« Reply #2 on: November 04, 2014, 10:31:46 AM »
DirectX9 has this weird half-pixel offset. If I don't offset by half a pixel, everything becomes blurry. You can google "dx9 half pixel" for more info.