Search Unity

Place texture on a specific coordinates

Discussion in 'Shaders' started by NapalmRain, Nov 21, 2014.

  1. NapalmRain

    NapalmRain

    Joined:
    Mar 3, 2013
    Posts:
    29
    Is it possible to somehow dynamically pass in the shader coordinates on which to place the texture?
    There is a desire to do something like circles on the water when contact with objects.
    I would be grateful for any advice!
     
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    You can just SetFloat some kind of coordinate, then add that to the texture coordinates. If the texture contains a circle plus some `buffer` around it then it'll let you offset it without it cutting off... but your geometry is going to have to be big enough to contain the circle in all its possible positions.
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    It's probably much easier to use separate geometry for this than to try and do it all in a shader.