Author Topic: Half-Pixel-Offset still being applied in 3.7.1 when using -force-opengl  (Read 1739 times)

Wisteso

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 3
  • Posts: 103
    • View Profile
I've been using this fix for UIPanel.Awake() in my own code since 3.5.8 and have had no issues, and I suggested it a while back, but I'm still not seeing the following change in NGUI 3.7.1 and was curious why...

  1. if (mHalfPixelOffset) mHalfPixelOffset = (SystemInfo.graphicsShaderLevel < 40) && (SystemInfo.graphicsDeviceVersion.Contains("Direct3D"));

Otherwise the half-pixel-offset is applied when the Windows-based Players/Editor is run with -force-opengl when it should only be applied to DirectX APIs.

There might be a better way to determine if Direct3D API is active, but I've only found the above solution to be effective per the information here...  http://docs.unity3d.com/ScriptReference/SystemInfo-graphicsDeviceVersion.html
« Last Edit: August 31, 2014, 03:53:11 AM by Wisteso »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Half-Pixel-Offset still being applied in 3.7.1 when using -force-opengl
« Reply #1 on: August 31, 2014, 03:00:07 PM »
That seems like a fine change, thanks.