There are two objects in a scene, and only one object is displayed at the end. Note that the displayed object may be partially blocked by another object, and the occluded place will not be displayed. How do I do this? thank you very much

There are two objects in a scene, and only one object is displayed at the end. Note that the displayed object may be partially blocked by another object, and the occluded place will not be displayed. How do I do this? thank you very much