Search Unity

2d Texture repeat direction

Discussion in 'Shaders' started by Eiseno, Sep 4, 2019.

  1. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    81
    I have 25x25 cubes at scene. I give it a texture with Tiling- offset settings. But i have problem about cubes at corner. i want it repeat like at top surface so i cant see it like 3D object. But as u see it doesnt cover other surface like i want. How can i solve this ? Do i need a shader ?

    * You can think like i am adding circle texture to box object and i expect it looks like cylinder.
    Problem1.png problem2.png
    problem3.png
     
    Last edited: Sep 4, 2019
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,698
    A box is just a box. Think of it like a cardboard box. If you paint part of the outside of a box red, then cut out the areas that you didn't paint, you're just going to get a box with a big hole in it. The same thing is happening here. If you want it to have some kind of volume to it, the easiest solution is to fake it and not use a box at all. Just use multiple quads stacked on top of eachother. As long as you don't let the camera get too far to the sides or too close it'll look just like a solid object that's been sliced through. Really, the shader-based solutions that you would do would be doing the same thing, just raytracing the planes in the shader instead of having them as geometry.