Search Unity

How much performance hit Render Textures?

Discussion in 'General Discussion' started by CaoMengde777, Mar 30, 2015.

  1. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    so... im coming up with an idea for an implementation ... game designing..

    how much do Render Textures hit performance? is it significant? .. since I havent used Pro, im just now making some ideas with Render Textures involved..

    would it be viable to use say 20 cameras/ render textures + say main camera, hud camera, maybe another camera or two lol all with pretty decent amount of polys and textures.. (unknown?) all in a scene at once

    or would like 10 render texture cameras in a scene be too many? .. id say 10 render textures would be viewable at once

    lol or is that asking too much? i know very little about render textures

    i suppose each camera does a draw call on each thing? .. do they do 2? 3? extra draw calls per render texture/ camera .. or some ridiculous things like this?
    lol oh dang its called setpass calls now >< .. is that worse or better? lols .. dang i gotta learn more about unity 5 ..


    hmm.. so the skybox is 1.7k tris?
    so minimum id have like, say 45k tris .. ><

    hmm no i guess its not exactly doubled for each RT ..??
    ohhh stuff is getting batched cause the scene im testing with now is ultra simple cubes .. guess ill just go ahead and build a test of my desired thing
     
    Last edited: Mar 30, 2015
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Well, RenderTexture is just a tool...the performance hit you get will be directly related to what you're doing with them. If you're rendering multiple camera views of your scene directly to render texture then yes you're going to have a quite a performance hit with that (well, depending on how complex your scene is). But there are other uses of rendertexture other than just rendering your scene to them.
     
    randomperson42 likes this.
  3. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    yeah okay, so its just the performance of rendering X # of cameras.. ?

    just wondering if there was some extra crappiness with render textures, or something
    hopefully its not a big deal..
     
  4. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    936
    Only way to really know is to try it out and see what happens!
     
    angrypenguin and BrandyStarbrite like this.
  5. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    My understanding is that the render texture itself wouldn't cause too much of a performance hit. But, rendering things is generally going to take some time. So, using the texture shouldn't be too much issue. But, rendering the scene from another point of view in another place will, as you might be rendering literally twice(or more, depending on the amount of cameras). So, the trick to make it work, is to make sure that these cameras are only rendering what is actually needed. Unity has the layer system for this. When something is going to be needed only by a specific camera, then set up the layers so that only that camera renders those things, and those things are only rendered by that camera. So, at the least you can save your rendering time only rendering what is needed.
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    For some things, you can make good use of command buffers so that you can dodge any extra culling costs.

    Rendertexture switches are low to moderately expensive on modern mobiles and not really a big deal on desktop.
     
    spider853 likes this.