Precision error in DirectX mode with trigonometric functions

  • Posts: 159
1 month 2 weeks ago #1 by Fu-Bama
Hello.
When using DirectX mode and PerfectPerspective.fx shader with Vertical distortion = 0 and K > 0 there is an error, not present in OpenGL.
...a vertical distortion in the middle.


When you look at the univPerspective function (line 191), there are inputs l = 0 and k > 0, which make variable R ≈ 0 when at the middle of the screen.
Later R is in denominator. I suppose there is some difference at compilation time between DirecX and OpenGL or maybe different implementation of trigonometric functions.

Does anyone have some clue what's causing the issue? OpenGL doesn't have one.

Please Log in or Create an account to join the conversation.

  • Posts: 3727
1 month 2 weeks ago #2 by crosire
Mmh. I'm not seeing that in my DX test app. Which DX API version was that with?

Please Log in or Create an account to join the conversation.

  • Posts: 159
1 month 4 days ago - 1 month 1 day ago #3 by Fu-Bama
Screenshot is from Mirror's Edge (2009) on DirectX9 32-bit

Please Log in or Create an account to join the conversation.