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

Missing faces on Nvidia Curie (Geforce 6000/7000) running with Nvidia 304 driver and ATI R300 ones (regression) #376

Closed
illwieckz opened this issue Oct 2, 2020 · 4 comments

Comments

@illwieckz
Copy link
Member

illwieckz commented Oct 2, 2020

Only Nvidia Curie (Geforce 6000/7000) running with Nvidia 304 driver are affected, that's a regression.

This bug is a combination of two:

The bug makes face disappear or being badly rendered.

Unvanquished 0.51:

wrong normal format detection disables shader

wrong normal format detection disables shader

Unvanquished 0.52:

wrong normal format detection disables shader

wrong normal format detection disables shader

wrong normal format detection disables shader

wrong normal format detection disables shader

wrong normal format detection disables shader

@illwieckz
Copy link
Member Author

illwieckz commented Oct 3, 2020

The bug is caused by this:

else if ( strcmp( token, "USE_HEIGHTMAP_IN_NORMALMAP" ) == 0 && r_reliefMapping->integer == 0 && r_normalMapping->integer == 0 )
{
program->unusedPermutation = true;
return;
}

If a normal map is detected to embed an height map in alpha channel (wrongly or not, see #375 for a case of wrong detection), and at the same time both normal and relief mapping are disabled, the whole shader permutation is disabled because it has to be disabled (both normal and relief mapping are disabled so there is no need for those operations), but that will be the shader permutation that will be used because of the unused but detected height map in alpha channel.

The bug was verified on Nvidia Geforce 6150LE, 6600 Silencer, 7500LE using Nvidia 304 driver.

An easy fix is to clear the shader boolean telling the normal map embeds an height map if there is no possible usage of that normal map file at all (because both normal and relief mapping are disabled).

Here is the result of such fix on the Geforce 6600 Silencer (it was also verified to fix the issue on other affected cards):

wrong normal format detection disables shader

wrong normal format detection disables shader

wrong normal format detection disables shader

wrong normal format detection disables shader

@illwieckz
Copy link
Member Author

It's possible to reproduce the bug on any Mesa driver this way:

MESA_EXTENSION_OVERRIDE=-GL_ARB_texture_compression_rgtc ./daemon

given the engine is compiled from 0.52.0/sync branch and lowest preset is applied.

@illwieckz illwieckz changed the title Missing faces on Nvidia Curie (Geforce 6000/7000) running with Nvidia 304 driver (regression) Missing faces on Nvidia Curie (Geforce 6000/7000) running with Nvidia 304 driver and ATI R300 ones (regression) Oct 5, 2020
@illwieckz
Copy link
Member Author

illwieckz commented Oct 5, 2020

It is confirmed ATI R300 cards are affected too, with exact same artifacts.

Also, modern AMD GPU (GCN) with explicitely disabled RGTC extension on Mesa side was displaying the exact same artifacts, making the bug easy to reproduce even without requiring access to the hardware. I ❤️ Mesa.

PR #377 is known to fix the issue on all known affected hardware.

illwieckz added a commit to illwieckz/Daemon that referenced this issue Oct 12, 2020
illwieckz added a commit to illwieckz/Daemon that referenced this issue Oct 12, 2020
illwieckz added a commit to illwieckz/Daemon that referenced this issue Oct 12, 2020
illwieckz added a commit that referenced this issue Oct 12, 2020
…358, #377

- fixes #376 issue introduced in 76cf787
- makes #358 working as expected
- see also #377 for hardening the fix for #376
illwieckz added a commit that referenced this issue Oct 12, 2020
@illwieckz
Copy link
Member Author

Fixed twice by #385 and #377.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant