Make fog into a stage, fix some issues with it#1408
Merged
VReaperV merged 8 commits intoDaemonEngine:masterfrom Nov 2, 2024
Merged
Make fog into a stage, fix some issues with it#1408VReaperV merged 8 commits intoDaemonEngine:masterfrom
VReaperV merged 8 commits intoDaemonEngine:masterfrom
Conversation
Member
|
What are some maps with fog to try it out? The only one I know off the top of my head is atcshd. |
Contributor
Author
illwieckz
approved these changes
Nov 2, 2024
Member
illwieckz
left a comment
There was a problem hiding this comment.
LGTM! And it works well on my end!
slipher
reviewed
Nov 2, 2024
slipher
reviewed
Nov 2, 2024
Move some checks to tr_shader.
ed4d4a2 to
693b0a5
Compare
Added the fog stage to renderer selection and material system. Added u_FogMap uniform because all fog uses the same fog image. Changed `R_AddDrawSurf()` to return the added surface's index, because translucent surfaces get added at the end instead, so this is a more robust approach. Removed some redundant checks to return from `Render_fog()` early. Fixed incorrect material system max stage count.
fog->originalBrushNumber can only be < 0 for world fog, which is already accounted for by only adding surfaces with fogNum >= 1 (non-world).
Wolf:ET was checking for `RDF_SNOOPERVIEW` here, we don't have that.
693b0a5 to
5ce4d4a
Compare
Merged
4 tasks
VReaperV
added a commit
to VReaperV/Daemon
that referenced
this pull request
Mar 18, 2025
DaemonEngine#1408 had removed the hacky way of drawing fog surfaces and made them into actual stages. This change removes the sorting by fog index since it now has no positive effect (and potentially has a negative one, preventing surfaces from being merged). The fognum bits are redistributed towards drawsurf indexes and entity count.
VReaperV
added a commit
to VReaperV/Daemon
that referenced
this pull request
Mar 22, 2025
DaemonEngine#1408 had removed the hacky way of drawing fog surfaces and made them into actual stages. This change removes the sorting by fog index since it now has no positive effect (and potentially has a negative one, preventing surfaces from being merged). The fognum bits are redistributed towards drawsurf indexes and entity count.
VReaperV
added a commit
that referenced
this pull request
Mar 23, 2025
#1408 had removed the hacky way of drawing fog surfaces and made them into actual stages. This change removes the sorting by fog index since it now has no positive effect (and potentially has a negative one, preventing surfaces from being merged). The fognum bits are redistributed towards drawsurf indexes and entity count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes fog from being done based on an if statement in
Tess_StageIteratorColor()to being added as a surface with one of two new defaut fog shaders - similar to how we add depth pre-pass surfaces. The 2 new default shaders are for fogs with FP_EQUAL and FP_LE fog passes.R_AddDrawSurf()returns the index of the surface, to get the correct one.R_AddDrawSurf().u_FogMapsince all fogs use the same image, so it can be made global, and cleaned upRender_fog()and fog processing a bit.SS_FOG, which is done after SSAO.