Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer: enable GL clear by default #440

Merged
merged 2 commits into from Apr 8, 2021

Conversation

illwieckz
Copy link
Member

GL Clear is expected to paint the screen with an arbitrary color before painting anything else, and that action is not expected to slow down things as far as I know. This is used make sure the non-drawn area are filled with something and prevent garbage do be displayed instead.

Enabling GL Clear by default has two benefits:

  • prevent legacy maps with small void surfaces to be rendered without glitching. Arachnid2 is one of them. Given the large amount of Tremulous map existing out there and people want to port them, clearing is the best we can do to support those legacy maps with glitchy part without modification. Also, because it is a cheat cvar, if it's disabled by default players are not able to hide the void when playing on regular games. Fun stuff is that people playing to Tremulous since more than a decade have reported issues on Unvanquished… that turned to be Arachnid2 void that was there since 2006, but such people only noticed it on Dæmon engine engine.
  • make possible for lowest preset to use fastsky feature, which just skips rendering the sky, relying on the clear function instead (so clear must be enabled), I noticed very noticeable performance gain by doing this on low hardware (skybox rendering is known to be a bit costly in our engine). So, r_clear 1 + r_fastsky 1 gives a performance boost, while I never seen r_clear 0 giving a performance boost, even on very very very old hardware. If r_clear is not enabled by default, toggling r_fastsky in presets would be unpredictable.

The drawback of enabling GL Clear is that it makes less obvious for the mapper he forgot to paint a wall, because the glitches makes obvious there is some void there. But instead of relying on glitches to debug maps, maybe we would want to use an explicit GL clear color (like red) when loading maps with devmap.

For now, we may still enable GL Clear by default.

@slipher
Copy link
Member

slipher commented Apr 8, 2021

LGTM, maybe remove CVAR_CHEAT? Turning it off doesn't seem useful for cheating.

@illwieckz illwieckz merged commit 21576c8 into DaemonEngine:0.52.0/sync Apr 8, 2021
@illwieckz illwieckz added the T-Improvement Improvement for an existing feature label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Renderer T-Improvement Improvement for an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants