Is it possible to hide a specific element from a camera?
I have two cameras on one scene, both are looking at the same coordinates, placed with priorities 0 and 1 respectively. I would like for one of them to ignore a specific entity.
What’s the bigger picture? True Stereoscopic video
I’ve forked the WebVR project as my boilerplate.
This project loads a monoscopic equirectangular video and does what it should as far as looking around, touch and HMDs.
All good up to here, but I can’t find anything in regards to how this can play stereoscopic content.
My thoughts are:
Tweak the media-player.js script to ask for type of equirectangular (mono, top/bottom, side by side).
If mono is selected, … it all stays as its running now.
If either Top/Bottom or Side-by-Side are selected, there is a routine to move the UV of the sphere to either [1, 0.5] or [0.5, 1].
on EnterVR, the sphere is duplicated and the proper adjustment is made to UV so that it can show the other half of the texture ([1,1.5] or [1.5, 1])
Sphere 1 is hidden from right eye, and Sphere 2 is hidden from left eye.
Everything else stays the same…
Specific questions:
Does the EnterVR routine actually create a second camera? Can I hack my way into the current system… or even better, is there a way to access the cameras for each eye?
How can I hide elements for each of the cameras? Ideally, I want the rest of my true 3d elements to do their thing… they already appear 3D with the current WebVR project… the problem is video.
@yaustar you were definately right on this one. Masking did the trick.
I placed two cameras side by side, tweaked their view ports to have them each occupy half the screen, but this forces to manually create two cubemaps and add the renderMask function to every entity that’s added to the scene.
Hey @jonalexfilms, I don’t know if that is still relevant almost 5 years later, but you can achieve that now with a custom shader chunk. Basically displaying a different texture depending on which eye is rendering in WebXR.
Have a look here: