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:
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…
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.
January 13, 2018, 9:56am
There are a couple of three.js video examples where they use a shader to do render each side for each eye which you could port over.
To answer your question directly, you can mask objects from the cameras (example here
I don’t know if you can access the 2 cameras directly or even if there are 2 cameras
I’ve worked with a frame in the past and it has a way around to view stereoscopic.
I’m definitely looking to stay in playcanvas
@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.
Try it with a cardboard.
Unfortunately this is not really stereoscopic.
The view port doesn’t go full screen
I don’t get the black boarders and lens distortion on each eye
and there isn’t a proper way of entering and exiting vr.
Maybe adding functions to toggle the viewport size of each eye could solve the problem of entering/exiting vr, but still …
@max @dave @will @Mr_F any thoughts?
What device is what on?
Once you launch the scene, on phone or pc, you should see a split screen.
If you put this in a google cardboard or any other generic VR goggles, you should see this as a stereoscopic scene.
I’ve circled back to this project.
Any updates on stereoscopic video in VR
@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:
I agree, there’s no direct support for this.
In the engine, when rendering each draw call, we swap some uniforms (mostly camera related) for each view (eye). See the code here:
Perhaps you could do a custom shader / chunk and use the viewPos to detect left vs right, and output color from different cubemap or similar.