Mirrors
Mirrors are set up through a combination of Camera
s, RenderTexture
s and Material
s with specific UV mapping.
Camera first renders its view to a RenderTexture
which is assigned to a Material
(any shader that supports albedo map will work). This Material
has an UV map that corresponds to the surface of the vehicle mirror.
Possible setups are:
- Render each mirror with a separate
Camera
to a separateRenderTexture
which is assigned to a separateMaterial
. Best visual quality but slow. - Using UV map that is split between the mirrors which means that each mirror gets only a part of the UV map, but this comes at a disadvantage that the interior of the vehicle can not be seen in rearview mirror since the camera needs to start rendering at the rear of the vehicle to prevent intersection with the vehicle mesh.
- Hybrid approach: one camera for rearview mirror and one camera for left and right mirrors.