some work on zscale and zoffset, don't know if this is correct but at least it seem to fix one or two games.

thanks a lot to chaoscode he make possible to test this on nvidia. please test this a lot and give me feedback :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4468 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2009-10-25 23:10:30 +00:00
parent 1adc944115
commit 0511d6e185
11 changed files with 65 additions and 17 deletions

View File

@ -1344,8 +1344,9 @@ void UpdateViewport()
int GLy = (int)ceil(Renderer::GetTargetHeight() - ((int)(xfregs.rawViewport[4] - xfregs.rawViewport[1] - scissorYOff)) * MValueY);
int GLWidth = (int)ceil(abs((int)(2 * xfregs.rawViewport[0])) * MValueX);
int GLHeight = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * MValueY);
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777215.0f;
double GLFar = xfregs.rawViewport[5] / 16777215.0f;
//new dept equation , don't know if is correct but...
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2] + xfregs.Zoffset) / xfregs.ZScale;
double GLFar = (xfregs.rawViewport[5] + xfregs.Zoffset) / xfregs.ZScale;
// Update the view port
glViewport(GLx, GLy, GLWidth, GLHeight);