Commit graph

66 commits

Author SHA1 Message Date
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
Jules Blok
a04edbcb9a VideoConfig: Add separation and convergence modifiers to the game ini. 2014-11-24 15:10:52 +01:00
Jules Blok
0f4d59f612 VideoConfig: Rename StereoFocalLength to StereoConvergence. 2014-11-24 11:58:38 +01:00
Jules Blok
f3ddf37d07 VideoCommon: Switch to Nvidia stereoscopy offset formula. 2014-11-23 14:27:40 +01:00
Jules Blok
51a4d6a4be GeometryShader: Adjust positions after projection.
By adjusting the positions in clip space we can avoid the re-projection.
2014-11-23 14:27:40 +01:00
Jules Blok
1261bd02ca VertexShaderManager: Add stereoscopy options to swap the left and right eye. 2014-11-23 14:27:39 +01:00
Jules Blok
9b22e15180 VideoConfigDiag: Add stereoscopy options group. 2014-11-23 14:27:38 +01:00
Jules Blok
6cacfad010 GeometryShader: Transform the projection within the geometry shader.
Reduces the amount of data transferred through uniforms.
The shearing transformation is reduced to a single multiplication/addition for optimization.
2014-11-23 14:27:38 +01:00
Jules Blok
f6ea293027 VertexShaderManager: Compute stereoscopy projection matrices. 2014-11-23 14:23:41 +01:00
Jules Blok
b005f61a2e Add geometry shader generator for stereo 3D. 2014-11-23 14:22:55 +01:00
Yuriy O'Donnell
dc08de028c Moved projection epsilon to a more reasonable place 2014-11-09 15:25:49 +01:00
comex
b29e5146ec Convert some VideoCommon stuff to BitSet.
Now with a minor performance improvement removed for no reason.
2014-10-25 16:57:25 -04:00
Yuriy O'Donnell
db497cc55f Added projection matrix epsilon that fixes depth clipping issues in some games 2014-10-23 00:20:47 +02:00
comex
f0131c2e09 Mechanical changes to move most CP state to a struct rather than separate globals.
The next commit will add a separate copy of the struct and the ability
for LoadCPReg to work on it.
2014-09-28 21:23:29 -04:00
Rohit Nirmal
fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
Shawn Hoffman
4bf031c064 msvc: resolve all warnings in VideoCommon. 2014-08-19 22:33:46 -07:00
Pierre Bourdon
15920d0f10 Merge pull request #394 from degasus/d3d_lighting_fix
VideoCommon: normalize light direction
2014-08-03 21:21:23 -07:00
degasus
6d3f249dcc mark all local variables as static 2014-07-11 16:10:20 +02:00
degasus
22e1aa5bb4 mark all local functions as static 2014-07-11 16:07:23 +02:00
degasus
02ac5e95c8 VideoCommon: normalize lighting direction.
It seems that the lighting direction must be normalized. This fixes lots of lighting issues mostly shown in the d3d backend.
2014-07-03 21:08:19 +02:00
degasus
924ad1ee9f LightingShader: hard code const variable 2014-06-19 16:46:53 +02:00
degasus
027baad73b VideoCommon: use the Light struct in XF memory 2014-06-19 16:33:29 +02:00
magumagu
1357277f40 Video backends: mass-replace "xfregs" with "xfmem". 2014-05-16 18:58:07 -07:00
magumagu
8f5342c442 Video backend: merge global var xfmem into xfregs.
There isn't really any reason to keep them separate.
2014-05-16 18:55:31 -07:00