Commit graph

74 commits

Author SHA1 Message Date
Ryan Houdek
b105d70339 Firin ma lazer 2012-10-09 23:41:05 -05:00
Ryan Houdek
c82b92bfc2 Fix one error. 2012-10-09 23:41:05 -05:00
Ryan Houdek
2fbca145cb Remove bSupportsGLSLLocation since it won't work how I expect it. 2012-10-09 23:41:05 -05:00
Ryan Houdek
4a84c6f742 Add in UBOs, doesn't work yet. Still debugging here. 2012-10-09 23:41:05 -05:00
Ryan Houdek
76e5766a1b Put Vertex Uniforms in to the correct places to get ready for UBOs. 2012-10-09 23:41:04 -05:00
Ryan Houdek
eff019442f Playing through SSBM story made me find this. 2012-10-09 23:37:52 -05:00
Ryan Houdek
b24990ca28 Bit of cleanup. Clean up my massive hack in the ShaderManagerFiles. Almost feature parity with Nvidia CG now I think. Just need to do Alpha test with Dual source blending now. 2012-10-09 23:37:52 -05:00
Ryan Houdek
cf68cc0c61 Add support for GL_ARB_shading_language_420pack so we don't have to binding sampler locations. Also add support for GL_ARB_separate_shader_objects which doesn't currently work for some reason....investigating. 2012-10-09 23:37:52 -05:00
Ryan Houdek
7cec31dbf3 Almost there. 2012-10-09 23:33:02 -05:00
Ryan Houdek
0fc755c4df More stuff 2012-10-09 23:31:31 -05:00
Ryan Houdek
3943840d5c Now CG plays nice with this new stuff. 2012-10-09 23:27:59 -05:00
Ryan Houdek
a357c77257 Add in GLSL setting again.
PS and VS making. Untested and won't work for now.

Add in program shader cache files.

Readd NativeVertexFormat stuffs.

Add in PS and VS cache things.

SetShaders in places.

Fixed EFB cache index computations in OpenGL renderer.

The previous computation was very likely to go out of array bounds,
which could result in crashes on EFB access.

Also, the cache size was rounded down instead of up. This is a problem
since EFB_HEIGHT (528) is not a multiple of EFB_CACHE_RECT_SIZE (64).
2012-10-09 23:23:37 -05:00
Jordan Woyak
722480cb2e Fix compilation with g++ 4.7 and some warnings. Fixes issue 5347. 2012-04-07 15:45:32 -05:00
NeoBrainX
7a1744575d D3D9: Fix texel to pixel mapping when sampling textures properly. 2012-03-24 17:23:03 +01: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
231c13d6ce Added safe vertex shader UIDs for debugging purposes. 2011-09-07 21:03:10 +02:00
NeoBrainX
bcb8d11c1b Reduced the number of redundant vertex shader compilations (possibly to zero).
That one was almost too easy ;P
2011-08-31 20:46:03 +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
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
Nolan Check
7c536b8f15 DX11: Support thick lines and large points with geometry shaders. Lines still aren't drawn with correct thickness, see Twilight Princess map. But the map corners are drawn with correct shadow "blobs" for the first time!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7340 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-03-14 09:38:29 +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
fec3daf713 Create valid vertex shader when using emboss mapping and binormals and tangents are missing. Fixes issue 2867.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6944 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-01-28 04:13:46 +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
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
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
pierre
91036ae160 Slightly adjust z-values calculated in the vertex shader so OGL does not clip the
final rendering of (at least) Sonic Unleashed.

This should be (nearly) invisible in Z16 depth copies and in games, but there is
some chance that it collides with other such border cases. There probably is some
room to decrease the adjustment but 9999999/10000000 is not enough. A static offset 
may be an option, too. I don't know if the game can/does set something like that.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6225 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-09-23 19:38:49 +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
Soren Jorvang
1d05290be7 Include "Hash.h" rather than "hash.h" for case-sensitive file systems.
Fix some compiler warnings.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6141 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-28 15:53:01 +00:00
Rodolfo Osvaldo Bogado
9b0357b5e2 sometimes to advance you have to make a step back.
use plain vertex arrays instead of VBOs to render in Opengl plugin as the nature of the data make VBOs slower. This must bring, depending on the implementation, a good speedup in opengl.
in my system now opengl and d3d9 have a difference of 1 to 5 fps depending of the game.
some cleanup and a little work pointing to future improvements in the way of rendering.
please test and check for any errors.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6139 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-28 15:09:42 +00:00
Rodolfo Osvaldo Bogado
8e4df07353 sorry for the last one, please test this one :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6125 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-25 11:18:46 +00:00
Rodolfo Osvaldo Bogado
3b30019fcb some experiments with lighting, please test an let me know if is a improvement or make things worst
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6124 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-25 03:42:57 +00:00
Rodolfo Osvaldo Bogado
fb1c14e2cc long time no commits :).
fixed one of the last graphic problems in smg, now the glow in the plants and planets must be correct.
the error was caused by a error in lighting calculations. so it must affect other games.
please test and let me know the results.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6103 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-16 22:37:04 +00:00
pierre
468b9bfe68 Fix the OpenGL depth buffer values from the vertex shader.
I am not sure i am understanding what the pipeline really does, and more so what
the GC/WII expects here. If my comments are incorrect, please let me know.

This was tested with MP2:E, ZWW on r6075.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6078 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-08 22:27:35 +00:00
pierre
92b180b71f Opengl and D3D are doing the perspective division differently
Thanks to glennricster for catching this.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6061 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-05 23:04:34 +00:00
pierre
9e4ff175ec Set z-position for opengl, too
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6056 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-08-05 00:09:33 +00:00
Rodolfo Osvaldo Bogado
f78133f261 big changes here:
- Eliminate the useless check for cpu modifications option from efb to ram as it must be enabled always
- use constant names in dx11 for buffer length calculation instead to simplify code reading
- implemented scaled efb copy in opengl, still bugy in some games, the option is not in the gui but will add it when it works perfect
- Change the depth calculation behavior:
if the game use z textures is exactly the same as before.
if the game do not use z texture calculate z values in the vertex shader. the advantage id this approach is that early z culling is applied,
improving fill rate. this mus speed up things, even with ssaa and msaa enabled.
please test for regression and enjoy.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5896 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-18 00:18:31 +00:00
luisr142004
e9e12ff100 cleanup + some eolz
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5842 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-06 13:14:51 +00:00
Rodolfo Osvaldo Bogado
2455037d26 little fix for an error introduced in my last commit, thanks to Soren for pointing the error
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5817 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-01 12:51:55 +00:00
Rodolfo Osvaldo Bogado
d511b50612 this commit is divided in 4 parts:
1 - Optimize pixelshadergen to avoid redundant register overflow math, with this if a game don't need this will be not applied.
this must bring some fill rate back and improve speed a little in fill rate limited systems.
2- some corrections to vertexshadergen to avoid uninitialized texture coordinates, dono if is the correct way to fix it but t least it will make house of the dead overkill playable in dx11.
the bad thing: still missing geometri in dx9, in dx11 it works exactly as on opengl.
3 - some optimization made to improve fps a little wih the latests changes made to fifo.
* back to the original code in beginfield as now it will work right.
* check for efb access more often as a lot of time is lost waiting for efb access
4 - apply a little fix for missing textures in nvidia opengl tanks to  Wagnard28 for finding that nvidia does not like invalid shader id :)
please test for any regression

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5812 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-29 14:40:37 +00:00
Rodolfo Osvaldo Bogado
20e3919033 apply James333 patch to make dx9 plugin use wxwidgets.
some other minor warning fixes.
thanks to James333 nice patch :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5679 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-13 19:41:07 +00:00
NeoBrainX
a6ebc8234f Preparing stuff for DX11:
- be more strict with the input signature of generated pixel shaders
- replace the D3D parameter with an API_TYPE one, so that we can further distinguish between DX9 and DX11
- for what it's worth dx11 (using vs_4_0) doesn't support D3DCOLORtoUBYTE4; added a workaround for this
- add a "dx9-" prefix to the shader cache files to avoid conflicts with dx11 shaders

Apart from that we're calling CommandProcessor::Shutdown() in main.cpp,Shutdown() now.
Delete all files in User/ShaderCache if you want to save a few KB disk space :P


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5659 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-12 15:49:21 +00:00
Rodolfo Osvaldo Bogado
ce3c2700e7 This commit is separate in two parts:
Fix: fix for lighting equations , that must improve lighting in a lot of games (  test smg :) )
experimental speedup: implemented alpha pass using stencil buffer instead of a duplicate shader. i recommend to test this well as i dono if will work the same way in all the systems. i my system it gives a nice 2-5 fps improvement. if it brings problems in any system or game will revert asap.
enjoy

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5653 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-12 12:36:33 +00:00
donkopunchstania
896850b176 Disable change made in 4801.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4876 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-18 06:32:16 +00:00
hrydgard
3e01152793 Shader Disk Cache implementation for D3D. Saves generated shaders on disk. Eliminates "freeze jerks" in D3D plugin the _second_ and later times you play something.... not much to do about the first time. The D3D shader compiler is just slow.
Also assorted cleanup around the shader code.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4869 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-17 17:44:09 +00:00