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

Alternatives to 'RenderToCubemap'

Discussion in 'Scripting' started by harvz16, May 9, 2016.

  1. harvz16

    harvz16

    Joined:
    Dec 10, 2012
    Posts:
    12
    Hi all,

    I've been working on getting a live skybox working by rendering to a cubemapped render texture and setting that as the skybox, the issue is that Camera.RenderToCubemap is quite slow and ends up being around 65% of our CPU usage waiting for that to be rendered. Is there an alternative that has less of an overhead?
     
  2. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    I'd Just use several layered cameras. Unless you need reflections, theres not much point rendering an entire cube.
     
  3. harvz16

    harvz16

    Joined:
    Dec 10, 2012
    Posts:
    12
    I did try something similar where I rotated the (then non cubemapped) skybox camera and rendered to a render texture which would be drawn before the ingame camera, but this resulted in some strange clearing bugs.

    I'll give the layered views a go to see if there's any improvement, the issue is that there's up to 4 player split screen which may result in worse performance than my current method (Still worth the shot)
     
    Last edited: May 9, 2016