Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to create a shader that will turn a Render Texture into a cubemap

Discussion in 'Shaders' started by MMeyers23, May 28, 2020.

  1. MMeyers23

    MMeyers23

    Joined:
    Dec 29, 2019
    Posts:
    101
    Hi,

    I know that there is an API for making a render texture from a camera into a cubemap. But this function assumed an equirectanglar format - I am using video player to send a video to a render texture - this video is in the layout of a TRADITIONAL cubemap (ie aspect ratio 6x1, 3x4, etc, the ones listed in this Unity doc https://docs.unity3d.com/Manual/class-Cubemap.html) with 6 squares composing the whole image. With a REGULAR texture in this layout, Unity can detect the 6-sided layout and make a cubemap just fine. But with a RENDER TEXTURE is only allows cubemap option if the dimensions are such that the height = the width. This is not compatible with a traditional six-sided cubemap layout. Is there any way to convert a render texture into a cubemap the traditional way so I can use the video as a skybox? I am trying to avoid equirectangular formats because I am making the video from a blender sky scene and my computer absolutely cannot handle rendering the video with the "cycles" renderer, which is required to make a equirectangular video.
     
  2. MMeyers23

    MMeyers23

    Joined:
    Dec 29, 2019
    Posts:
    101
    NVM answered my own question it is the panoramic skybox material option that allows you to make skybox out of a render texture in 2D setting (rather than using cubemap setting for render texture).