Dolphin, the GameCube and Wii emulator - Forums
Values for zNear/zFar Correction - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion)
+--- Thread: Values for zNear/zFar Correction (/Thread-values-for-znear-zfar-correction)



Values for zNear/zFar Correction - zephyrsurfer - 10-03-2014

I wasn't sure where to post this but I'm trying to fix Captain Tsubasa.

How were the values for the Custom Projection Hacks for games like Sonic and the Black Knight arrived at?

One of the presets in earlier dolphin builds fixes the intro video but not the rest of the game.

Suggestions on how I'd go about fixing this. Thanks.


RE: Values for zNear/zFar Correction - skid - 10-03-2014

I know one change for this game. In the file VertexLoader_Position.cpp, under Pos_ReadDirect() change the following line:

Code:
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);

to:

Code:
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 1.0f);

This will make the menus appear.


RE: Values for zNear/zFar Correction - zephyrsurfer - 10-03-2014

(10-03-2014, 04:16 PM)skid Wrote: I know one change for this game. In the file VertexLoader_Position.cpp, under Pos_ReadDirect() change the following line:

Code:
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);

to:

Code:
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 1.0f);

This will make the menus appear.

Thanks skid

I did some testing. Before your fix the Sonic and the Black Knight preset made the intro video work but now it doesn't show.

With further knuckle-dragger testing I've discovered the following settings will make both menu+logos and the intro video work together.

Code:
[Video]
ProjectionHack = 1
PH_ZNear = 30.00001
PH_ZFar = 1.99998
PH_SZNear = 1
PH_SZFar = 1

But you will have to disable "Fast Depth Calculation".

Note: To make the intro video appear PH_ZNear will need a value above 30 and below 31.

Edit: It seems the intro video needed Zelda Twilight Princess Zoom Hack back in R3416 but that broke everything else?.
Unfortunately most text doesn't appear and never did either; A very old thread suggested it is a texture layer issue. Can you point out an appropriate file I could have a look at?