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

Setting texture sizes via scripting?

Discussion in 'Scripting' started by klindeman, Jan 11, 2006.

  1. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    I was asking David today at Macworld about performance issues on lower end hardware, and Open Fire. He was thinking that maybe because my textures sizes were huge. He remembered doing some scripting in Gooball that set the texture sizes via scripting so it wasn't uploading huge textures to the graphics card, but couldn't remember how to do it (and we also couldn't find it in the docs).
     
  2. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
  3. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    :p we can always scale the textures down if we need to. I mean its kind of overkill for the tank and hummer. I just like working with bigger better, always easyer to scale down than up.
     
  4. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    Yup it works... Although it's a global limit and there is currently no way to exclude textures from it.

    Here's a small script you can attach to a clickable object (such as a GUIText) to try it out. It cycles through different levels from 0 to 4 on every click.
    Code (csharp):
    1.  
    2. var texLimit=0;
    3.  
    4. function OnMouseUp(){
    5.    Texture.masterTextureLimit=texLimit;
    6.    texLimit++;
    7.    if(testTexLimit==5) texLimit = 0;
    8. }
    9.