WIP: fix heightmap orientation, black is low and white is high#170
WIP: fix heightmap orientation, black is low and white is high#170illwieckz wants to merge 1 commit intoDaemonEngine:masterfrom
Conversation
7750781 to
589b39a
Compare
there is only one heightmap standard: black is low and white is high xreal was doing white is low and black is high for heightmap in alpha channel of normal map but was doing black is low and white is high for heightmap in loose file which does not make sense in any way daemon seems to have been forked before the addition of shader keywords to support heightmap loose file so only heightmap in alpha channel is supported at this point
589b39a to
2b2648e
Compare
|
Maybe it's not so simple. You can see here some sort of binary search on the heightmap values, which means you would not get the same result after reversing the depth scale and inverting the image. I can't tell which convention it is intended to use. |
|
Yay, maybe, I tried to import similar code straight from ioquake3's renderergl2 instead and it renders the good way without to invert stuff. It also fixed a second bug for free. Will push code later. Btw there is still another bug that is not fixed yet (or maybe two if I'm wrong by assuming two weirdness I see come from the same bug), but there is maybe more parallax code I can pick… |
|
I'm wrong, even renderergl2's code is wrong if used properly, the problem seems to have something to do with |
|
I'm closing it, parallax needs far more work than a scaling inversion, and perhaps a rework will just fix the issues by doing things right by working on causes instead of reverting bad results. |
issue found while experimenting with xonotic assets in #159, see also #30, especially #30 (comment)
there is only one heightmap standard: black is low and white is high
xreal was doing white is low and black is high for heightmap in alpha channel of normal map but was doing black is low and white is high for heightmap in loose file which does not make sense
in any way daemon seems to have been forked before the addition of shader keywords to support heightmap loose file so only heightmap in alpha channel is supported at this point