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

Allow disabling depth prepass with r_depthShaders #1412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slipher
Copy link
Member

@slipher slipher commented Nov 4, 2024

This cvar can be used to demonstrate that #119 is caused by a faulty depth shader. Or to quantify the performance benefits of depth shaders.

AFAIK disabling them shouldn't affect the final result of rendering, so it does not need to be a cheat var. But I could be wrong. So in case the performance benefits turn out to be negative on some system, depth shaders could be turned off.

@slipher
Copy link
Member Author

slipher commented Nov 4, 2024

Another bug suspected to be caused by a faulty depth shader is #334. This could be tested by reverting the workaround 3c7061a. I don't know which map has this though.

@VReaperV
Copy link
Contributor

VReaperV commented Nov 4, 2024

But I could be wrong.

The benefit is performance, yes. Also, I think you can make it non-latch and instead do the check in R_AddDrawSurface().

@VReaperV
Copy link
Contributor

VReaperV commented Nov 4, 2024

AFAIK disabling them shouldn't affect the final result of rendering, so it does not need to be a cheat var. But I could be wrong.

Actually, there is. We have some shaders that use the current depth image: generic, global fog, motion blur, SSAO and dynamic light shaders (depthtile1/2 and lighttile). While global fog and SSAO would be rendered after all depth is written anyway, the other 5 won't.

@VReaperV
Copy link
Contributor

VReaperV commented Nov 4, 2024

Also, it would break portals.

@slipher
Copy link
Member Author

slipher commented Nov 4, 2024

Also, I think you can make it non-latch and instead do the check in R_AddDrawSurface().

Just tried this but it wasn't totally convenient since the depth mask bits of the main shader are modified depending on whether there is a depth shader. I'd have to make a backup copy of the depth bits.

We have some shaders that use the current depth image: generic, global fog, motion blur, SSAO and dynamic light shaders (depthtile1/2 and lighttile). While global fog and SSAO would be rendered after all depth is written anyway, the other 5 won't.

Hmm yeah the light tile is a deal breaker. I don't think any of the others are problems but lighting definitely is. I'll make this a cheat cvar for debugging then.

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