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 Banister88 · Jul 10, 2012 at 06:24 PM · boxocclusionrealityaugmentedsee through

Need box with clear walls on the outside, visible on the inside, but not see through.

I'm looking for a way to construct a box such that from the outside you would not be able to see it, but from in the inside you would be able to see all of the walls. I don't want to simply flip the normals because then that would result in being able to see through one wall and seeing the inside of the other wall.

The origin for this problem is that I'm using the String Augmented Reality plugin and I'm trying to make it look like I have a hatch in my desk where the lid can be removed and you can see the contents of the containers by looking through the fake hole in my desk. Very similar to the this video here which shows the top of the table moving down into the box. I'm not sure how they managed to make the table occlude everything but the top of the box, but that doesn't come easy. Anyone have any ideas?

Comment
Add comment · Show 5
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 Bovine · Jul 10, 2012 at 08:06 PM 0
Share

I'm not sure what you really need here - I was thinking that you could wait until the camera is inside the box to render it (normals flipped), but I'm not so sure now I've watched the video.

Very cool video btw, presumably the plugin is doing the motion tracking based on the reference image they are placing on the surface?

Can you elaborate on the issue as I don't think it's clear enough, at least not for me to be able to help...

avatar image Banister88 · Jul 10, 2012 at 08:41 PM 0
Share

The problem is that they have a box that appears sunk in to the surface. I have the box showing when the camera sees the marker, but it draws on top of the video feed, I'm thinking they are using some kind of occlusion to prevent the box from being seen unless you're looking through the top

$$anonymous$$aybe they're using a custom shader or something, that's what I'm trying to figure out. What kind of trick might they be using? I'll post a photo tomorrow showing what $$anonymous$$e looks like.

avatar image Bovine · Jul 10, 2012 at 08:50 PM 0
Share

Ahh I think I get it... I've had a glass of wine, so I'll mull it over and post of I have anything concrete.

avatar image reptilebeats · Jul 10, 2012 at 08:58 PM 0
Share

yh if you find anything out let us know, ive never done anything with using the camera could be a bit of fun

avatar image Bovine · Jul 11, 2012 at 07:46 AM 0
Share

There's a thread here on writing a shader that clips:

http://forum.unity3d.com/threads/11832-Shader-for-Clipping-plane

Which is essentially what you want to do. I don't see anywhere to setup an arbitrary clip plane, but you might be able to hook into the render pipeline with some C plugin and setup a clip-plane - it's fraught with complications of course.

To do what is described in the video, shaders might be the way to go.

$$anonymous$$aybe something like:

  • Camera A draws a transparent box with no top (i.e. no colour values, writing to the Z buffer, but not writing over the colour values already rendered).

  • Camera B, later in the draw order does not clear the Z buffer but draws the garage geometry.

The first drawing is to set values in the Z buffer so that subsequent drawing will not write into the Z buffer. As such it could be triangles that describe the table top (for instance) sans the area described by the garage 'floor' - you could even draw a plane facing the camera. Achieving the right Z values might be a case of setting the near and far clipping planes appropriately and you could tweak these live I imagine to see if the garage 'shows through' correctly. You'll probably need a shader for the first bit of geometry but it ought to be relatively simple and Strumpy Shader Editor ought to help here.

The problems will be Z-fighting if the depth information is not fine-grained enough, which is why it would be best to draw something very close to the camera, and in fact, you'll probably find by doing so that using the same near and far clipping planes will be enough.

If Unity does have some clipping plane functionality built in, this would be easier and may be cheaper, but you'll need to set the planes to track the intersection of the camera's position with the near edges of the garage 'floor'.

This is largely off the top of my head thinking, so someone with more experience might have a better solution.

Cheers Bovine

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

6 People are following this question.

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

Related Questions

Checking camera distance between object in a AR game 1 Answer

Augmented Reality in Unity Basic 1 Answer

[Augmented Reality] How to import object on the user defined marker? 0 Answers

Vuforia Virtual buttons question 1 Answer

how can i create a count down AR object that depends on a variable of remainnig stock? 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