Skip to content

Commit

Permalink
Fix halo artifact on Oculus (#3119)
Browse files Browse the repository at this point in the history
Fixes #3109
  • Loading branch information
bluemarvin committed Apr 7, 2020
1 parent fc8a207 commit 2454ab2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ struct DeviceDelegateOculusVR::State {
return;
}
initialized = true;
std::string version = vrapi_GetVersionString();
if (version.find("1.1.32.0") != std::string::npos) {
VRB_ERROR("Force layer clip due to driver bug. VRAPI Runtime Version: %s",vrapi_GetVersionString());
OculusLayer::sForceClip = true;
}

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

ovrLayerProjection2 projection = vrapi_DefaultLayerProjection2();
projection.HeadPose = tracking.HeadPose;
projection.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
projection.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
projection.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;
for (int i = 0; i < VRAPI_FRAME_LAYER_EYE_MAX; ++i) {
const auto &eyeSwapChain = m.eyeSwapChains[i];
Expand Down
2 changes: 1 addition & 1 deletion app/src/oculusvr/cpp/OculusVRLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void
OculusLayerCylinder::Update(const ovrTracking2& aTracking, ovrTextureSwapChain* aClearSwapChain) {
OculusLayerSurface<VRLayerCylinderPtr, ovrLayerCylinder2>::Update(aTracking, aClearSwapChain);
ovrLayer.HeadPose = aTracking.HeadPose;
ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
ovrLayer.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;

for ( int i = 0; i < VRAPI_FRAME_LAYER_EYE_MAX; i++ ) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/oculusvr/cpp/OculusVRLayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class OculusLayerSurface : public OculusLayerBase<T, U> {
void Init(JNIEnv *aEnv, vrb::RenderContextPtr &aContext) override {
this->jniEnv = aEnv;
this->contextWeak = aContext;
this->ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_ONE;
this->ovrLayer.Header.SrcBlend = VRAPI_FRAME_LAYER_BLEND_SRC_ALPHA;
this->ovrLayer.Header.DstBlend = VRAPI_FRAME_LAYER_BLEND_ONE_MINUS_SRC_ALPHA;
if (this->swapChain) {
return;
Expand Down

0 comments on commit 2454ab2

Please sign in to comment.