Is there a way to orthographic a specific mesh from the perspective camera with a shader?


I’m looking for a way to orthographically represent only certain objects in a perspective camera. I know I need to convert it to a vertex shader, but I can’t try it because I don’t have an idea of how to convert it.

I’d be grateful if you could share any related ideas with me.

Thanks for reading.

I am not too good with shaders but another way to do it would be:
You could use two cameras, one perspective and as a culling mask only those layers you want to be rendered in perspective view and the other one orthographic with a culling mask for only the layers you want to be drawn in orthographic view. You can then use the orthographic camera as a overlay camera for the main camera (perspective camera). But you’d need the URP (at least version 7.2.1) for that, else you can’t stack cameras on top of each other.

Here’s a little package with a scene in which I did the thing I explained above.

Hope it helps!