Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

DepthMask shader on the Terrain

Discussion in 'Editor & General Support' started by br0kenp0ly, Jul 23, 2008.

  1. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    I was wondering if it`s possible to use this shader: http://www.unifycommunity.com/wiki/index.php?title=DepthMask on a terrain? In its present state it doesn`t seem to work, but maybe a little codehack could solve it?

    I got this terrain and need to clip away the bottom of it, so that I don`t see the rectangular shape (corners), only the top circular shape.

    Any suggestions are very welcome :)


    All the best,

    Roald
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    I think 2.0 broke the DepthMask shader and no one's fixed it ont he wiki yet. There's nothing special about the way Terrain is rendered, though, that would prevent it from being depth-masked (if the shader worked)
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The DepthMask shader is fine in 2.x...it quite literally doesn't do anything (except to draw nothing into the depth buffer) so it would be really hard to break. ;) I'm not sure you can use anything other than the terrain shaders on the terrain, though.

    --Eric
     
  4. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    Hi guys thanks a lot for replying :)
    My initial plan was to apply this shader to a plane that would act like a "cut-plane" on the terrain, but that didn`t work at all. I guess the only solution would be to model the entire terrain in 3ds max then, and lose all the cool possibilities one has with the terrain object.

    Oh well... thanks again!
     
  5. forestjohnson

    forestjohnson

    Joined:
    Oct 1, 2005
    Posts:
    1,370
  6. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    Thanks man! I`ll give that one a try tomorrow, but it looked a little complicated.

    ..and.. i did google, but apparently looked in the wrong place! :)
     
  7. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    Hey Forest thanks again for your reply! It worked just the way I hoped now :)
    It seems that the depthmask-shader i used was different from the one in your package, so I just deleted the old one and replaced it with yours... voila!

    :D