Skip to content

d3d9.ren/opengl.ren: MSAA text on Intel Arc, model culling, the menu cursor - #38

Merged
nolffan merged 4 commits into
nolffan:masterfrom
publicarray:fix/arc-msaa-and-model-rendering
Oct 18, 2026
Merged

nolffan merged 4 commits into
nolffan:masterfrom
publicarray:fix/arc-msaa-and-model-rendering

Conversation

@publicarray

@publicarray publicarray commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Three fixes to the modern renderers and the menus, checked on Windows with an Intel Arc GPU, and on Linux under Xvfb (make test-renderers).

Menu and HUD text under MSAA on Intel Arc (cfb88fd). With Antialiasing on, Intel Arc's driver drops whole pixels of what it draws with a ZERO or INV_SRC_COLOR-style blend factor into a multisampled target. The menu and HUD text, drawn with LTSURFACEBLEND_MASK, came out as outlines with holes, in Direct3D 9, OpenGL and dgVoodoo alike. With more than one sample, a MASK blit now draws black, alpha-blended by the source's brightness, from a second texture of the surface that holds that brightness in alpha: the same result for the grey fonts it is used for.

Windows 11, Intel Arc, d3d9.ren, 1920x1080, Antialiasing 4, main menu; before left, after right:

msaa-menu-arc-before-after

Under Xvfb (Mesa, software rendering) the text is solid with and without the fix: the bug is the Arc driver's.

msaa-menu-xvfb-before-after

Models drawn as d3d7.ren draws them (ae5570c). d3d9.ren and opengl.ren drew models' back faces, and chrome passes (bottles, glasses) translucent. Back faces are now culled, and the chrome passes stay opaque. The OpenGL cull takes clockwise faces as the front, as Direct3D does: GL_CCW culled the front faces in this renderer's window space, and models drew their insides (the wine bottle without its label, a matchbook's underside).

T01S02's opening, Cate Archer's residence, the bottle and glass on the shelf. Windows, Intel Arc, before left, after right (a back face cuts through the label, and the glass shows its inner faces):

culling-bottle-arc-before-after

Linux, Xvfb, before left, after right:

culling-bottle-xvfb-before-after

After the fix, make test-renderers (from the test-modern PR): d3d7.ren | d3d9.ren | opengl.ren:

renderers-d3d7-d3d9-opengl

The hardware cursor shows when a menu opens during play (de9c3ae), without an alt-tab: its shape is restored as the menu opens.

🤖 Generated with Claude Code

publicarray and others added 4 commits October 18, 2026 10:42
Intel Arc's driver drops whole pixels of what it draws with a ZERO or
INV_SRC_COLOR-style blend factor into a multisampled target, so with
Antialiasing on the menu and HUD text (drawn with LTSURFACEBLEND_MASK) came
out as outlines with holes. Direct3D 9, OpenGL and dgVoodoo all show it;
plain SRC_ALPHA/INV_SRC_ALPHA blending draws right. With more than one
sample, a MASK blit now draws black, alpha-blended by the source's
brightness, from a second texture of the surface that holds that
brightness in alpha: the same result for the grey fonts it is used for.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two differences from d3d.ren's model drawing, both seen on the wine bottle
at Maxi's (glass modelled with thickness, a label inside, chrome):

* d3d.ren culls a model's back-facing triangles in software (TriFacing,
  front = clockwise on screen). Our renderers drew both sides, so the
  inside of the glass showed over the label. rd_CullBack turns culling on
  around a model's pieces (D3DCULL_CCW; GL_BACK with GL_CCW fronts).
* The chrome pass is meant to be opaque, but the skin pass of the piece
  before left blending on, so every later piece's chrome was drawn by the
  environment map's alpha and the scene showed through.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
P1Input confines the mouse while playing with SetCursor(NULL). Back in a
menu, UseCursor shows the hardware cursor again (ShowCursor) but nothing
gave it its image back, so it stayed invisible until an alt-tab made the
engine set it. Set m_hCursor again whenever the hardware cursor is shown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@publicarray
publicarray marked this pull request as ready for review October 18, 2026 09:04
@nolffan
nolffan self-requested a review October 18, 2026 11:02

@nolffan nolffan left a comment

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.

LGTM. Thanks for these!

Comment thread src/modern/render/mr_2d.cpp Resolved
@nolffan
nolffan merged commit 658c7af into nolffan:master Oct 18, 2026
6 checks passed
@publicarray
publicarray deleted the fix/arc-msaa-and-model-rendering branch October 18, 2026 20:38
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