Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fog-Hacks and other stuff #19

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hw/xbox/nv2a/nv2a_shaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,12 @@ STRUCT_VERTEX_DATA);
qstring_append(body, " float fogDistance = oFog.x;\n");
}

qstring_append(body, " if (isnan(fogDistance)) { fogDistance = 1.0; }\n");
/* FIXME: Microsoft just decided to use 13 bits, but hardware should have 14?! */
qstring_append(body, " if (isnan(fogDistance)) { fogDistance = 8192.0; }\n");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value would probably be off-by-one? or is it a float?


/* FIXME: Do this per pixel? */

qstring_append(body, " fogDistance = max(fogDistance, 0.0);\n");
qstring_append(body, " fogDistance = clamp(fogDistance, 0.0, 8192.0);\n");

switch (state.fog_mode) {
case FOG_MODE_LINEAR:
Expand Down