-
Notifications
You must be signed in to change notification settings - Fork 132
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
Heretic: Opacity of Transparent HUD Elements not correct in TrueColor #1269
Comments
😟 I'm out of ideas how to make it proper. TrueColor support for Heretic was implemented before Hexen, and it's normal (non-alt) translucency was picked after some joint testing, but looks likes I have missed alt-one. Another problem is - we don't have a formulas to set a proper percent for opacity, so... Probably easiest way will be to have a separate |
I wouldn't say that the alternative one is missed, rather that it requires a swapped behavior to Hexen. Currently in truecolor Heretic, the alt one has too much opacity, while the normal one has too little. In terms of functions, here an example how it could be corrected: i_truecolor.c: // [crispy] TINTTAB blending emulation, used for Hexen
const uint32_t I_BlendOverHexTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, 0x60); // 96 (38% opacity)
}
// [crispy] More opaque ("Alt") TINTTAB blending emulation
const uint32_t I_BlendOverHexAltTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, 0x8E); // 142 (56% opacity)
}
// [crispy] TINTTAB blending emulation, used for Heretic
const uint32_t I_BlendOverHerTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, 0x8E); // 96 (56% opacity)
}
// [crispy] Less opaque ("Alt") TINTTAB blending emulation
const uint32_t I_BlendOverHerAltTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, 0x60); // 142 (38% opacity)
}
Yeah, getting it 100% right might be another topic. A swap would be a start to get it closer to vanilla, in my opinion.
This could be one way, like the abstract posted above. Another alternative could be to have global variables with the opacity being initialized differently based upon the game and used for calling the I_BlendOver functions. // [crispy] TINTTAB blending emulation, used for Hexen and Heretic
const uint32_t I_BlendOverHexTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, He_Normal_Opacity);
}
// [crispy] ("Alt") TINTTAB blending emulation, used for Hexen and Heretic
const uint32_t I_BlendOverHexAltTinttab (const uint32_t bg, const uint32_t fg)
{
return I_BlendOver(bg, fg, He_Alt_Opacity);
} One could also alter the returns of the functions based upon the active game. |
I have created a first suggestion based upon the global variables approach: |
Thanks for that! However, you know, I'm a friend of function pointers and generally prefer them over global variables. So, you could keep the current |
Would it be acceptable to modify V_LoadTintTable to do so? It would - depending on the compile-switch - either load the tinttable or assign those functions for the blending (which acts like a "tinttable"-selection for truecolor). |
Could you prepare a PR, please. It's easier to discuss actual code changes than some written ideas. |
@fabiangreffrath @JNechaevsky
Background
Version of Crispy Doom: 7.0.0 (master 05.02.2025 for translucent Crispyhud)
Operating System and version: Windows 10
Game: Heretic
Any loaded WADs and mods (please include full command line): -
Bug description
Observed behavior:
When implementing the transparent Crispyhud for Heretic, I noticed that it has a very low opacity in Truecolor mode. Here some screenshots for comparison:
Truecolor: Heretic Crispyhud Artibox:
![Image](https://private-user-images.githubusercontent.com/29991301/410123859-3a0d8fc4-0058-41d5-bd9b-dd55c3591afd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzE2MDksIm5iZiI6MTczOTYzMTMwOSwicGF0aCI6Ii8yOTk5MTMwMS80MTAxMjM4NTktM2EwZDhmYzQtMDA1OC00MWQ1LWJkOWItZGQ1NWMzNTkxYWZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE0NTUwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0OWY1NjViM2M0YmM0NGU5ODVmNzlkYmRmZDQ0ZmRmM2QyNDRlOGRkZmVkMzJhZjFlMzJhZjlmNzAxMWRmM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JH5SLqKiAkvG95sj-PljLPKRd67S5CO8_bpZ7ZnUldY)
Palette: Heretic Crispyhud Artibox (transpucent patch):
![Image](https://private-user-images.githubusercontent.com/29991301/410123790-ebb1ef6a-70d9-48dd-a0e3-5ae2b4d97894.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzE2MDksIm5iZiI6MTczOTYzMTMwOSwicGF0aCI6Ii8yOTk5MTMwMS80MTAxMjM3OTAtZWJiMWVmNmEtNzBkOS00OGRkLWEwZTMtNWFlMmI0ZDk3ODk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE0NTUwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhZDI2NGY0NWY2ZDI0ZDhhNWUyZmUyNTJmMjQ3ZmNkMzU1ZjRkODg4MjQyMWNhNjE1MjczNWI5MDk2MzllMDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PKa8g9KyNHSGmwRUwsmg3CAHbAINPwwai7uxuT8Xx_k)
.. while the Fullscreen Artibox opacity is too high in true-color:
Truecolor: Heretic Fullscreen Artibox:
![Image](https://private-user-images.githubusercontent.com/29991301/410124313-26e7ec5b-7231-49af-934d-38754270bf9a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzE2MDksIm5iZiI6MTczOTYzMTMwOSwicGF0aCI6Ii8yOTk5MTMwMS80MTAxMjQzMTMtMjZlN2VjNWItNzIzMS00OWFmLTkzNGQtMzg3NTQyNzBiZjlhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE0NTUwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhZTNlYTk0ZmViMThkYjg1NTA0MGQzMzA3MDRjMTcyY2QwNjFkZDIzNjM5MjZkNWY0ZTZjODRlNThjMzQ3YjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NqqUvl2kUGO2L5bi8sFWdqVrKQUbb5vvkixihcJ8Mzg)
Palette: Heretic Fullscreen Artibox (alt translucent patch):
![Image](https://private-user-images.githubusercontent.com/29991301/410124882-0ad7c73c-7d8c-4692-9c82-aa7ce0abf75d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzE2MDksIm5iZiI6MTczOTYzMTMwOSwicGF0aCI6Ii8yOTk5MTMwMS80MTAxMjQ4ODItMGFkN2M3M2MtN2Q4Yy00NjkyLTljODItYWE3Y2UwYWJmNzVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE0NTUwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ZmJlMTExNDkyMTZhNGIxNzJhN2FkYWQ3YzBjNjZjZTMyNTE5NDc1NjZiMDk3Njk0YWU0Y2E3OWIxMGNhMmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NKyN4ud-e21uaCDR2-t9KeCxE-9Wxu8XotaIBh40VPE)
Expected behavior:
The Fullscreen Artibox should have less opacity than the Crispyhud one, like it can be seen in the Palette mode. In other words: The drawtinttab should have more opacity than the drawalttinttab.
In the Code, I think it comes down to these blending functions:
i_truecolor.c:
I think those work fine for Hexen, but not for Heretic, since the tinttab in Heretic has the dominant color on the Rows instead of Columns:
![Image](https://private-user-images.githubusercontent.com/29991301/410129654-f4c3cbf3-eb3a-40d5-a117-2fbb31372cd4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzE2MDksIm5iZiI6MTczOTYzMTMwOSwicGF0aCI6Ii8yOTk5MTMwMS80MTAxMjk2NTQtZjRjM2NiZjMtZWIzYS00MGQ1LWExMTctMmZiYjMxMzcyY2Q0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE0NTUwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwZjJjMzU1NWZhNWIxNWQ3ZjliZDUzYzg4MTI4ZGJhYmM4NzI5MmRmZmQwMDE1ZWM1NGY5MzYxYjZiNjg4N2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IbhIxSg6LX-HduI3HuCklmIzPORFB94GDC-zIQJj1Xw)
My suggestion would be to swap those opacity values (38%, 56%) in case of Truecolor-Heretic, maybe that already gets it close enough to the Palette one. If not, it might need a separate set of opacity-values.
What do you think?
The text was updated successfully, but these errors were encountered: