Skip to content

[rend2] Fix dissolve wipes#68

Merged
SomaZ merged 2 commits into
SomaZ:rend2-buildsfrom
TwelveEyes:fix-dissolve-wipes
Jun 29, 2026
Merged

[rend2] Fix dissolve wipes#68
SomaZ merged 2 commits into
SomaZ:rend2-buildsfrom
TwelveEyes:fix-dissolve-wipes

Conversation

@TwelveEyes

Copy link
Copy Markdown

Fixes a few problems with dissolve wipes:

  1. Not every image should be alpha tested, only those images that ask for it. If every image is alpha tested the wipe ends up being completely invisible.
  2. Specify the front buffer to read pixels from, as whatever buffer it was originally reading from would occasionally result in a black image. The front buffer should always have a complete image (front left specified JIC it should be stereo buffered).
  3. Default dissolve case didn't have any flags specified for some reason.

Comment thread code/rd-rend2/tr_draw.cpp Outdated
default:
{
Dissolve.pDissolve = R_FindImageFile( "textures/common/dissolve", type, IMGFLAG_NONE);
Dissolve.pDissolve = R_FindImageFile( "textures/common/dissolve", type, flags);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

IMGFLAG_NONE is correct here, as the texture should not be clamped as per vanilla.
https://github.com/SomaZ/OpenJK/blob/rend2/code/rd-vanilla/tr_draw.cpp#L1002

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reverted it back to IMGFLAG_NONE.

Comment thread code/rd-rend2/tr_draw.cpp Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I made the mistake of using flags instead of IMGFLAG_NONE here. Vanilla doesn't use clamp for this texture.
https://github.com/SomaZ/OpenJK/blob/rend2/code/rd-vanilla/tr_draw.cpp#L968

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same here.

Comment thread code/rd-rend2/tr_draw.cpp
{
// read current screen image... (GL_RGBA should work even on 3DFX in that the RGB parts will be valid at least)
//
qglReadBuffer (GL_FRONT_LEFT);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I feel like it would be cleaner to just FBO_Bind(NULL); Can you test if that works as well?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Testing using FBO_Bind(NULL) still occasionally shows a black image.

@SomaZ SomaZ merged commit 4f29999 into SomaZ:rend2-builds Jun 29, 2026
16 checks passed
SomaZ pushed a commit that referenced this pull request Jun 29, 2026
* [rend2] Fix dissolve wipes

* [rend2] No flags for common dissolve
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.

2 participants