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

Hexen/Heretic: Support Color-Translation in V_DrawTLPatch #1267

Merged

Conversation

Noseey
Copy link

@Noseey Noseey commented Feb 3, 2025

Related Issue:
None

Changes Summary

Adding a translucent and color-translated rendering function for Heretic/Hexen to be called optionally in DrawTLPatch. It is based upon drawtinttab, so the source-color remains the dominating one (for Palette), just corrected by the translation. This allows for transparent golden center-messages.

Translated Palette Lookup example:
2025-02-03 17_57_51-Window

Translated True Color Blend example:
2025-02-03 17_49_49-Window

@Noseey
Copy link
Author

Noseey commented Feb 3, 2025

A small question regarding the True Color Blending Functions:

i_truecolor.c:

// [crispy] TINTTAB blending emulation, used for Heretic and Hexen
const uint32_t I_BlendOverTinttab (const uint32_t bg, const uint32_t fg)
{
    return I_BlendOver(bg, fg, 0x60); // 96 (38% opacity)
}

// [crispy] More opaque ("Alt") TINTTAB blending emulation, used for Hexen's MF_ALTSHADOW drawing
const uint32_t I_BlendOverAltTinttab (const uint32_t bg, const uint32_t fg)
{
    return I_BlendOver(bg, fg, 0x8E); // 142 (56% opacity)
}

Isn't the opacity the other way around (at least for Heretic)? Meaning the Alt-Tinttab has lower opacity of the source material? (see artibox-tiles in vanilla fullscreen-hud)

Edit: I think the dominant color selection changes between heretic and hexen. for me it looks like Heretic has dominant color-rows while hexen has dominant color-columns.

Heretic:
2025-02-03 19_42_42-Window

Hexen:
2025-02-03 19_43_01-Window

So the Alt funtion is more opaque in Hexen, less in Heretic, I presume. I think this game depedency might need to be considered in the blending / or the calls need to be adapted. Should I include this here?

Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@fabiangreffrath
Copy link
Owner

Isn't the opacity the other way around (at least for Heretic)? Meaning the Alt-Tinttab has lower opacity of the source material? (see artibox-tiles in vanilla fullscreen-hud)

Edit: I think the dominant color selection changes between heretic and hexen. for me it looks like Heretic has dominant color-rows while hexen has dominant color-columns.

I'll pass this question over to @JNechaevsky .

So the Alt funtion is more opaque in Hexen, less in Heretic, I presume. I think this game depedency might need to be considered in the blending / or the calls need to be adapted. Should I include this here?

No, this would be a different issue with a separate fix, please.

@JNechaevsky
Copy link
Collaborator

Isn't the opacity the other way around (at least for Heretic)? Meaning the Alt-Tinttab has lower opacity of the source material? (see artibox-tiles in vanilla fullscreen-hud)

AFAIR, I've made visual comparison between paletted and TrueColor executables. Turns out, Heretic's TrueColor have incorrect "alt" opacity, or...?

@fabiangreffrath fabiangreffrath merged commit 16ed8bc into fabiangreffrath:master Feb 5, 2025
6 checks passed
@Noseey
Copy link
Author

Noseey commented Feb 5, 2025

AFAIR, I've made visual comparison between paletted and TrueColor executables. Turns out, Heretic's TrueColor have incorrect "alt" opacity, or...?

I have created an open issue to better explain it, together with some screenshots. Maybe we can further discuss it there? 😉
#1269

@Noseey Noseey deleted the He_Translated_Renderer branch February 6, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants