Fix black artifacts on models with Nvidia driver#479
Fix black artifacts on models with Nvidia driver#479slipher merged 4 commits intoDaemonEngine:masterfrom
Conversation
The `weights` values calculated by VertexFetch in GLSL seem to end up being different somehow in the generic shader and the lightMapping shader under the Nvidia proprietrary driver for Linux (DaemonEngine#472). Arbitrarily change how the values are extracted in order to avoid an unfortunate GLSL compilation.
|
I confirm it fixes the bug on Quadro K1100M with Nvidia 340 drivers. |
|
I'm a bit concerned about how much black magic it is, it may be useful to add comments around the precious working code to prevent unwise modification in the future? and maybe somewhat explain what it does (or provide a less obscure theoretical alternative in a comment) ? |
But it isn't. Really, it's slightly simpler than the previous version. I see no reason that someone would get the idea to change it to exactly what it was before. |
|
OK, then. Maybe we can at least put a comment saying modifying this code may break even with theoretically equivalent algorithms? Something like: /* Better not change this code without strong reason,
slight variants can lead to unfortunate computation mismatch.
See https://github.com/DaemonEngine/Daemon/issues/472 */ |
That a theoretically correct change could trigger a compiler bug or something, causing it to not work in practice on some implementations, is true of literally any part of the code. A comment takes a toll on the reader's time, and hence should be worthwhile. I don't think this sort of comment meets that bar, unless there is a single obvious way to do something which is being conspicuously avoided. |
|
OK then, I prefer having comments around code that can break just by sneezing but well, that's an opinion. LGTM. |
…ne#490 ref DaemonEngine#470 DaemonEngine#479 Code introduced in DaemonEngine#479 fixes bug described in DaemonEngine#470 but broke compatibility with GLSL 1.20 as described in DaemonEngine#490. This commit brings back the legacy weight calculation code as a fallback when running GLSL 1.20 GPUs (OpenGL 2.1). The new code still being used with newer GPUs.
…ne#490 ref DaemonEngine#470 DaemonEngine#479 Code introduced in DaemonEngine#479 fixes bug described in DaemonEngine#470 but broke compatibility with GLSL 1.20 as described in DaemonEngine#490. This commit brings back the legacy weight calculation code as a fallback when running GLSL 1.20 GPUs (OpenGL 2.1). The new code is still used with newer GPUs as expected.
…ne#490 ref DaemonEngine#470 DaemonEngine#479 Code introduced in DaemonEngine#479 fixes bug described in DaemonEngine#470 but broke compatibility with GLSL 1.20 as described in DaemonEngine#490. This commit brings back the legacy weight calculation code as a fallback when running GLSL 1.20 GPUs (OpenGL 2.1). The new code is still used with newer GPUs as expected.
Fixes #472