mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-06 03:02:41 +00:00
VideoSoftware: Implement fog range adjustment, fixing issue 6147.
This commit is contained in:
parent
d4fadf4b6f
commit
ae146e8bc7
2 changed files with 11 additions and 4 deletions
|
@ -748,10 +748,15 @@ void Tev::Draw()
|
|||
|
||||
}
|
||||
|
||||
// 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
|
||||
if(bpmem.fogRange.Base.Enabled)
|
||||
{
|
||||
// TODO: Check if this is correct (especially the magic values)
|
||||
float offset = Position[0] - bpmem.fogRange.Base.Center + 324.f;
|
||||
int index = 9 - abs(Position[0] - bpmem.fogRange.Base.Center + 324) / (162/5);
|
||||
float k = bpmem.fogRange.K[index/2].GetValue(index%2);
|
||||
float x_adjust = sqrt(offset*offset/162.f/162.f + k*k)/k;
|
||||
ze *= x_adjust;
|
||||
}
|
||||
|
||||
ze -= bpmem.fog.c_proj_fsel.GetC();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue