diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index b7e56f035cad5b89473b4cbfe1a51afc8bef36d4..1ea71d2186d4a22a7c82d5c4da585c9e6b3d52f9 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1700,8 +1700,11 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset()
 		agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation();
 	}
 
-    static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d());
-	return focus_offset_initial * agent_rot;
+// [RLVa:KB] - @setcam_focusoffset
+    return getFocusOffsetInitial() * agent_rot;
+// [/RLVa:KB]
+//    static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d());
+//	return focus_offset_initial * agent_rot;
 }
 
 void LLAgentCamera::setupSitCamera()
@@ -1838,8 +1841,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
 		}
 		else
 		{
-            static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale");
-            local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale;
+// [RLVa:KB] - @setcam_eyeoffsetscale
+            local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * getCameraOffsetScale();
+// [/RLVa:KB]
+//            static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale");
+//            local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale;
 
 			// are we sitting down?
 			if (isAgentAvatarValid() && gAgentAvatarp->getParent())
@@ -2143,15 +2149,32 @@ LLVector3 LLAgentCamera::getCameraOffsetInitial()
 {
     // getCameraOffsetInitial and getFocusOffsetInitial can be called on update from idle before init()
     static LLCachedControl<LLVector3> camera_offset_initial (gSavedSettings, "CameraOffsetRearView", LLVector3());
-	return camera_offset_initial;
+// [RLVa:KB] - @setcam_eyeoffset
+    static LLCachedControl<LLVector3> camera_offset_initial_rlv (gSavedSettings, "CameraOffsetRLVaView", LLVector3());
+    return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? camera_offset_initial : camera_offset_initial_rlv;
+// [/RLVa:KB]
+//	return camera_offset_initial;
 }
 
 LLVector3d LLAgentCamera::getFocusOffsetInitial()
 {
     static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d());
-	return focus_offset_initial;
+// [RLVa:KB] - @setcam_focusoffset
+    static LLCachedControl<LLVector3d> focus_offset_initial_rlv(gSavedSettings, "FocusOffsetRLVaView", LLVector3d());
+    return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? focus_offset_initial : focus_offset_initial_rlv;
+// [/RLVa:KB]
+//	return focus_offset_initial;
 }
 
+// [RLVa:KB] - @setcam_eyeoffsetscale
+F32 LLAgentCamera::getCameraOffsetScale() const
+{
+    static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale");
+	static LLCachedControl<F32> camera_offset_scale_rlv(gSavedSettings, "CameraOffsetScaleRLVa");
+	return (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? camera_offset_scale : camera_offset_scale_rlv;
+}
+// [/RLVa:KB]
+
 F32 LLAgentCamera::getCameraMaxZoomDistance()
 {
     // Ignore "DisableCameraConstraints", we don't want to be out of draw range when we focus onto objects or avatars
@@ -2570,9 +2593,9 @@ void LLAgentCamera::switchCameraPreset(ECameraPreset preset)
 			else
 			{
 				// When switching to our view, copy the current values
-				mRlvCameraOffsetInitialControl->setDefaultValue(convert_to_llsd(getCameraOffsetInitial()));
-				mRlvFocusOffsetInitialControl->setDefaultValue(convert_to_llsd(getFocusOffsetInitial()));
-				mRlvCameraOffsetScaleControl->setDefaultValue(getCameraOffsetScale());
+				gSavedSettings.setVector3("CameraOffsetRLVaView", getCameraOffsetInitial());
+				gSavedSettings.setVector3d("FocusOffsetRLVaView", getFocusOffsetInitial());
+				gSavedSettings.setF32("CameraOffsetScaleRLVa", getCameraOffsetScale());
 			}
 		}
 	}
diff --git a/indra/newview/rlveffects.cpp b/indra/newview/rlveffects.cpp
index b3ad464646864771d97fc1e961c88b2fe1c24c81..1767bd647635767f67bc0161d782816b638677f8 100644
--- a/indra/newview/rlveffects.cpp
+++ b/indra/newview/rlveffects.cpp
@@ -114,10 +114,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*)
 {
 	if (m_pImage)
 	{
-		if (LLGLSLShader::sNoFixedFunction)
-		{
-			gUIProgram.bind();
-		}
+		gUIProgram.bind();
 
 		int nWidth = gViewerWindow->getWorldViewWidthScaled();
 		int nHeight = gViewerWindow->getWorldViewHeightScaled();
@@ -144,10 +141,7 @@ void RlvOverlayEffect::run(const LLVisualEffectParams*)
 		gGL.flush();
 		gViewerWindow->setup3DRender();
 
-		if (LLGLSLShader::sNoFixedFunction)
-		{
-			gUIProgram.unbind();
-		}
+		gUIProgram.unbind();
 	}
 }
 
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 15e5636989a1c6223d1492c2729916628589ad2a..a6cf2aa21038a47cf54d688477e7e7716d8dd3a2 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -1549,6 +1549,16 @@ bool RlvHandler::setEnabled(bool fEnable)
 		// Reset to show assertions if the viewer version changed
 		if (gSavedSettings.getString("LastRunVersion") != gLastRunVersion)
 			gSavedSettings.set<bool>(RlvSettingNames::ShowAssertionFail, TRUE);
+
+		// Set up camera debug controls
+		{
+			LLControlVariable* pCameraOffsetRLVaView = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3::zero, "Declared in code", LLControlVariable::PERSIST_NO);
+			pCameraOffsetRLVaView->setHiddenFromSettingsEditor(true);
+			LLControlVariable* pCameraOffsetScaleRLVa = gSavedSettings.declareF32("CameraOffsetScaleRLVa", 0.0f, "Declared in code", LLControlVariable::PERSIST_NO);
+			pCameraOffsetScaleRLVa->setHiddenFromSettingsEditor(true);
+			LLControlVariable* pFocusOffsetRLVaView = gSavedSettings.declareVec3d("FocusOffsetRLVaView", LLVector3d::zero, "Declared in code", LLControlVariable::PERSIST_NO);
+			pFocusOffsetRLVaView->setHiddenFromSettingsEditor(true);
+		}
 	}
 
 	return m_fEnabled;
diff --git a/indra/newview/rlvmodifiers.h b/indra/newview/rlvmodifiers.h
index 374ef585670532f73c0ddc4ee37e2c670ec23dcf..a17a7525a1e46989b6288ea28759f2adfc8309a8 100644
--- a/indra/newview/rlvmodifiers.h
+++ b/indra/newview/rlvmodifiers.h
@@ -121,7 +121,7 @@ class RlvCachedBehaviourModifier
 public:
 	RlvCachedBehaviourModifier(ERlvBehaviourModifier eModifier)
 	{
-		if ((mCachedModifierPtr = RlvBehaviourModifierCache<T>::getInstance(eModifier)) == nullptr)
+		if ((mCachedModifierPtr = RlvBehaviourModifierCache<T>::getInstance(eModifier).get()) == nullptr)
 			mCachedModifierPtr = new RlvBehaviourModifierCache<T>(eModifier);
 	}