Color correction exclusion mask + top vignette in postprocess_controller#494
Open
Blixibon wants to merge 3 commits intomapbase-source:developfrom
Open
Conversation
Made to prevent the CC exclusion mask from drawing beams when disabled, but designed with general use in mind
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.
This PR adds the ability to selectively exclude certain entities from color correction (or make them exclusively affected by color correction) through a new entity called
color_correction_exclude. This is done by writing those entities to the stencil buffer (similar to glow outlines), pushing that to a new RT texture called_rt_ColCorrectMask, and then sending the parameters + RT texture to new code in theSDK_Engine_Postshader.Additionally, the ability to enable the top vignette texture (which was previously unused and had to be enabled by editing the engine_post VMT) has been added to
postprocess_controller, using a keyvalue inspired by L4D2 (or at least as it was presented on the VDC). This means mappers can enable a mostly seamless vignette with a strength from 0-1. This feature is part of this branch because it involves changes to theSDK_Engine_Postshader as well.Two notably general changes were needed to make this work:
EF_NODRAWto the client, which isn't normally possible becauseEF_NODRAWprevents entities from being transmitted. This was needed because, bizarrely enough, it is otherwise impossible for beams on the client to know that they are off. Since turning off beams addsEF_NODRAW, turning off a beam simply cuts off transmission to the client. I wasn't able to figure out how beams know to not appear in standard rendering, but due to the way color correction exclusion works, excluding a beam will cause it to always draw even if it is supposed to be turned off. I eventually decided to compromise by adding a custom user message that directly assigns an entity's clientside counterpart withEF_NODRAWeven if the entity itself isn't transmitting. I generalized this as something that can be implemented on other entities in code in case it's useful for other applications, although if a better way to determine whether a beam is disabled on the client emerges before this PR is merged, then I would probably remove this. It is disrespectful and evil.hl2_rendertargets.cpp/.hfiles containing a newCHL2RenderTargetsclass are included in this PR, and Mapbase's custom RT camera textures were moved to it. Previously, Mapbase's custom RT textures were done through the Mapbase game system inmapbase_shared.cpp, which were originally created as a workaround forbaseclientrendertargets.cppnot defining its RT textures. The TF2 SDK has revealed that games need to individually override its interface in order to use it, and this PR adds a basic, extensible stub class. This is sort of a prerequisite change that's being clumped in due to this feature's requirement of a new render target.PR Checklist
developbranch OR targets another branch with a specific goal in mind