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

split image into smaller chunks

Discussion in 'Scripting' started by izeko2004, Apr 20, 2015.

  1. izeko2004

    izeko2004

    Joined:
    Dec 28, 2014
    Posts:
    74
    I have a cube which is made from 6 quads. How can i break up a single image into 6 equal parts. 1 for each side.

    Thanks
     
  2. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    Are you talking about UV Unwrapping? This isn't something you would normally do with scripts. This would be with a 3D modeling software or with something like Substance Painter.
     
  3. izeko2004

    izeko2004

    Joined:
    Dec 28, 2014
    Posts:
    74
    No not uv unwrapping.
    Let say I have an image 300 x 300.
    Can I grab 6 images from it 100x100 and then use this to dynamically apply as a texture to a quad.
     
  4. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    Oh then I have no idea. Sorry. I thought for sure you were talking about unwrapping. Thought I nailed that one, haha.
     
  5. izeko2004

    izeko2004

    Joined:
    Dec 28, 2014
    Posts:
    74
    Thanks for trying.
     
  6. Mr-Mud

    Mr-Mud

    Joined:
    Mar 8, 2015
    Posts:
    37
    You could possibly modify the texture scale and offset (though scale scale is named tiling in the editor for some reason). That way you should be able to get the desired result. But since you asked to do it in code, here is the relevant documentation: TextureScale and TextureOffset . I suppose this should be able to get you back on track.