mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Related FOG changes:
* revert back to proper upscale mantissa of parameters A and C * properly downscale magnitude to 0.24 bits instead than ≡0.23 * Z Eyespace conversion for projection by original patent concept git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6463 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1310,15 +1310,20 @@ static void WriteFog(char *&p)
|
||||
if (bpmem.fog.c_proj_fsel.proj == 0)
|
||||
{
|
||||
// perspective
|
||||
// ze = A/(B - Zs)
|
||||
WRITE (p, " float ze = "I_FOG"[1].x / ("I_FOG"[1].y - zCoord);\n");
|
||||
// ze = A/(B - (Zs >> B_SHF)
|
||||
WRITE (p, " float ze = "I_FOG"[1].x / ("I_FOG"[1].y - (zCoord / "I_FOG"[1].w));\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
// orthographic
|
||||
// ze = a*Zs
|
||||
// ze = a*Zs (here, no B_SHF)
|
||||
WRITE (p, " float ze = "I_FOG"[1].x * zCoord;\n");
|
||||
}
|
||||
|
||||
// stuff to do!
|
||||
// here, where we'll have to add/handle x range adjustment (if related BP register it's enabled)
|
||||
// x_adjust = sqrt((x-center)^2 + k^2)/k
|
||||
// ze *= x_adjust
|
||||
|
||||
WRITE (p, " float fog = saturate(ze - "I_FOG"[1].z);\n");
|
||||
|
||||
|
Reference in New Issue
Block a user