Skip to content

fix(graphics): correct skinned mesh rendering black on macOS#169

Merged
fbraz3 merged 2 commits into
mainfrom
issue-166-skinned-mesh-render-black
Jun 19, 2026
Merged

fix(graphics): correct skinned mesh rendering black on macOS#169
fbraz3 merged 2 commits into
mainfrom
issue-166-skinned-mesh-render-black

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Description

Fixes #166. Correct skinned mesh rendering black on macOS under Vulkan/DXVK.

Changes

  1. D3D8 Downsampling Parity on macOS (GeneralsMD/Code/CompatLib/Source/d3dx8_compat.cpp):
    • Added box-filter downsampling support for D3DFMT_A4R4G4B4 (Format 7) and D3DFMT_R5G6B5 formats in the macOS/Apple block of D3DXLoadSurfaceFromSurface. This ensures D3DXFilterTexture successfully generates mipmaps for team/house recolored textures on macOS instead of failing and leaving the lower levels black.
  2. Shader Stage State & Blend Mode Realignment (Generals/Code/Libraries/Source/WWVegas/WW3D2/shader.cpp & shader.h):
    • Aligned base game's shader stage setting logic with Zero Hour, adding support for newer detail color/alpha operations (DETAILCOLOR_ADDSIGNED, DETAILCOLOR_ADDSIGNED2X, DETAILCOLOR_SCALE2X, DETAILCOLOR_MODALPHAADDCOLOR) and SSCAT_SCREEN sort category, ensuring invalid shader configurations are avoided.
  3. Vertex Diffuse Fallback & Lighting Rules (Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp):
    • Forced white diffuse (0xFFFFFFFF) for skin rendering vertices since diffuse arrays are often null on base game models, and configured D3DMCS_COLOR1 diffuse source while disabling D3D lighting for skinned rendering category list, matching original VC6/D3D8 behavior.

fbraz3 added 2 commits June 19, 2026 00:50
Add box filter downsampling for D3DFMT_A4R4G4B4 and D3DFMT_R5G6B5
formats in the macOS block of D3DXLoadSurfaceFromSurface in
d3dx8_compat.cpp. Previously, D3DXFilterTexture would fail to generate
mipmaps for recolored textures, rendering infantry units as solid
black silhouettes at typical gameplay distances.

Also align base game shader stage states and blend modes with Zero
Hour to prevent invalid pipeline configurations, force white diffuse for
skins, and update the development blog.

Fixes #166
@fbraz3 fbraz3 merged commit 18a08f7 into main Jun 19, 2026
8 checks passed
@fbraz3 fbraz3 deleted the issue-166-skinned-mesh-render-black branch June 19, 2026 18:50
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.

bug: Skinned Mesh (Infantry) Rendering Black on Vulkan/DXVK (Base Game)

1 participant