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

Debug line drawing #440

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Debug line drawing #440

wants to merge 12 commits into from

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Feb 20, 2025

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.

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