Forum Discussion
Gruguir
9 years agoMHCP Member
Monoscopic background with render texture ?
I can't find information on how to achieve monoscopic background with RT applied to a quad. I was able to do it without trouble some time ago then something went wrong. No matter what it try i get weird results. Is this a known issue with actual Unity (5.3.4p5)/OVR Utils versions, or does someone have some advices ?
13 Replies
Replies have been turned off for this discussion
- FulbyHeroic ExplorerYep it was the render texture version that wobbled (probably, I can't remember), the dual OVRCameraRigs version is fine.
- vrdavebOculus StaffNear and far OVRCameraRigs should actually line up perfectly. It will only wobble if you use a "center eye" camera that renders only one image for the far frustum.
- FulbyHeroic ExplorerI'm not sure regarding the projectionMatrix - I use the dual OVRCameraRig method now (near cam and far cam) and that works well enough, though the far camera rig only renders objects in my game's 'enormous object' layer. Yes I think it wobbled a bit - was a couple of months ago and I don't remember the details.
I might re-examine using a render texture when I've some time (or try Oculus' example if it becomes available first) as it may let me improve the graphical quality a little with the spare horsepower. - vrdavebOculus StaffYour approach sounds good for a space shooter. Performance-wise, your approach should be pretty similar to ours. You may just see a slight wobble in the background image until we share our sample. Your projection issues should be fixable today. Are you setting Camera.projectionMatrix equal on all your cameras?
- FulbyHeroic ExplorerCheers. Do you have a recommendation on which technique to use for a space game (so sparsely populated scenes) with the far clip plane of the normal camera at 1000m? Presumably the Oculus sample when it's available should be the most efficient?
- vrdavebOculus Staff
the far plane of the normal cam and near plane of the background diverged towards the edge of the view but matched up in the centre
That sounds like an issue with your projection matrix. Unity renders with a symmetric frustum, so your left, right, and center cameras should all use the same FOV. Only the near and far clip planes should be different. And the position of the center eye should be the average of the left and right eyes and all 3 should have the same rotation.
- FulbyHeroic ExplorerThanks vrdaveb. The image was correct in the XY plane and my far clip plane for the normal cam was 1000m. I had to overlap the planes slightly to avoid a halo effect on steep triangles (possibly my render texture was too low res).
What it looked like was that the far plane of the normal cam and near plane of the background diverged towards the edge of the view but matched up in the centre. I think it only happened on the Gear, not when testing on the PC (monitor, not Rift). I don't understand how that could happen - I could have had the head pose for the background wrong if that would explain it. I switched to the dual camera rig method a while ago so can't check. Not critical, just wondered if this was a common error with a known change to correct it. - vrdavebOculus Staff> i can't find a scene named "Mono Optimization"
Sorry, looks like that one hasn't shipped yet. We are working on first-class support for this, but the internal sample does it a different way, using command buffers to make sure there is no pose drift between the background and foreground cameras. I'll see if we can expedite shipping the feature or the sample. In the meantime, your current approach sounds reasonable.
> I had problems with 'gaps' opening up between the near cam's far plane and render texture
Make sure you use the same head pose for both the foreground and background cameras. The background camera should render from the midpoint between the two eyes. You can copy the background image to the left and right eye buffers before the foreground cameras start rendering. Shift the image to the left or right to account for the eye pose difference. If the background's near-clip plane matches the foreground's far-clip plane and you use the same projection matrix for both, the images should line up almost perfectly. You will only see gaps if the split plane is closer than ~10m, where binocular parallax is more than a pixel or two. - GruguirMHCP MemberLooks like i found a workaround. My background RT cam mimics the main camera on precull. RT quad is parented to bg cam. According to the device (desktop/mobile) i search and setup the best quad's z-distance from cam. A little hacky but seems to do the trick.
- GruguirMHCP MemberI had some hopes reading @vrdaveb answer but now it looks like my GearVR project is stuck for good. I can't find up to date infos on this anywhere, and nothing in the Sample Framework after many checks. the desktop and mobile results are differents and unpredictable from one version to another. Any advices are welcomed.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months ago
- 1 year ago