Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Changing the angle in "RenderToCubemap" function?

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

  1. saadjumani

    saadjumani

    Joined:
    Apr 12, 2016
    Posts:
    18
    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?