- Home /
Is there any way I can create a triangle shaped camera view?
Hi!! I'm pretty new to Unity so I'm not sure if there even is a way to solve my problem.
I would need to display the views of two cameras (only depict the skyboxes most of the time) in the top-left corner I've marked with yellow (I'm so sorry for the bad quality). The problem is, that the views would need to be cut diagonally as you can see in the middle of the top-left corner. The goal is to 'expand' the views from the adjacent cameras (to the right where you can see the front view of my model and downwards where you can see a side view) as if the camera view is shaped like a trapeze). I hope you can see what I mean in the following image (again sorry for the quality).
During my research I found a similar issue: https://forum.unity.com/threads/custom-shape-camera-view.132518/ ..but unfortunately, this doesn't work as expected and the YouTube video mentioned only solves this through changing the camera settings to Depth-Only which isn't an option with my skyboxes.
So I've thought, that I could create a texture in Photoshop in which one triangle half is black and the other one would be transparent (so the camera can be seen) and apply this texture to a plane right in front of the camera like a filter. Then I would stack another camera (C2) on top and create the same plane with the black- and-transparent triangles switched. Now I just need some way, where the black parts of my plane aren't rendered and only display the camera 1 underneath. I thought maybe through shaders that don't render the black parts or smth?
I should mention that I work on the student version of unity 2018.4.14.
Any tips would really be appreciated as I'm stuck on this for weeks now and I can't seem to figure it out on my own.
Thanks in advance!
Answer by ashkanaral · Feb 27, 2020 at 08:03 PM
These links shows how to do it.
https://forum.unity.com/threads/custom-shape-camera-view.132518/
Hopefully, someone else can help!
Your answer
Follow this Question
Related Questions
Stretching when using world coordinates 2 Answers
Shader: How to write a shader that respects sorting order first and then depth 1 Answer
How do I make an Unlit Shader with two textures? 0 Answers
Unity 3d Sprite Shader (How do I limit Max Brightness to 1 with Multiple Lights Hitting) 0 Answers
Foliage shader advices ? 0 Answers