Search Unity

Greedy Meshing Textures

Discussion in 'Scripting' started by RiokuTheSlayer, May 22, 2015.

  1. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    Problem time!

    I have a pretty nice Greedy Meshing system going, but I'm having some texture problems. The UV mapping works per-face, so each of these faces made by the Greedy Meshing are mapped normally, and I don't want that, as it produces a stretching effect on the texture. I need it to have some kind of noise so you can tell the difference in depth, which I don't have without the textures. because the lighting is insufficient.

    I've heard about using "Wrapping" in a shader, but I'm only just starting on shaders myself so I don't know how I'd accomplish this.

    Any help would be appreciated!

    Showing how it looks in game:

     
  2. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    Yeah, this is a shader thing. Is there any way in a shader to find the width and height of the current triangle/quad? If there was this would be pretty simple