I am trying to create a routine that sets the alpha blend of an object if it comes between the camera and the main character of the game (classic game routine). I have something rough set up to achieve this effect, but the only way I know how to do it is to blend the shader of the model found to be in the way, and this blends the shader across the board so that all models in the scene that use the same shader are also blended.

Any ideas how I can apply the alpha blend to just the object(s) that are in the way?