Skip to content
Snippets Groups Projects

Fix skybox and horizon lines not being batched

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-sky-lines-batching into next

After an optimization that was done to improve OpenGL rendering performance, one thing that was overlooked was that the optimized code assumed that skybox and horizon lines cannot be batched. This assumption was made since they are order-sensitive, and as such must be rendered in the correct order. However, just because they must be rendered in a specific order doesn't mean that they cannot be batched - and they very much can because of how they are inserted in groups.

The code is now adjusted to no longer assume that a new batch is necessary when there's a hash mismatch, and now actually makes sure that the next polygon is different in a way that actually requires a new batch. This fixes the problem since all skybox and horizon lines have different hash values to preserve rendering order, so we cannot rely on just that to check if a new batch is needed or not.

Before: srb20053

After: srb20055

(Pay attention to the draw count - that's what matters here! Sampling doesn't make a difference here since the draw count doesn't change if the scene remains the same.)

Fixes #1303 (closed)

Merge request reports

Pipeline #6036 passed

Pipeline passed for ff1fc58b on Hanicef:fix-sky-lines-batching

Approval is optional

Merged by LactozillaLactozilla 5 months ago (Nov 12, 2024 12:56am UTC)

Merge details

Pipeline #6129 canceled

Pipeline canceled for 6de96f81 on next

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading