Implement r_teleporterFlash cvar #303
Merged
+33
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Quake 3 Arena when the player goes in a teleporter entrance but has yet to arrive at the exit (probably due to the server and client architecture and ping) the renderer registers this as being in hyperspace and the screen is covered with a pure white shader. Having there brief pure white flashbangs is obviously bad for the more photosensitive players.
r_teleporerFlash is a new cvar which allows more photosensitive users to opt out of seeing a white flash every time they are in hyperspace between a teleporter entrance and its exit. For now there is only a fade to black option implemented alongside the fade to white original and default option.
The new feature is opt-in and preserves the original pure white teleporter flash as the default. Though I would be happy to change the cvar default to 0 to not flashbang users who explicitly do not wish for them.
Earlier this year CPMA developers committed this to cnq3 which allows players to draw pure black screens instead of white when in hyperspace.
Quake 3 DeFRaG has for a long time allowed for a shader which addresses the issue like this:
Both of these will work in DeFRaG via quake3e or oDFe in the future (though when I attempted to test that shader with quake3e even before my changes I don't see it affecting the hyperspace visual but I guess it works for others) I have not looked at other engines or mods for what they are doing. I chose the same cvar name as cnq3 for cross-engine config compatibility and user intuitivity as I do not see a reason to change it.
This cvar is future-proof and extendable as more styles are easy to add with the cvar value being 2 or above. 0 for black, 1 for white, 2 and above for new funky variants.
These changes implement the cvar in renderer, renderer2 and renderervk. (renderer2 and renderervk are untested but should work with the same copypaste changes AFAIK. Just running
make
did not build them and I did not look into how to build them.)