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.
Drawing of debug lines, as found in the Q2 remaster, Q2REPRO, and recent Q2PRO. The code itself is based in Q2REPRO & Q2PRO, making it an amalgamation of contributions from Jonathan jonno.5000@gmail.com, Andrey Nazarov skuller32@gmail.com, and myself.
I wanted to use some debug line drawing for some toying around with the renderer; since it's in Q2PRO it would show up in a "Sync with Q2PRO" eventually, but I didn't want to wait, so I backported it from the future.
The lines themselves are drawn as line primitives on a separate texture and later composited on the RT image. I didn't want to go through RT for the lines; simplicity, for one, but I think there's also value in not "tainting" the RT image with it. To avoid wasting VRAM for an unused feature the line drawing texture is allocated lazily.
I tried to make it work with different projections apart from rectilinear - seems to generally work okay. But given this is mainly a developer utility I think a preference for rectilinear is an acceptable limitation.
A bit of a blind spot I'm having is multi-GPU support. I don't have such a setup so I can't test whether line drawing works correctly there.
There's no GL support in this PR. While it's in Q2PRO, there have been a bunch of changes to the renderer internals made before the line drawing was added. So GL support would follow some time in the future, after the prerequisite changes have arrived.
Finally, if you want to try the feature out, try playing around with the
cl_testdebuglines
cvar.