Commit graph

121 commits

Author SHA1 Message Date
Pierre Bourdon
9dad9ebe89 Merge branch 'zcomploc-support'
zcomploc is a feature of the BP which switch depth test from before the alpha
test to after the alpha test. This way, transparent fragments are written to
the depth buffer too.

The current implementation is quite hacky and does not cover all cases but is
enough to fix problems in a lot of game. A complete implementation would
require a multipass rendering method and is attempted in the
zcomploc-experimental branch.

According to testers feedback, fixes bugs in the following games:
- Baten Kaitos
- Baten Kaitos Origins
- 007: Everything or Nothing
- Ty the Tasmanian Tiger
- Tony Hawk's Pro Skater 3

And probably other games too.

Conflicts (because of new-shadercache-uids):
	Source/Core/VideoCommon/Src/PixelShaderGen.cpp
2011-10-04 07:56:13 +02:00
NeoBrainX
81c614fa07 Clean up various things. 2011-09-29 23:32:39 +02:00
NeoBrainX
ddfe219293 Fixup line endings. 2011-09-29 23:32:39 +02:00
NeoBrainX
ca7e8a9e88 Fix pixel lighting. 2011-09-29 23:32:39 +02:00
NeoBrainX
5d075ce507 - D3D9: pass the correct API type to ValidatePixelShaderIDs
- don't load shader cache from disk in d3d9/11 if shader debugging is enabled (we won't have any info about the source shader code otherwise, etc)
- dump shader source codes on safe UIDs mismatch

Thanks to LordMark and [SS] for reporting those to me ;)
2011-09-10 03:10:28 +02:00
NeoBrainX
a021dd7b79 Small fix to the previous commit. 2011-09-09 21:45:11 +02:00
NeoBrainX
b28348066e Improve the shader UID debugging stuff and merge it to VideoCommon, effectively enabling it in D3D9 and D3D11 as well. 2011-09-09 00:32:04 +02:00
NeoBrainX
349a3ae91d Merge remote-tracking branch 'remotes/origin/master' into new-shadercache-uids 2011-09-08 02:14:18 +02:00
NeoBrainX
6c7bda6851 Various fixes and cleanups. 2011-09-08 02:09:44 +02:00
NeoBrainX
98b62d8362 Track alpha blending paramaters in the pixel shader UID. 2011-09-07 21:15:14 +02:00
NeoBrainX
3939f9595a Add runtime checks to make sure we aren't overoptimizing the pixel shader cache. 2011-09-07 21:15:09 +02:00
NeoBrainX
4702de591e Added safe pixel shader UIDs for debugging purposes. 2011-09-07 21:10:06 +02:00
NeoBrainX
df4e337ac9 Fix various pixel shader compilation errors caused by the Direct3D shader compiler going nuts due to uninitialized (and unused) shader variables.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7693 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-09-06 18:37:01 +02:00
Pierre Bourdon
d3ecf98213 Include the zcomploc bit in the shader UID
Fixes issues with switching zcomploc on/off during execution.
2011-09-04 05:38:32 +02:00
Pierre Bourdon
0bdf8646f0 Proof of concept zcomploc implementation
Fixes a few depth related graphics bugs. Example in Baten Kaitos (GKBEAF):

Before: http://i.imgur.com/EDdVA.png
After: http://i.imgur.com/h6GuY.png

Still a few bugs in this implementation: zcomploc switching is not yet
implemented, and the color is wrong with this test: http://codepad.org/7GpxklOi
(red on Dolphin, gray on Wii).
2011-09-04 05:08:09 +02:00
Pierre Bourdon
d710eda0c5 Clean up a bit the shader code generation for alpha test fails 2011-09-04 04:44:50 +02:00
NeoBrainX
4137f287fd Fix a critical bug which caused shaders to be redundantly recompiled when disabling per-pixel depth.
As a nice side effect, the number of redundant shader compilations is now next to zero ;)
2011-08-31 19:45:28 +02:00
NeoBrainX
7f01139d13 Replace the pixel shader UID generation algorithm with a better one which reduces the number of redundant shader compilations by around 30% (can be optimized even further though).
This should help some games which suffer from heavy stuttering like e.g. F-Zero GX or Red Steel 2.
2011-08-31 18:03:33 +02:00
NeoBrainX
08e06b2293 Partially revert revision d511b50612.
Slightly slows down emulation, but deobfuscates the pixel shader gen greatly...
2011-08-31 16:09:54 +02:00
NeoBrainX
8a17e15943 Various cleanups and TODOs. 2011-08-31 16:09:46 +02:00
Rodolfo Osvaldo Bogado
e5210de9d5 just a little cleanup to maintain minimal interfaces
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7591 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-06-10 19:16:09 +00:00
Sonicadvance1
db0c2bca5b Allows DX9 shaders to be SM2 compatible again at the loss of accuracy. SM3 is recommended. Fixes issue 4546.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7585 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-06-04 19:56:18 +00:00
skidau
4079523346 Game-specific video settings:
* Moved the config validity check to reflect the emulator enforced settings at the config dialog
* Removed some obsolete validity checks
* Corrected "EnablePixelLighting" typo in the ini files

Fixes issue 4277.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7374 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-03-19 00:50:34 +00:00
donkopunchstania
35edf1b236 Split shader code generation for lighting into a separate file.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7088 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-05 23:57:12 +00:00
donkopunchstania
c36ed08cfc Rework XF register loading a bit and change how registers are arranged in memory. This removes the assumption that all data for a viewport or projection matrix will be available when index 0 is loaded. Fixes issue 3688 and probably breaks old save states (sorry).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7083 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-05 18:25:34 +00:00
donkopunchstania
d5e5730fef If perspective divide is enabled and texture coordinate Z is 0 then leave texture coordinates alone. Fixes issue 3676.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6964 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-29 08:34:57 +00:00
Rodolfo Osvaldo Bogado
4c58c7ea03 initial implementation of fog range adjust, I don't think is correct or work right but is a start.
some tweaks and fixes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6957 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-29 04:31:56 +00:00
Soren Jorvang
955e3abe9e Clean out the long since bit-rotted video profiling code.
Profiler.{cpp,h} also happened to be the only dupliated
filenames left in Source, the absence of which should make
link-time optimization easier to get working.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6935 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-27 21:57:36 +00:00
Rodolfo Osvaldo Bogado
4c704be0ed second try, a compilable :) fix for issue 3976 and some optimizations to color loading that will not mess with colors.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6917 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-25 22:30:15 +00:00
Shawn Hoffman
efa9e81ca0 buildfix
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6912 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-25 05:57:49 +00:00
Rodolfo Osvaldo Bogado
4c47fd0d49 revert my optimizations until i fix some errors and really fix issue 3976
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6911 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-25 03:45:44 +00:00
Rodolfo Osvaldo Bogado
470ed118f5 little fix for issue 3976.
some optimization for vertex color loading, please test  for any change in game color, this is a optimization so nothing should change :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6908 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-24 21:26:39 +00:00
Rodolfo Osvaldo Bogado
d47d2a05d2 some little optimizations and some cleaning.
now lighting should be fully functional again in SM 2.0 cards

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6794 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-09 14:13:24 +00:00
Rodolfo Osvaldo Bogado
9d30d1348e fix Issue 3539
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6622 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-19 22:24:19 +00:00
nitsuja-
98fe8437ae reduced frequency of dx9 ps_2_0 pixel generation errors, and made dx9 efb depth peek of 16-bit depth buffer not use 24-bit adjustment factor. shouldn't affect other the plugins.
(probably nobody else cares, but I need at least one video plugin that actually works on this computer)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6618 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-19 20:59:23 +00:00
NeoBrainX
aa226aaf41 Revert most stuff from r6517 and revert r6501.
PixelShaderGen changes broke Mario Kart Wii, ClearScreen changes broke Super Mario Sunshine.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6592 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-16 17:40:45 +00:00
Glenn Rice
d171f7277b Fix the nogui build on linux. The software plugin config dialog should not be built.
Fix the default wiimote emulation mouse button settings on linux.
Fix a little c++ operator precedence issue.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6534 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-05 18:10:13 +00:00
Soren Jorvang
f169def36f First pass at dealing with different size_t/off_t sizes in C90 environments.
Most of the code dealing with the LogTypes namespace was C which lead to a
lot of nonsensical casting, so I have dumbed LOG_TYPE and LOG_LEVEL down to
plain C even though the move of wiiuse into Source means we don't currently
call GenericLog from C.

Set logging threshold to MAX_LOGLEVEL at startup so debug builds will also
p  rint debugging messages before the GUI is running.

For some reason the way we use SetDefaultStyle doesn't play nice with wx 2.9
so we just get the default black text on a black background. Using a gray
background works around that problem, but I found it to also be much easier
on the eyes so I have switched the background color on all versions.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6528 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-05 15:59:11 +00:00
Rodolfo Osvaldo Bogado
6df84ddc31 little fix for r6517
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6520 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-05 03:36:37 +00:00
Rodolfo Osvaldo Bogado
c8305a7b7d two fixes in this commit:
first fix for issues introduced in sms in r6501, please test for a regressions in The Calling
Second Fix for Issue 3539, by making pixel Dept calculation an option. in games with this issue Enabling pixel depth will solve the issue, in other games disabling the option will not cause speed lost
some cleanup in dlist cache

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6517 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-04 17:58:33 +00:00
donkopunchstania
f91ac92895 Change comparison in specular light function. Fixes issue 1258.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6505 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-01 04:50:25 +00:00
donkopunchstania
1f660de7e5 Avoid repeatedly asserting in SWG plugin when matrix indices don't match. Small change to the transform unit to avoid some unnecessary work. Check if Q is zero before dividing UV coordinates by it. Fixes issue 3454.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6504 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-01 04:26:21 +00:00
NeoBrainX
76b9e975d5 DX11: Fix mipmaps. Someone forgot creating them at the proper time ;P
DX11: Fix a DX11 debug runtime error caused by the vertex shader output signature and the pixel shader input signature not matching if per-pixel lighting is disabled. Someone forgot disabling those pixel shader parameters ;P
DX11: Enable use of dynamic textures wherever possible.
DX9: Remove two unnecessary TODOs. Someone forgot removing those since they've been obsolete for a long time ;P

Anyway, at least working mipmaps and dynamic textures should increase DX11 performance a bit. And "a bit" is more than my usual "marginally" ;)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6473 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-24 19:13:19 +00:00
gnick79
4267adbd5e Related FOG changes:
* revert back to proper upscale mantissa of parameters A and C
* properly downscale magnitude to 0.24 bits instead than ≡0.23
* Z Eyespace conversion for projection by original patent concept

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6463 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-23 13:57:01 +00:00
Nolan Check
2ec3db44ed OpenGL plugin: Support for dual-source blending, CURRENTLY DISABLED. It doesn't work yet. To fix it, we may need to convert all our shaders to GLSL so that we can use glBindFragDataLocation.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6306 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-23 19:55:19 +00:00
Nolan Check
95cfca08e2 Put infrastructure in place so that other plugins may support dual-source blending.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6296 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-21 05:22:18 +00:00
Nolan Check
cb453a0fb3 DX11 plugin: Do destination-alpha in a single pass. No more drawing the same geometry twice! SMG is faster now because it uses destination-alpha extensively. This uses dual-source color blending, a DirectX 10-level feature. The equivalent OpenGL function comes from the GL_ARB_blend_func_extended extension, which was made core in OpenGL 3.3.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6294 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-20 03:11:22 +00:00
Rodolfo Osvaldo Bogado
7797b9d753 a little bugfix and a small optimization.
this should fix issue 3313 but i can't test it


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6267 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-10 14:35:31 +00:00
Rodolfo Osvaldo Bogado
e641323de2 i know still a lot to fix and much work to do but sometimes experiments are fun :)
for all the plugins implemented per pixel lighting, this will make games that uses lighting  a lot nice. (just look at mario sunshine and compare :))
for dx9: implemented temporal anaglyph stereo: just grab your red-cyan glasses  and enjoy.
stereo calibration: use stereo separation ( distance of the point from you are looking) and Focal Angle: the angle necessary to focus in one particular object.
this settings are different in every games as they use different depth ranges.
please for any regression and bug introduced by this commit.
if you ask why i did not implement stereo in dx11 and opengl the reason is one: they don't work right when i have more time will try to find a way to make them work.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6224 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-09-23 02:17:48 +00:00
Nolan Check
4229d9e01e Remove a bunch of freshly-obsolete code
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6148 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-29 19:34:54 +00:00