Search Unity

Check if Pixel belongs to Object

Discussion in 'Shaders' started by Deleted User, Aug 27, 2017.

  1. Deleted User

    Deleted User

    Guest

    Hey, Im writing an Echolocation Surface Shader and therefore it would be useful if I could change the shader depending on which object it hits, as different surfaces have different reflections. As far as I understand shaders, they run for each pixel in every single frame, so would it be possible to check for the pixel that I'm rendering if it belongs to a certain object?
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like you would be best of using a post effect for this purpose?