Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Changing the angle in "RenderToCubemap" function?

Discussion in 'VR' started by saadjumani, Feb 27, 2022.

  1. saadjumani

    saadjumani

    Joined:
    Apr 12, 2016
    Posts:
    17
    Hi, ive been trying to render a sequence of frames from unity for use in a 360 VR video. Getting the 360 view is simple enough in theory, all I gotta do is use Camera.RenderToCubemap to get a 360 cubemap, and convert it to equirect using EyeCubemap.ConvertToEquirect and then save the equirect as a frame.

    Problem is, nomatter where my camera is looking at, RenderToCubemap renders from the position where the camera is, but not from the angle at which the camera is looking. Angle is always the same nomatter where I rotate my camera to.

    I understand, in theory I can import my equirect frames to other software and correct the offset, but it would be a LOT more convenient if I could simply render my cubemap or equirect directly with the same offset as the existing rotation of camera, ensuring that the first camera view is always the "front" view in the 360 video.

    Is there any setting/function in unity that could enable me to do this?