Search Unity

Question UV Map Model Like Default Cube?

Discussion in 'General Graphics' started by kevanderson97, Feb 4, 2021.

  1. kevanderson97

    kevanderson97

    Joined:
    Sep 23, 2018
    Posts:
    6
    So, I'm using a vertex shader to manipulate an object and recolor certain parts of the model. The shape is just a cube, but I can't use the default cube for this because there are very few vertices on it, so it doesn't work for how incremental I want this to be. I'm not a modeler, so I'm having a lot of trouble trying to map my texture properly. Previously, I just applied my image to the cube and Unity's default cube applied the whole image to every side and scaled it to fit. Since I made my textures with this in mind, I'd like to replicate this behavior, but when I try importing a new, subdivided cube the texture is never applied properly. It applies part of the material to each side, and sometimes it looks goofy with parts of the subdivision. I assume the reason it does this is because of UV Mapping.

    How do I map the model to automatically scale the input material down to fit the size of each side and then apply the same, complete material to every side of the object instead of segmenting the material across every side?

    It's a perfectly symmetrical cube by default. The only thing I've done to it is subdivided four of the sides to be split up into much smaller pieces (top and bottom are untouched). I created the model in Blender. I just want this cube to apply materials/textures like the default Unity cube.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    There's nothing particular special about how Unity's default cube is UV'd. Each "face" of the cube has you default, basic box projection. Just make sure the UV goes from 0.0, 0.0 in one corner to 1.0, 1.0 to the other and you're good to go.