- Home /
Occluding rendering with an invisible wall.
Is there an easy way in Unity to have an invisible wall that blocks rendering? I'm trying to create something like this;
https://www.youtube.com/watch?v=nMUYwPognsw
Basically it's a portal that you can look through with nothing rendered outside it (making it great for AR applications such as above)
The only other way I can think of for this to work would be to have a rendertexture that renders the output of a camera - but I have a feeling that would look wonky, and wouldn't make it easy to animate things coming out of it. Ideally I'd like that to be the actual 3d space but just having other objects blocking the rendering somehow.
Answer by $$anonymous$$ · Jan 17, 2018 at 07:48 PM
maybe you can do something with this youtube video, and that the plane followed the player https://www.youtube.com/watch?v=cuQao3hEKfs
Yes - I considered this idea too. Using a rendertexture on a world-space canvas (actually I mentioned that idea in my question as the last paragraph) I just wasn't sure if things would line up right... but I see from this video that they do.
I'm reasonably happy with this idea.
Oh shoot... this requires knowing the rotation of the player. I haven't had much luck with that on mobile for AR applications... I can't seem to get the rotation and tilt right. That might be something for another question.
Never$$anonymous$$d - I'm using image-targeting AR, which sets the position of the camera. The video you linked WILL work for me.
Thanks!