Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by XMachinaX · Dec 04, 2013 at 11:52 PM · holedepthmaskterraincolliderterrain shader

Depth Mask shader with a depth range/bias

We're sitting with quite a dilemma. The root of our problem is creating holes in terrains.

We cannot use a lowered terrain with mesh blending (we have complicated tunnel systems, cliff systems and basements as well as underwater areas) or model our entire terrain in Maya, neither are valid options.

So we turned to the Terrain Hole System from TRI (available on the asset store). Which uses a fourth black detail terrain texture (that you just paint on the areas you want transparent) to identify the black colour ceated on the splat map as transparent areas and then an additional script (that is placed on objects that have to interact with the hole) allows an object to pass through the hole by detecting when the object is on the black area of the splat map and then temporarily turning off collision.

This worked well except when it came to actually applying a proper terrain shader (ats colormap Ultra 1.6c) to the terrain, we got troubles merging the two terrain shaders (plus the Terrain Hole System is still a bit buggy and doesn't want to always get rid of the black artifacts it creates in the transparent hole areas you paint).

So now we have turned to depth masks to solve the problem as we can create the transparent areas with primitive meshes not a terrain shader and then just solve passing through the hole with a trigger collider that temporarily disables collision.

We are currently using the modified Unify Wiki Depth Mask shader that allows shadows that can be found here:

http://answers.unity3d.com/questions/243371/depthmask-shader-receive-shadows.html

The only little problem we have with depth masks is we cant seem to find a way to set the range or bias on what the depth mask cuts out. Currently it just cuts out the terrain in an infinite range. So when you look through the depth mask on, either side, not just the little area covered by the primitive mesh is cut out, the whole terrain within view of that depth mask's perspective is cut out.

Is there anyway of limiting the range that the depth mask cuts out of a specific render que/object so that not the whole object(s) is cut out just the area covered by the mesh using the depth mask shader?

If this isn't possible is there any other way of solving this problem?

Please any help or advice would be appreciated as this problem is starting to cut into our level construction deadline.

Thanks so much in advance everyone.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 5 make Holes in the Terrain 2 Answers

Sky portal ? best way to texture skybox on object 0 Answers

terrain hole shader needs fixing 1 Answer

How to know the tree's type on terrain I am colliding? 1 Answer

Capsule collider going through terrain collider 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges