// Called for each camera/injection point pair on each frame. Return true if the effect should be rendered for this camera. public override bool Setup(ref RenderingData renderingData, CustomPostProcessInjectionPoint injectionPoint) { // Get the current volume stack var stack = VolumeManager.instance.stack; // Get the corresponding volume component m_VolumeComponent = stack.GetComponent <GrayscaleEffect>(); // if blend value > 0, then we need to render this effect. return(m_VolumeComponent.blend.value > 0); }
// Called for each camera/injection point pair on each frame. Return true if the effect should be rendered for this camera. public override bool Setup(ref RenderingData renderingData, CustomPostProcessInjectionPoint injectionPoint) { // Get the current volume stack var stack = VolumeManager.instance.stack; // Get the 2 volume components m_GrayScaleComponent = stack.GetComponent <GrayscaleEffect>(); m_InvertComponent = stack.GetComponent <InvertEffect>(); // if blend value > 0 for any of the 2 components, then we need to render this effect. return(m_GrayScaleComponent.blend.value > 0 || m_InvertComponent.blend.value > 0); }