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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

RenderTexture.Create failed: RenderTexture too big

Discussion in 'Editor & General Support' started by cecarlsen, Aug 27, 2010.

  1. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    848
    My dearest forum...

    I am currently testing my "game" on windows and get this exotic error:

    Code (csharp):
    1. RenderTexture.Create failed: width and height must be smaller than max Render Texture size
    2. UnityEngine.Graphics:Internal_BlitMaterial(Texture, RenderTexture, Material, Int32)
    3. [...]
    Thankfully Unity is being specific. But where do I check for the max render texture size?

    The windows machine has a GeForce 7300 GT running with DX 9.0c. Image Effects are supported. My shaders are supported.

    Any ideas?

    ~ce
     
  2. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    848
    I am really eager to find a solution to this, but I have no luck so far.

    Is there anyway to check for the maximum RenderTexture resolution supported by the system?

    ~ce
     
  3. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    Any luck on this?
     
  4. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Are you seeing this with Unity 3.x? It was reported as a bug under a previous version but was thought to be fixed in 3.0.
     
  5. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    Yes i am getting this error in Unity 3.1.
    Do you have any !dea how to resolve this issue?
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    how large is the texture? Your hardware supports up to 2048x2048 given there is enough VRAM left for it to be generated, for sure. 4096 can depend a bit on the graphics driver as old drivers used to enforce a max size close to the backbuffer size. also 4096 requires often more vram on its own than a 7300GS has at max.

    What size are you trying to generate?
     
  7. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    Thank you dreamora for replying.

    Actually i am using CrossFadePro script available on UnifyCommunity and in that script there is a code which is creating Texture at runtime.
    Is this issue related with the platform as I am targeting iOS but i'm getting this error in the editor.
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    iOS is very RAM limited, so there you can run up into such limitations rather fast (you have about 100mb at max on a non-iphone4 but 3GS+ device)
    Also I'm unsure if the rendertexture create function
    a) works
    b) does not suffer the same memory bug the texture2d.loadimage function has
     
  9. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    Any idea how to resolve this issue cuz i am getting stuck only at this point. I want to achieve a functionality something similar to No Human for iOS(if you have played)
     
  10. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    I think that issue has been resolved since i am not getting an error in the editor when i changed the size of the GameScene window to iPod wide.
    But now another problem has raised, now i am getting another error saying RenderTexture.Create failed.

    Somebody help me please.
     
  11. Razieln64

    Razieln64

    Joined:
    May 3, 2008
    Posts:
    129
    Same here, I'm trying to create a RenderTexture in the editor so I can render a preview of a camera created by the editor that the user can move around in the scene while changing its orthoSize just so he knows how the camera will zoom in/out in the game without actually moving the real camera in the scene. I'm having the exact same error : RenderTexture.Create failed
     
  12. MaxxVelocity

    MaxxVelocity

    Joined:
    Sep 29, 2019
    Posts:
    12
    In case anyone runs into this in the future:

    There's a very stupid "feature" of Unity that tries to force you to keep your textures under a size. The "max size" is (I think) the square root of the total pixels, so a 100 pixel square image = "size" 10.

    Of course, anyone who works with any significant HD images is going to blow way past the default setting, so unless you have a reason to constrain the size, just set it to the maximum available to make the error go away.

    Shame on Unity, once again, for letting its "features" get in the way of intelligent adult engineering.
     
    tiernan-costain likes this.
  13. enurmatbekov

    enurmatbekov

    Joined:
    Aug 2, 2022
    Posts:
    3
    Is this done in the Build settings/asset import override/max texture size?
    because by default it says "no override"
     

    Attached Files:

    DankalApps likes this.