I was wondering if it was possible to use perspective and orthographic projection at the same time by having 2 cameras in the same scene. The reason I need this is because I want to render my 3D objects with perspective projection and have my GUI elements rendered with orthographic projection.
I would like to specify that I am using the Free version of Unity and I would prefer not to use the OnGui method. The GUI elements are quads which exist in the 3D scene with a texture applied to them.
Have both cameras active, but have the GUI (Orthographic) camera depth set higher than the perspective camera. The default depth is -1, so set the GUI cam to maybe “0”. Depth is a setting on the camera.
Then set the GUI camera “Clear flags” setting to either “Don’t Clear”, which means the camera will just render on top of what is already on the screen, respecting the depth buffer, or set it to “Depth Only”, which will make it clear the depth buffer, to ensure the GUI will never “collide” in depth with what exists in the 3D world. The perspective camera should just be set to the default “Sky Box”