From ce3c2700e7fd4226905b2ed652aded96d44eebd2 Mon Sep 17 00:00:00 2001 From: Rodolfo Osvaldo Bogado Date: Sat, 12 Jun 2010 12:36:33 +0000 Subject: 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 --- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 55 ++++++++++++++----------- 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'Source/Core/VideoCommon/Src/VertexShaderGen.cpp') diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index afacb65e97..a2a096d0dd 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -270,37 +270,44 @@ const char *GenerateVertexShaderCode(u32 components, bool D3D) else // from color WRITE(p, "lacc.w = "I_MATERIALS".C%d.w;\n", j); } - - if (color.enablelighting && alpha.enablelighting && (color.GetFullLightMask() != alpha.GetFullLightMask() || color.lightparams != alpha.lightparams)) { - - // both have lighting, except not using the same lights - int mask = 0; // holds already computed lights - - if (color.lightparams == alpha.lightparams && (color.GetFullLightMask() & alpha.GetFullLightMask())) { - // if lights are shared, compute those first - mask = color.GetFullLightMask() & alpha.GetFullLightMask(); - for (int i = 0; i < 8; ++i) { - if (mask & (1<