Repository navigation
Conversation
There was a problem hiding this comment.
Maybe CColorCorrectionExclude should hold a vector of entities that can be modified with InputAddTarget, InputRemoveTarget, using an edict for this seems wasteful. Though I am noticing that this mimicks point_glow entity, of which I have the same opinion (although that is less useful). Perhaps this could be resolved by also having a vscript interface like CScriptGlowObjectManager.
All the "nodraw network" business could be handled multiple ways. If the client only really needs to know when it was turned off and not when it left PVS, then a simple entity message would suffice.
int CBeam::UpdateTransmitState( void )
{
#ifdef MAPBASE
EntityMessageBegin( this, true );
WRITE_BOOL( GetEffects() & EF_NODRAW );
MessageEnd();
#endif
// we must call ShouldTransmit() if we have a move parent
if ( GetMoveParent() )
return SetTransmitState( FL_EDICT_FULLCHECK );
return BaseClass::UpdateTransmitState( );
}
#if defined(MAPBASE) && defined(CLIENT_DLL)
void CBeam::ReceiveMessage( int classID, bf_read &msg )
{
if ( classID != GetClientClass()->m_ClassID )
{
BaseClass::ReceiveMessage( classID, msg );
return;
}
bool nodraw = msg.ReadOneBit();
if ( nodraw )
{
AddEffects( EF_NODRAW );
}
else
{
RemoveEffects( EF_NODRAW );
}
}
#endifIf PVS needs to also be accounted for, then client can detect it itself. The only downside of this simplicity I can think of is a hypothetical serverside beam which was turned off exclusively on client being automatically turned on when it enters the PVS.
#if defined(MAPBASE) && defined(CLIENT_DLL)
void CBeam::NotifyShouldTransmit( ShouldTransmitState_t state )
{
BaseClass::NotifyShouldTransmit( state );
if ( state == SHOULDTRANSMIT_START )
{
RemoveEffects( EF_NODRAW );
}
else if ( state == SHOULDTRANSMIT_END )
{
AddEffects( EF_NODRAW );
}
}
#endifI wasn't able to figure out how beams know to not appear in standard rendering
On this point, I think it does it by removing the entity from client leaf system in C_BaseEntity::UpdateVisibility due to IsDormant(). Would checking for dormancy in CBeam::ShouldDraw() fix this issue?
1801209 to
a1734c0
Compare
| //------------------------------------------------------------------------------ | ||
| // Color Correction Mask | ||
| //------------------------------------------------------------------------------ | ||
| int CColorCorrectionMgr::RegisterExclusionObject( C_BaseEntity *pEntity, Vector *vecColor, float flAlpha ) |
There was a problem hiding this comment.
if two color_correction_excludes target the same entity, disabling one removes both
|
|
||
| #ifdef MAPBASE | ||
| if ( m_pMaterialParam_VignetteEnable ) | ||
| m_pMaterialParam_VignetteEnable->SetIntValue( s_LocalPostProcessParameters.m_flParameters[ PPPN_TOP_VIGNETTE_STRENGTH ] > 0.0f ? 1 : 0 ); |
There was a problem hiding this comment.
vignette doesnt work without postprocess controller ?
There was a problem hiding this comment.
That is the intended behavior. I suppose it did technically work without postprocess controller before, although it wasn't documented and I don't think it would've been in use by any mods (please correct me if I'm wrong)
| return; | ||
| } | ||
|
|
||
| m_bDrawingColCorrectExclude = true; |
There was a problem hiding this comment.
this is set during rendering but read in commit so its a frame behind no ?
| continue; | ||
|
|
||
| pRenderContext->EnableClipping( ((pOverlay->m_bInSky) ? (false):(bClippingEnabled)) ); //disable clipping in skybox, restore clipping to pre-existing state when not in skybox (it may be off as well) | ||
| pOverlay->Draw( true ); |
There was a problem hiding this comment.
the viewmodel is in the depth buffer at this point so this will look funny
Co-authored-by: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com>
46b6165 to
a7b1463
Compare
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.New
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.The following file contains the recompiled shader and edited
engine_postVMT:cc-exclusion.zip
PR Checklist
developbranch OR targets another branch with a specific goal in mind