Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
2
Question by dtbaker · Jan 31, 2017 at 10:35 AM · 3daugmented-realitymaskclippingdepthmask

Clip 3D Object to specific volume

I have a large animated 3D object that I want to be only visible in a small 3D space. Any part of the 3D object outside of this region should be invisible to the camera, no matter where you're standing. How would I clip to this region within Unity?

I've been struggling with this for a very long time, I would love any amount of help or suggestions! Thanks!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by anilhdas · Jan 31, 2017 at 12:01 PM

If I read it right, you want to mask a part of a 3d object in the camera.

You can use Mask script to mask the part of the object from being visible from the camera. Something like this :

Mask Disabled: Mask Disabled.png

Mask Enabled: Mask Enabled.png .

.

You can read further on this link:

https://docs.unity3d.com/Manual/script-Mask.html


maskenabled.png (11.3 kB)
maskdisabled.png (14.4 kB)
Comment
Add comment · Show 3 · Share
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
avatar image dtbaker · Jan 31, 2017 at 07:45 PM 0
Share

Hey! Thanks for the response. I think this is close to what I had in $$anonymous$$d, let me try to explain it a bit further. One caveat is that it would need to stay confined to a 3D area in space, so as you walk around it, it occupies only that area.

I'm basically making a moving topography much like the one seen in the pic I'm attaching, that I want to keep only viewable in the box it sits in. So as you walk around the topography and scroll it around, you can only see the portion that's inside the box. alt text

Would placing a mask around the edges of this box do the trick? Thanks again for the response.

augmented-reality-sandbox.jpg (44.9 kB)
avatar image anilhdas · Feb 01, 2017 at 04:49 AM 1
Share

Ok, so if you want to mask a 3D object confining it to a 3D space (possibly within another object as you queried), you can use invicible shaders.

Add planes to 4 corners of your table, scaling it to comfortably to hide your 3D object below it. And add invicible shader to that planes.

The shader will refrain camera from rendering the plane and anything below it.

Hope this helps

avatar image dtbaker anilhdas · Feb 02, 2017 at 12:22 AM 0
Share

Sweet! That makes total sense, but I tried it and it just isn't working in my project. I'm really, really close though.

To make the shaders and set the render queue, I followed exactly these steps and code snippets in a similar forum thread (http://answers.unity3d.com/questions/316064/can-i-obscure-an-object-using-an-invisible-object.html). I'm just trying to obscure any part of the topography at this point as a test.

I made an invisibility shader, applied it to a material, assigned that material to a plane/cube, and set the render queues to render the objects I want to obscure after the invisibility shader plane/cube.

In theory, this should make any part of the topography below the plane invisible, but all it does on my end is make the shader plane invisible without affecting the topography. Is there a step I'm missing in the process?

avatar image
1

Answer by sundhar_unity · Sep 07, 2020 at 04:37 PM

https://youtu.be/6l60g-G5RqU Check this

Comment
Add comment · Share
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

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

96 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 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 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 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 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 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

Sprites showing through each other in 3D 0 Answers

How to implement the ability to move and place objects in HoloLens Application? 0 Answers

Mask Pupil within Eye plane? 0 Answers

Cover overlay sprites with geometry 0 Answers

GUI Texture slide down || Clipping mask. 0 Answers


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