Search Unity

Question Looking to crop/cull/mask meshes OUTSIDE a volume

Discussion in 'Shader Graph' started by alexchesser, Feb 13, 2020.

  1. alexchesser

    alexchesser

    Joined:
    Sep 15, 2017
    Posts:
    147
    I only get a few hours at a time to code on this (after I put my kid to bed). I'm looking to write my first shader-graph-shader this weekend and am trying to gather some info now so I'm in good shape to get rolling come friday night!

    My problem statement is that I have a 3D world map that I want to display within a sandbox. Everything that doesn't fit within the bounds of the box can be hidden, but I *would* like to be able to scroll the map within the sandbox.

    I'm willing to parent the map element to the bounding box, but can arrange the scene in any way that lets this work a bit dynamically. Maybe a single component on the MAP-parent - I really only have a slight idea of waht I'm doing (again, first shader-graph, first shader).

    Here's a sketch of what I'm trying to do (not actually using the fortnight map in mine, but you get it)
    On a 3d plane It'd be cool if I could give a solid color to anything that is "BELOW" the ground level.

    Does anyone have some advice on where to start here, have you seen a tutorial that roughly matches the ask here?

    upload_2020-2-13_9-43-29.png
     
  2. alexchesser

    alexchesser

    Joined:
    Sep 15, 2017
    Posts:
    147
    Or maybe ... is it possible to create an occlusion volume that applies only to items with a given tag or on a specific layer?