Skip to content

Add disable culling option - #545

Open
Pizzabucket wants to merge 14 commits into
HarbourMasters:developfrom
Pizzabucket:disable-culling-option
Open

Add disable culling option#545
Pizzabucket wants to merge 14 commits into
HarbourMasters:developfrom
Pizzabucket:disable-culling-option

Conversation

@Pizzabucket

@Pizzabucket Pizzabucket commented Aug 22, 2026

Copy link
Copy Markdown

Summary

  • Adds a "Disable Culling" graphics option.
  • Disables viewport, model, and actor culling when the option is enabled.
  • Preserves the required culling behavior during demo/playback sequences to prevent desynchronization.
  • Includes a warning that disabling culling may affect performance.

Credits

Parts of the demo/playback synchronization approach were adapted from BanjoRecomp.

Build Artifacts

@Pizzabucket

Pizzabucket commented Aug 24, 2026

Copy link
Copy Markdown
Author

Sorry for the last update. I broke the fading effect and the fixed hud models on the last one.

@JeodC

JeodC commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I'm going to be thorough in the review here, so don't take offense to anything. It's all for your information so you can improve. Thanks again for contributing some changes that could only be tested on unique hardware.

First, the PR description doesn't match the diff. "Fixes the scaling of 3D HUD objects at different aspect ratios" is claimed, but there's no scaling changes anywhere in the nine files. Either it was mistakenly dropped, or removed intentionally to be a separate, smaller pull request (which would be preferred anyway).

Second, you should cleanup your code before expecting a line-level review. Some examples:

  • clanker.c:69-70: bare bare // LIGHTHOUSE_ALWAYS_LOAD_CLANKER_CC_V1 / V2 markers.
  • actor_cubepropsystem.c:402-445: // ALL36 CUSTOM ACTOR TEST START/END wrapping a bare switch on 36 unnamed raw marker IDs, described in-comment as "marker IDs that were stable in separate A/B tests." This is unmaintainable and untraceable; nobody can tell later why 421 is in the list and 422 isn't.
  • Version suffixes baked into shipping identifiers: cullV2, SORT one-sided geometry test V1, model distance gates V3.1, Single-Pass Demo Object No-Cull V2, // V3: generic sprite-actor renderers
  • modelRender.c: I spot at least four dead static functions, all will throw -Wunused-function. There are similar ones in viewport.c:56-95.
  • There are six copies of the same game-mode switch, and four of them were added to decomp files which should remain as clean as possible. We already have a IsDemoMode() and the code also uses func_802E4A08() and getGameMode() != GAME_MODE_4_PAUSED as third and fourth demo predicates in the same feature.
  • gccube.c:683-685: this is a misindented block whose behavior contradicts its own comment. The if (port_shouldDisableCullingCubeRange()) sits inside the else at the wrong indent level. The comment one line above says "Culling ON, or demo/playback: completely stock range behavior", and then the very next statement widens width to the full cube range anyway whenever the cvar is set and IsDemoMode() is false. Either the comment or the code is wrong.
  • GraphicsPatches.cpp:103: port_shouldDisableCullingCubeRange bypasses the file's own cvar cache. Follow what port_shouldDisableCulling() returns, and use the macro defined 80 lines above.
  • gccube.c:296 and more: this is decomp divergence, a one-line decomp condition was expanded into an identical 7-line block at many call sites, with none of the original lines preserved.
  • gccube.c:606-617: the sprite prepass walks every cube in the level, every frame, on top of the widened draw traversal. The tooltip's "May cost performance" is understating it.

@Pizzabucket
Pizzabucket marked this pull request as draft August 25, 2026 03:43
@Pizzabucket Pizzabucket changed the title Add disable culling option and fix 3D HUD object scaling Add disable culling option Aug 26, 2026
@Pizzabucket
Pizzabucket force-pushed the disable-culling-option branch from 7bf5d69 to 792e3f7 Compare August 26, 2026 21:05
@Pizzabucket
Pizzabucket marked this pull request as ready for review August 26, 2026 21:07
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