s-ol’s avatars-ol’s Twitter Archive—№ 1,239

  1. I need some help with #unity3d shaders! I am trying to figure out a way to detect coinciding *faces* of meshes and color them in in a separate color. I tried drawing the meshes twice, once with additive blending, and then another time with a GrabPass{} and a Surface Shader [1/]
    1. …in reply to @S0lll0s
      ...but this way I can only detect whether the faces overlap in screen-space, but this means that if one Mesh is behind the other that is also considered an "overlap": gfycat.com/SevereWavyCaracal [2/]
      1. …in reply to @S0lll0s
        I would like to only detect coinciding faces, e.g. when the two Cubes are at the same position, or only a half side-length apart on a single axis. I tried to use "DepthTest Equal" but it seems to be too unreliable. [3/]
        1. …in reply to @S0lll0s
          How can I do this? I understand rounding/float equality is an issue here, but there with a specific error margin/window it would be fine right? [4/4]
          1. …in reply to @S0lll0s
            paging @totallyRonja One Idea that I have left but that seems wasteful is to render each Mesh (in this case there is a max of 4 of them) to its own RenderTexture and then either re-render each one or a full-screen quad with the four RenderTextures attached for lookups.