Search Unity

Draw texture inside defined UV's? Need Help!

Discussion in 'Shaders' started by Sumaccamus, May 26, 2015.

  1. Sumaccamus

    Sumaccamus

    Joined:
    Jul 5, 2014
    Posts:
    26
    Hey everybody,

    I try to project a texture to a plane. now the simplest and fastest way i can think about is: to take the texture of the plane and define the edge points of uv for the projecting texture.

    I guess it's the best to draw a graphic instead of write a long, boring text to show you what i mean
    Projection_Shader.png
    Is it possible to do this?
    I'm glad about every answer.

    If there are any questions open, please ask.
     
    Last edited: May 26, 2015
  2. hadynlander

    hadynlander

    Joined:
    Jan 24, 2014
    Posts:
    41
    The simplest and fastest way would probably be to use the built in Projector component.

    It would be possible to create the effect yourself, but it seems unnecessary - unless there's something specific you're trying to do that can't be done with a Projector?
     
  3. Sumaccamus

    Sumaccamus

    Joined:
    Jul 5, 2014
    Posts:
    26
    Hey hadynlander,
    i try to use it with render textures (draw texture) and want to do it multiple times a frame. so its to slow if i render it from a mesh and back to texture.
    now i made a shader that uses linear equations but seem to be a little bit to slow.

    isn't it possible to define a matrix from the edges?