Commit graph

89 commits

Author SHA1 Message Date
iwubcode
a9d08a31a6 Add configurable toggle that rounds vertices to the nearest pixel when
w=1.  This fixes some games at higher IRs.
2017-04-04 09:52:18 -05:00
Markus Wick
e99cd57eb3 Merge pull request #4935 from Armada651/depth-range-fix
VideoBackends: Set the maximum range when the depth range is oversized.
2017-03-10 18:05:52 +01:00
Stenzek
277829d842 VideoCommon: Eliminate static state in Renderer 2017-03-04 16:39:50 +10:00
gamemasterplc
4c4a96bfc5 Widescreen Hack improvement
Fixes Projection alignment in some N64 VC games. The original code forgot to multiply rawProjection[1] and rawProjection[3].
2017-02-26 12:55:57 -06:00
Jules Blok
a15555fe03 VideoBackends: Use vertex shader depth range if ztexture is used. 2017-02-26 11:34:48 +01:00
Jules Blok
94522d4cf3 OGL: Add support for glDepthRangedNV to handle oversized depth ranges. 2017-02-24 14:54:16 +01:00
Jules Blok
271a9fe7a9 VertexShaderManager: Break up the conditions to make it readable. 2017-01-13 14:01:17 +01:00
Jules Blok
f866748006 VertexShaderGen: Remove the need for an extra UID. 2017-01-13 14:01:17 +01:00
Lioncash
8dcb05802b ShaderManagers: Use aggregate initialization for some variables.
These provide the same semantics, however aggregate initialization
doesn't force the structs to be trivially copyable. memset, on the other
hand, does.
2016-12-10 17:33:51 -05:00
Emmanuel Gil Peyrot
c9e6b05ce9 Core: Remove double newlines at the end of *_LOG messages. 2016-11-02 02:09:33 +00:00
Jules Blok
376cadb862 VertexShaderManager: Explicitly use floating-point variant of abs.
Some compilers don't have an automatic abs() overload for floats.
Doesn't really matter if they use the integer variant here, but
it's better to be explicit about the fact that we're using floats.
2016-09-01 17:23:07 +02:00
Jules Blok
debaf63fe8 VertexShaderGen: Move the sonic epsilon hack to the vertex shader.
In the vertex shader we have control over the depth clipping planes,
so we don't have to offset every floating point value and lose accuracy.
2016-09-01 01:14:14 +02:00
Jules Blok
a8a9348913 OGL: Handle cases where reversed depth is already used. 2016-08-23 15:54:04 +02:00
Lioncash
1392efa91d VertexManagerBase: Get rid of static behavior 2016-08-21 23:30:38 -04:00
Jules Blok
7078216b61 Improve documentation. 2016-08-16 21:09:58 +02:00
Jules Blok
4582853af4 VertexShaderGen: Use reversed depth range. 2016-08-15 13:11:26 +02:00
Jules Blok
92aa7669b5 VertexShaderManager: Use a more accurate depth range.
This fixes the gxtest_depth hwtest.
2016-08-15 13:11:24 +02:00
Jules Blok
c223bd47b9 VideoCommon: Implement depth range equation in vertex shader. 2016-08-15 13:11:23 +02:00
degasus
7833ff25df VideoBackends: Merge Initialize and Shutdown functions. 2016-06-26 12:34:59 +02:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Jules Blok
51a36f27e0 Merge pull request #3448 from Armada651/depth-epsilon
VertexShaderManager: Add an epsilon hack to the perspective projection.
2016-01-18 20:56:18 +01:00
Lioncash
d9fec92628 VideoCommon: Header cleanup
Also remedies places where the video backends and core rely on things
being indirectly included.
2016-01-17 20:11:45 -05:00
Jules Blok
358e458a93 VertexShaderManager: Add an epsilon hack to the perspective projection. 2016-01-05 01:24:54 +01:00
Tillmann Karras
c52c73f762 VideoCommon: VertexManager -> VertexManagerBase
It may be a bit weird to see calls to static functions in
VertexManagerBase now, but at least it's easier to see what's going on.
2015-11-02 11:53:54 +01:00
Lioncash
c756025902 Core: Move a global into a namespace 2015-10-16 22:52:41 -04:00
Lioncash
419fed3952 VertexShaderManager: Get rid of other magic constants 2015-10-15 23:41:42 -04:00
Lioncash
b5b304cff2 VertexShaderManager: Get rid of float pointer casts 2015-10-15 23:34:54 -04:00
Lioncash
8ce04f9a65 General: Replace GC_ALIGN macros with alignas
Standard supported alignment -> out with compiler-specific.
2015-09-06 12:53:51 -04:00
Lioncash
0e41b973c7 VertexShaderManager: Remove unused parameter 2015-08-16 21:07:10 -04:00
Scott Mansell
a1df1f5ae4 Widescreen Heuristic: Cleanup code. 2015-08-01 14:39:34 +12:00
Scott Mansell
615e5db0cb Make the GameCube game widescreen heuristic smarter.
The last heuristic wasn't quite smart enough and had a few
false positives in Mario Kart: Double Dash and Metroid prime 2.

Now we only activate if the game is rendering a 16:9
projection to a 4:3 viewport.
2015-08-01 13:21:53 +12:00
Scott Mansell
bb60bcc42d Heuristic to detect if a gamecube game is rendering 16:9 widescreen.
Someone suggested on IRC that we should make a database of memory
locations in GameCube games which contain the 'Widescreen' setting
so we can automatically detect if the game is in 4:3 or 16:9 mode.

But that's hardly optimal, when the game actually tells the gpu
what aspect ratio to render in. 10 min and 6 lines of code later,
this is the result. Not only does it detect the correct aspect ratio
it does so on the fly.

I'm a little suprised nobody thought about doing this before.
2015-07-27 10:40:41 +12:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Stevoisiak
93b16a4a2d Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
2015-02-25 10:48:21 -05:00
Jules Blok
ff4127cf50 VertexShaderManager: Turn the epsilon hack back on for 3D Vision.
The bug is fixed in version 347.52 of the drivers.
2015-02-21 12:09:49 +01:00
Lioncash
9cdfe889af Coding style cleanup from the zfreeze merge 2015-01-24 15:16:48 -05:00
Scott Mansell
5510c86b81 Move Zfreeze code out individual backends into videoCommon
Also:
 * Implement support for per-vertex PosMatrixIndex
 * Only update zslope constant once when zfreeze is activated.
 * Added a bunch of comments.
2015-01-24 03:22:27 +13:00
Scott Mansell
e88c02dece Ensure that ZSlopes save/restore state correctly.
Had to re-do *ShaderManager so they saved their constant arrays
instead of completly rebuilding them on restore state.
2015-01-23 03:32:31 +13:00
NanoByte011
add59b3bea Fixes Mario Tennis Gimmick Courts and adds support for FastDepthCalc
- Calculate ZSlope every flush but only set PixelShader Constant on Reset Buffer when zfreeze
- Fixed another Pixel Shader bug in D3D that was giving me grief
2015-01-23 03:32:31 +13:00
NanoByte011
937844b9e3 Initial port of zfreeze branch (3.5-1729)
Initial port of original zfreeze branch (3.5-1729) by neobrain into
most recent build of Dolphin.

Makes Rogue Squadron 2 very playable at full speed thanks to recent core
speedups made to Dolphin. Works on DirectX Video plugin only for now.

Enjoy!  and Merry Xmas!!
2015-01-23 03:31:54 +13:00
Jules Blok
b474c4229d VertexShaderManager: Turn off the epsilon hack for Nvidia 3D Vision. 2014-12-29 17:05:39 +01:00
Jules Blok
b406e4e1f2 VideoCommon: Add a separate constants buffer for the geometry shader. 2014-12-14 21:23:13 +01:00
Markus Wick
f00ad2e65c Merge pull request #1656 from kayru/orthographic_projection_epsilon
Moved projection epsilon back to g_fProjectionMatrix[15]
2014-12-05 17:34:50 +01:00
Yuriy O'Donnell
7ba417b73d Moved projection epsilon back to g_fProjectionMatrix[15], which essentially scales vertices instead of just biasing. 2014-12-05 09:41:41 +01:00
Markus Wick
02dae1d1ba VideoCommon: fix include order 2014-12-04 15:15:16 +01:00
Rohit Nirmal
ac22a2184b Fix building with PCH disabled. 2014-12-03 19:59:47 -06:00
skidau
bfc62d2ada Merge pull request #1366 from kayru/orthographic_projection_epsilon
Added projection matrix epsilon that fixes depth clipping issues in some games
2014-12-04 09:10:36 +11:00
Yuriy O'Donnell
a886d8a8ee Renamed DEPTHPARAMS to PIXELCENTERCORRECTION
This shader constant was previously used for depth remapping in D3D and for pixel center correction. Now it only serves one purpose and the new name makes it clear.
2014-11-29 11:42:52 +01:00
Jules Blok
6d51455195 VideoConfig: Further optimize convergence and separation values and update their descriptions.
Previous convergence distance was much too large.
2014-11-27 16:19:26 +01:00