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
This commit is contained in:
Rodolfo Osvaldo Bogado
2010-09-23 02:17:48 +00:00
parent 5e806eb7b2
commit e641323de2
30 changed files with 558 additions and 79 deletions

View File

@ -92,6 +92,8 @@ struct TabDirect3D : public W32Util::Tab
Button_SetCheck(GetDlgItem(hDlg, IDC_VSYNC), g_Config.bVSync);
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE), g_Config.bSafeTextureCache);
Button_SetCheck(GetDlgItem(hDlg, IDC_DLIST_CACHING), g_Config.bDlistCachingEnable);
Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLEPIXELLIGHTING), g_Config.bEnablePixelLigting);
if (g_Config.iSafeTextureCache_ColorSamples == 0)
@ -141,6 +143,9 @@ struct TabDirect3D : public W32Util::Tab
case IDC_DLIST_CACHING:
g_Config.bDlistCachingEnable = Button_GetCheck(GetDlgItem(hDlg, IDC_DLIST_CACHING)) == 0 ? false : true;
break;
case IDC_ENABLEPIXELLIGHTING:
g_Config.bEnablePixelLigting = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEPIXELLIGHTING)) == 0 ? false : true;
break;
case IDC_EFB_ACCESS_ENABLE:
g_Config.bEFBAccessEnable = Button_GetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE)) == 0 ? false : true;
break;

View File

@ -125,6 +125,16 @@ unsigned int ps_constant_offset_table[] = {
76, 80, // C_INDTEXSCALE, 8
84, 88, 92, 96, 100, 104, // C_INDTEXMTX, 24
108, 112, // C_FOG, 8
116, 120, 124 ,128, // C_COLORMATRIX, 16
132, 136, 140, 144, 148, // C_PLIGHTS0, 20
152, 156, 160, 164, 168, // C_PLIGHTS1, 20
172, 176, 180, 184, 188, // C_PLIGHTS2, 20
192, 196, 200, 204, 208, // C_PLIGHTS3, 20
212, 216, 220, 224, 228, // C_PLIGHTS4, 20
232, 236, 240, 244, 248, // C_PLIGHTS5, 20
252, 256, 260, 264, 268, // C_PLIGHTS6, 20
272, 276, 280, 284, 288, // C_PLIGHTS7, 20
292, 296, 300, 304, // C_PMATERIALS, 16
};
void SetPSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
{
@ -215,7 +225,7 @@ void PixelShaderCache::Shutdown()
g_ps_disk_cache.Close();
}
bool PixelShaderCache::SetShader(bool dstAlpha)
bool PixelShaderCache::SetShader(bool dstAlpha,u32 components)
{
PIXELSHADERUID uid;
GetPixelShaderId(&uid, dstAlpha);
@ -243,7 +253,7 @@ bool PixelShaderCache::SetShader(bool dstAlpha)
}
// need to compile a new shader
const char* code = GeneratePixelShaderCode(dstAlpha, API_D3D11);
const char* code = GeneratePixelShaderCode(dstAlpha, API_D3D11,components);
D3DBlob* pbytecode;
if (!D3D::CompilePixelShader(code, strlen(code), &pbytecode))

View File

@ -32,7 +32,7 @@ public:
static void Init();
static void Clear();
static void Shutdown();
static bool SetShader(bool dstAlpha);
static bool SetShader(bool dstAlpha,u32 components);
static bool InsertByteCode(const PIXELSHADERUID &uid, void* bytecode, unsigned int bytecodelen);
static ID3D11PixelShader* GetColorMatrixProgram();

View File

@ -341,7 +341,7 @@ void Flush()
VertexShaderManager::SetConstants();
PixelShaderManager::SetConstants();
if (!PixelShaderCache::SetShader(false))
if (!PixelShaderCache::SetShader(false,g_nativeVertexFmt->m_components))
goto shader_fail;
if (!VertexShaderCache::SetShader(g_nativeVertexFmt->m_components))
goto shader_fail;
@ -354,7 +354,7 @@ void Flush()
if (bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate)
{
DWORD write = 0;
if (!PixelShaderCache::SetShader(true))
if (!PixelShaderCache::SetShader(true,g_nativeVertexFmt->m_components))
goto shader_fail;
// update alpha only

View File

@ -31,6 +31,7 @@
#define IDC_RADIO3 1043
#define IDC_SAFE_TEXTURE_CACHE_FAST 1043
#define IDC_DLIST_CACHING 1044
#define IDC_ENABLEPIXELLIGHTING 1045
#define IDC_STATIC -1
// Next default values for new objects
@ -39,7 +40,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1045
#define _APS_NEXT_CONTROL_VALUE 1046
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -52,6 +52,7 @@ BEGIN
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,52,87,40,10
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,92,87,32,10
CONTROL "Enable Dlist Caching",IDC_DLIST_CACHING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,80,10
CONTROL "Enable Pixel Lighting",IDC_ENABLEPIXELLIGHTING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,112,81,10
END
IDD_ADVANCED DIALOGEX 0, 0, 244, 200