I want to make a PostProcessMaterial to use on my camera to generate a kind of fog.
essentially there is a surface. In the simple case its a plane but later it might be a more complex surface.
Everything in front of the surface will have a blue fog, and behind an orange fog. Clearly the camera will see a mix of the two fogs.
I can create a fog from the Object to the camera by enableing the ScenTexture:ScenDepth or the distance from CameraPostionWS t WorldPosition and creating a PostProcess Material that uses that depth to lerp between fog color and scene color. But I am not sure how to get either the distance from the object/pixel to the surface or the distance from the camera to surface along ray that the camera is seeing the scene pixel.
Are there any strategies for implementing this kind of material?
My Camera will always be out side of the surface.