Search Unity

Cutting "holes" using projectors/shaders -- tutorial or docs?

Discussion in 'Shaders' started by guru20, Jul 4, 2015.

  1. guru20

    guru20

    Joined:
    Jul 30, 2013
    Posts:
    239
    I was wondering if anybody could point to a good tutorial and/or documentation about using projectors/shaders to achieve a see-through hole/transparency of a poly/mesh (specifically, of a certain Layer, so that it would only "cut through" some objects, not others)

    I've seen mention that this can be done, and have seen some code, but haven't seen a complete guide for how to do it (shaders are one area of Unity I have not always been great at wrapping my mind around)... any recommendations?

    My specific scenario is this: I have "tunnels" that intersect through walls of basic meshes (box-like buildings), thus the "wall" of that building still appears; I'd like to be able to project a "hole" through the middle of the tunnel/tube so that any intersecting polygons are simply invisible (in other words, to make invisible a circle of the tube/pipe diameter, perpendicular/normal to the angle of the pipe.) Seems like this is possible, but not sure exactly how to do it...