How to create diagonal viewport?

I need to divide the screen diagonally into four parts. Basically need to cut the screen into four parts by drawing an X. Is it possible?
Please provide links if possible.
Thank you.

One option here is to use four cameras that render to textures, then combine these textures to your screen (using shader or geometry, whatever you like more)
For example, have a geometry piece for each viewport and simply apply the camera texture output on it, then render it with 5th camera

For unity free, it’s theoretically possible too, i am going to give you an idea:
You will need 4 cameras, all of them being rendered one after another, each clearing the depth at start, and each having a blocking geometry in front of it. This piece of geometry should work as stencil for your viewport. Requirements for this stencil are:

  • Render it early, before anything else from the scene
  • ZTest always, ZWrite on (optionally add some depth offset so it appears as close to the camera on the ZBuffer as possible)
  • No color write
  • It should cover other 3 viewports

At the start of camera rendering, 3 viewports are covered by the stencil, leading to Ztest fail for anything else that will try to render there (provided our scene does ZTest)
You end up having stuff rendered in the uncovered part of the screen
When next camera renders, it clears depth and renders its own stencil that covers what’s been rendered

This approach is definitely not efficient, as camera frustum culling will try to render 3/4 redundant stuff. Perhaps you could experiment with setting custom camera frustum planes to be skewed in the shape of your viewport