VrDeathEffect.cs
using Sandbox;
using Sandbox.Rendering;
/// <summary>Desaturates the local VR death view after the map's color adjustments.</summary>
public sealed class VrDeathEffect : BasePostProcess
{
private static readonly Material Shader = Material.FromShader( "shaders/postprocess/pp_color.shader" );
public override void Render()
{
Attributes.Set( "blend", 1f );
Attributes.Set( "saturate", 0f );
Attributes.Set( "hue_rotate", 0f );
Attributes.Set( "brightness", 1f );
Attributes.Set( "contrast", 1f );
// Use a separate pass so PostProcessVolumes cannot blend color back into the death view.
Blit( BlitMode.WithBackbuffer( Shader, Stage.AfterPostProcess, 4000 ), "VR Death Grayscale" );
}
}