Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 2454ab2

Browse files
authored
Fix halo artifact on Oculus (#3119)
Fixes #3109
1 parent fc8a207 commit 2454ab2

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ struct DeviceDelegateOculusVR::State {
146146
return;
147147
}
148148
initialized = true;
149-
std::string version = vrapi_GetVersionString();
150-
if (version.find("1.1.32.0") != std::string::npos) {
151-
VRB_ERROR("Force layer clip due to driver bug. VRAPI Runtime Version: %s",vrapi_GetVersionString());
152-
OculusLayer::sForceClip = true;
153-
}
154149

155150
layersEnabled = VRBrowser::AreLayersEnabled();
156151
SetRenderSize(device::RenderMode::StandAlone);
@@ -1018,7 +1013,7 @@ DeviceDelegateOculusVR::EndFrame(const FrameEndMode aEndMode) {
10181013

10191014
ovrLayerProjection2 projection = vrapi_DefaultLayerProjection2();
10201015
projection.HeadPose = tracking.HeadPose;
1021-
projection.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
1016+
projection.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
10221017
projection.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;
10231018
for (int i = 0; i < VRAPI_FRAME_LAYER_EYE_MAX; ++i) {
10241019
const auto &eyeSwapChain = m.eyeSwapChains[i];

app/src/oculusvr/cpp/OculusVRLayers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void
8787
OculusLayerCylinder::Update(const ovrTracking2& aTracking, ovrTextureSwapChain* aClearSwapChain) {
8888
OculusLayerSurface<VRLayerCylinderPtr, ovrLayerCylinder2>::Update(aTracking, aClearSwapChain);
8989
ovrLayer.HeadPose = aTracking.HeadPose;
90-
ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
90+
ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
9191
ovrLayer.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;
9292

9393
for ( int i = 0; i < VRAPI_FRAME_LAYER_EYE_MAX; i++ ) {

app/src/oculusvr/cpp/OculusVRLayers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class OculusLayerSurface : public OculusLayerBase<T, U> {
174174
void Init(JNIEnv *aEnv, vrb::RenderContextPtr &aContext) override {
175175
this->jniEnv = aEnv;
176176
this->contextWeak = aContext;
177-
this->ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
177+
this->ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
178178
this->ovrLayer.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;
179179
if (this->swapChain) {
180180
return;

0 commit comments

Comments
 (0)