may be the wrong section to ask, but i’m trying to add a background image to a viewer i’m trying to do.
basically i need to change the field of view of the camera and also moving it back and forth.
i’ve checked the old post and they use 2 basic distinct way, first is to create a sprite and parent it to the camera
work nice but when i dynamically change the camera field of view, the background image shrink or go bigger.
what i need is a typical flat render regardless the camera position or field of view
the best would be to be able to put an image in the background tab instead of just picking a color
One option could be to use 2 cameras.
The first one that renders only the background (could be orthographic) and a second one for all the rest.
You will have to specify the Depth property of the second camera to a bigger value of the first one to ensure that is rendered over the first one. Also the Clear flag should be set to Depth only to don’t clear the rendering of the first camera.
Verts/tris are very cheap. Though pretty small, the overall performance is a bit better, due to how a skybox renders, and no extra overhead from gameobjects make up the difference pretty quickly. Doing it via UI is a closer in overall performance, but multiple cameras is the most expensive over either. Ultimately, the hit in either way is still very small to trival, but a skybox has the advantage of being dead simple implement. All things being equal, simple wins.
Yes is true. I was wandering if there could be a third way as a post render effect. But as you say skybox is a simple solution to implement and maintain.
How would you control the proportion of the image to avoid stretching of the texture when the screen ratio changes?